# invideo Platform > One API for video, image, audio, and language models. One API key for the top video, image, audio and language models. Pay per use in USD, no subscription. ## Start here - [Quickstart](https://platform.invideo.io/docs/quickstart.md): sign up, make a key, run a model with curl. - [For AI agents](https://platform.invideo.io/docs/agents.md): everything an agent needs to integrate alone. - [Models](https://platform.invideo.io/models.md): every model with its price. - [All docs](https://platform.invideo.io/llms.txt) as a list, or [in one file](https://platform.invideo.io/llms-full.txt). --- # invideo Platform docs > One API for video, image, audio, and language models. Pay per use in USD. Use one API key to run video, image, audio, and language models. For media, send the model ID and inputs, then use the returned request ID to fetch the files. ## Start here - [Quickstart](/docs/quickstart): make a key and run your first model in five minutes. - [For AI agents](/docs/agents) explains how to sign up, create a key, and call the API. - [API reference](/docs/api-reference) lists endpoints, requests, and responses. - [Models](/models): every model with its inputs and its prices. - [Test your integration](/docs/guides/test-model): Try successful requests, errors, and retries with free test models. ## Build with media - [Video](/docs/video) covers generation, editing, and reference inputs. [Video provider formats](/docs/sdks/video) - [Images](/docs/guides/image) covers generation, editing, reference images, and sizes. [Image provider formats](/docs/sdks/image) - [Audio](/docs/audio) covers speech, music, audio processing, and transcription. [Audio provider formats](/docs/sdks/audio) ## How it works 1. **Pick a model.** Every model has an id (`nano-banana-2-1`, `gemini-omni-flash-12-preview`), a mode (`generate`, `edit`, ...) and an input schema. `GET https://platform-api.invideo.io/v1/catalog` lists them without a key. 2. **Submit a request.** Send the model, mode, and inputs to `POST /v1/request`. The API returns the request `id` immediately. 3. **Read the result.** `GET /v1/request/{id}` until `status` is `succeeded` (or `failed`). `output.files` holds links to the files. You pay only for requests that succeed, at the model's price per unit (an image, a second of video, a thousand characters). See [Pricing](/pricing). ## Base URL ```text https://platform-api.invideo.io/v1 ``` Every call except the catalogue needs an API key: `Authorization: Bearer iv_...`. See [Authentication](/docs/authentication). ## For agents Add `.md` to any docs URL or send `Accept: text/markdown` to get Markdown. [/llms.txt](/llms.txt) lists the pages. [/llms-full.txt](/llms-full.txt) combines them in one file. --- # Quickstart > Make an API key and generate your first image with one curl command. ## 1. Make an account [Sign up](/signup) with your email and enter the code we send. Use your workspace to manage your team, API keys, and usage. New accounts get access after a short review. If the console asks you to request access, tell us your company and what you plan to build. We’ll reply by email. ## 2. Create an API key In the console, open [API keys](/api-keys) and select **Create key**. Copy the key while it’s visible. You can only view it once. It looks like this: ```text iv_2bXk9QeJt0aLm3VfR8sP1c_Tz7... ``` Keep it on your server, never in a browser or an app. Put it in an environment variable: ```bash export INVIDEO_API_KEY="iv_..." ``` ## 3. Run a model Submit a request. The API answers at once with the request's id: ```bash curl -X POST https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana-2-1", "mode": "generate", "input": { "prompt": "a red fox in fresh snow, golden hour" } }' ``` ```json { "id": "0f8b6c1e-...", "status": "queued" } ``` ## 4. Read the result Set `REQUEST_ID` to the `id` returned above. Read the request until its `status` is `succeeded` or `failed`. An image takes seconds, a video can take minutes: ```bash curl "https://platform-api.invideo.io/v1/request/${REQUEST_ID:?Set REQUEST_ID to the id from the submit response}" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ```json { "id": "0f8b6c1e-...", "model": "nano-banana-2-1", "mode": "generate", "status": "succeeded", "output": { "kind": "image", "files": [{ "url": "https://...", "content_type": "image/png", "width": 1024, "height": 1024 }] }, "error": null, "cost_usd": "0.07" } ``` Each file `url` works for one hour; read the request again for a fresh link. ## The same in Python and JavaScript ```python import os, time, requests BASE = "https://platform-api.invideo.io/v1" HEADERS = {"Authorization": f"Bearer {os.environ['INVIDEO_API_KEY']}"} submit = requests.post(f"{BASE}/request", headers=HEADERS, json={ "model": "nano-banana-2-1", "mode": "generate", "input": {"prompt": "a red fox in fresh snow, golden hour"}, }) submit.raise_for_status() job = submit.json() while True: status = requests.get(f"{BASE}/request/{job['id']}", headers=HEADERS) status.raise_for_status() request = status.json() if request["status"] in ("succeeded", "failed"): break time.sleep(2) print(request["output"] or request["error"]) ``` ```ts const BASE = "https://platform-api.invideo.io/v1"; const headers = { Authorization: `Bearer ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json" }; const submit = await fetch(`${BASE}/request`, { method: "POST", headers, body: JSON.stringify({ model: "nano-banana-2-1", mode: "generate", input: { prompt: "a red fox in fresh snow, golden hour" } }), }); if (!submit.ok) throw new Error(await submit.text()); const job = await submit.json(); let request; do { await new Promise((done) => setTimeout(done, 2000)); const status = await fetch(`${BASE}/request/${job.id}`, { headers }); if (!status.ok) throw new Error(await status.text()); request = await status.json(); } while (!["succeeded", "failed"].includes(request.status)); console.log(request.output ?? request.error); ``` ## Next - Find a model and its inputs on [Models](/models), or with `GET /v1/catalog`. - Send images, video or audio as input: [Files](/docs/files). - Handle errors and retries: [Errors](/docs/errors) and [Requests](/docs/requests). --- # For AI agents > How an AI agent signs up, creates a key, and calls invideo Platform. Use these docs and discovery endpoints to connect an AI agent to invideo Platform. ## Read the docs as markdown - [/llms.txt](/llms.txt): every page of the docs and every model, as links to markdown. - [/llms-full.txt](/llms-full.txt): all docs and all model pages in one file. - [OpenAPI](https://platform-api.invideo.io/v1/openapi.json) describes the API endpoints and their request and response schemas. - Any page as markdown: add `.md` to its URL (`/docs/quickstart.md`, `/models/nano-banana-2-1.md`), or send `Accept: text/markdown`. ## Find models without a key ```bash curl https://platform-api.invideo.io/v1/catalog curl https://platform-api.invideo.io/v1/catalog/nano-banana-2-1 ``` The list has each model's `id`, `name`, maker (`provider`), `modality`, `modes` and list `prices`. One model adds `input_schema` (a JSON Schema of `input`, per mode) and `output`. See [Catalogue](/docs/catalog). ## Get an API key A key belongs to a workspace, and a person makes it: 1. Sign up at [platform.invideo.io/signup](/signup) with an email address. A code is sent to the email; entering it signs in. An agent with access to the inbox can do this itself. 2. If the console shows **Request access**, send the company name and the use case. Access is given by email. 3. Open [platform.invideo.io/api-keys](/api-keys), select **Create key**, and copy the key. It starts with `iv_` and is shown once. Store the key as `INVIDEO_API_KEY` in the environment, never in code or a repository. A leaked key must be deleted in the console at once (see [Security](/docs/security)). ## Call a model ```bash curl -X POST https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: my-task-42" \ -d '{"model": "nano-banana-2-1", "mode": "generate", "input": {"prompt": "a lighthouse at dusk"}}' ``` Then `GET /v1/request/{id}` every 2 to 5 seconds until `status` is `succeeded` or `failed`. Files are in `output.files[].url` (valid for one hour). ## Rules that save retries - Send only the keys of the model's `input_schema`: an unknown key is refused with `422 invalid_input`, and `detail[].loc` names the field. - Always send an `Idempotency-Key` on a submit you may retry: the same key never runs twice. - On `429`, wait the `Retry-After` seconds. On `5xx`, retry with the same `Idempotency-Key`. - A `failed` request costs nothing. `error.retryable` says if the same input can succeed later. - Files as input: an `https` URL or a `data:` URI (see [Files](/docs/files)). ## Every endpoint See the [API reference](/docs/api-reference). --- # API reference > Requests and responses for the invideo Platform API. Base URL: `https://platform-api.invideo.io/v1`. Bodies are JSON. Every endpoint but the catalogue needs `Authorization: Bearer ` ([Authentication](/docs/authentication)). | Method | Path | What it does | | --- | --- | --- | | `GET` | `/catalog` | Every public model with its list prices. No key. | | `GET` | `/catalog/{model}` | One public model with its input schema. No key. | | `GET` | `/models` | The models your workspace may call, with your prices. | | `GET` | `/models/{model}` | One model: input schema, output shape and your prices. | | `POST` | `/request` | Starts a run. Answers at once with its `id`. | | `GET` | `/request/{id}` | A run: status, output files, error, cost. | | `GET` | `/request/{id}/logs/request` | What was sent to the model, as JSON. | | `GET` | `/request/{id}/logs/response` | What the model answered, as JSON. | ## POST /request ```json { "model": "veo-3", "mode": "generate", "input": { "prompt": "a paper boat on a rainy street", "duration": 5 } } ``` | Field | Type | Required | Description | | --- | --- | --- | --- | | `model` | string | yes | The model id, from `/catalog` or `/models`. | | `mode` | string | yes | One of the model's `modes`. | | `input` | object | yes | The model's inputs, as its `input_schema` says. | Headers: `Idempotency-Key` (optional, 1 to 255 characters): a retry with the same key answers with the first request and never starts a second run. Answer `200`: ```json { "id": "0f8b6c1e-...", "status": "queued" } ``` ## GET /request/{id} ```json { "id": "0f8b6c1e-...", "model": "veo-3", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://...", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5.0 } ] }, "error": null, "cost_usd": "0.50" } ``` `status`: `preparing`, `queued`, `running`, then `succeeded` or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until the run succeeds. File links are signed again on every read and work for one hour. A failed run still answers `200`; `error` is `{type, code, message, retryable}` with `type` one of `content`, `model`, `input`, `server`. See [Requests](/docs/requests). ## GET /models and /catalog ```json { "models": [ { "id": "nano-banana-2-1", "name": "Nano Banana 2.1", "provider": "Black Forest Labs", "modality": "image", "modes": ["generate"], "units": ["image"], "prices": [{ "mode": "generate", "unit": "image", "conditions": {}, "usd": "0.07", "price_kind": null, "typical_usd": null }] } ] } ``` Each model also has `price_summary`, its resolution and duration bounds and `tiers` with the billed unit and price for each combination of mode and conditions. Use `tiers` for exact unit rates. The legacy `min_usd` and `max_usd` fields summarize estimated totals across those bounds. With your key these are your workspace's prices, the ones you are charged. `provider` is the company that made the model. A price with `conditions` applies to those input values only (for example `{"resolution": "1080p"}`). `price_kind: "dynamic"` means the customer rate depends on the run. `typical_usd` is the typical customer rate per unit. `GET /models/{model}` and `GET /catalog/{model}` add `input_schema` (a JSON Schema of `input`, per mode), `inputs` (the same as a list of fields with labels and limits) and `output` (the shape of `output.files`). ## Logs `GET /request/{id}/logs/request` and `/logs/response` answer the stored request and response as JSON, with files as fresh one-hour links. A key reads only its own workspace's requests. Logs are kept 90 days; older ones answer `410 log_expired`. ## Errors See [Errors](/docs/errors) for every code. --- # Authentication > Send your API key as a Bearer token. Keys belong to a workspace. Every call needs an API key in the `Authorization` header (the catalogue does not): ```bash curl https://platform-api.invideo.io/v1/models \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ## Keys - Each API key belongs to a **workspace**. Every key of a workspace shares its models, its limits and its spend. - Make and delete keys in the console, under [API keys](/api-keys). You can view a key only when you create it. - A key starts with `iv_` and has 75 characters: `iv_` + 22 characters + `_` + 49 characters. - Delete a key and it stops at once. Make a new key before you delete the old one to rotate without downtime. ## Keep keys secret - Call the API from your server. Never put a key in a browser, a mobile app or a public repository. - Use one key per app or environment, so you can turn one off without stopping the others. - If a key leaks, delete it in the console at once. See [Security](/docs/security). ## Errors A missing, invalid, disabled or expired key returns `401`: ```json { "error": "unauthorized", "message": "..." } ``` --- # Requests > Request states, polling, safe retries, and failures. A model run can take seconds or minutes. Submit a **request** and poll for its result. ## Statuses | Status | Meaning | | --- | --- | | `preparing` | Input files are being fetched and checked. | | `queued` | Waiting for the model. | | `running` | The model is working. | | `succeeded` | `output.files` contains the result and `cost_usd` contains the charge. | | `failed` | See `error` for the cause. Nothing is charged. A request that did not start within 15 minutes fails with `queue_timeout`. | Media requests cannot be cancelled once submitted. Use `POST /v1/responses/{id}/cancel` to cancel a background chat response. [Recover or cancel a chat response](/docs/chat/responses#resume-a-responses-stream) ## Polling Read `GET /v1/request/{id}` every 2 to 5 seconds until the status is `succeeded` or `failed`. Reads have their own, high limit (see [Limits](/docs/limits)), so polling never blocks your submits. For chat, a succeeded request exposes the stored answer in `output.message.content` when retention allows it. The OpenAI-compatible retrieval routes are `GET /v1/chat/completions/{id}` and `GET /v1/responses/{id}`. Use the same workspace and service account that started the request. ## Retries without double runs Send an `Idempotency-Key` header on every submit you may retry (a network error, a timeout, a `5xx`): ```bash curl -X POST https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: order-1234-thumbnail" \ -d '{"model": "nano-banana-2-1", "mode": "generate", "input": {"prompt": "a cup of coffee"}}' ``` The same key (1 to 255 characters, per workspace) never starts a second run: it answers with the first request. ## Failures A failed run answers `200` with `status: "failed"` and an `error`: ```json { "status": "failed", "error": { "type": "content", "code": "...", "message": "...", "retryable": false } } ``` | `type` | Meaning | | --- | --- | | `content` | The model refused the prompt or the input. Change it. | | `input` | An input file or value did not work for this model. | | `model` | The model failed. `retryable: true` means try again later. | | `server` | Our side failed. Try again. | ## Output files `output.files[]` has `url`, `content_type`, `size_bytes`, and `width`, `height`, `duration` when they apply. A `url` works for one hour and is signed again on every read: download the file, or read the request again for a new link. --- # Files > Send images, video and audio as input, as an https URL or a data URI. Use one file for a `file` input or a list for a `files` input. Send each file as one of these strings: - an `https` URL the API can download, or - a `data:` URI with the file inside (`data:image/png;base64,iVBORw0...`). ```json { "model": "", "mode": "edit", "input": { "prompt": "make it night", "image": "https://example.com/street.jpg" } } ``` ## Sizes - A request body can be up to 64 MB, data URIs included (`413` above that). - Send larger files as an `https` URL. Video can be up to 300 MB. - Each model says what it takes in its input schema: containers (`png`, `mp4`, ...), the largest file, the smallest and largest side in pixels, the width to height ratio and the length in seconds. A file outside them answers `422 invalid_input`. ## Output files Files the model makes are links in `output.files[].url`, valid for one hour. See [Requests](/docs/requests). --- # Errors > API error codes, their causes, and how to respond. When the API rejects a call, it returns an HTTP error with a JSON body. Most use `{error, message}`. The `invalid_input` error uses `{error, detail}`. | HTTP | `error` | When | What to do | | --- | --- | --- | --- | | 400 | | The body is not valid JSON. | Fix the body. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | Check `Authorization: Bearer iv_...`. | | 404 | `model_not_found` | No such model or mode, or it is off for this workspace. | Check `GET /v1/models`. | | 404 | `not_found` | No request with this id in this workspace. | Check the id. | | 410 | `log_expired` | The request's logs are older than 90 days. | | | 413 | | The body is over 64 MB. | Send large files as an `https` URL. | | 422 | `invalid_input` | The input does not fit the model's schema. | Read `detail`. | | 422 | `model_not_priced` | These options have no price yet. | Pick other options. | | 429 | `rate_limited` | Over the workspace's requests per minute. | Wait `Retry-After` seconds. | | 402 | `insufficient_balance` | The balance is $0 or less, or less is available than this request's estimated cost. | [Add funds](/docs/billing), then retry. | | 429 | `spend_limit_exceeded` | A spend limit (daily or monthly; for the workspace, a model or a key) has been reached. | Wait until `resets_at`, or raise the limit in the console. | | 500 | `server_error` | Something went wrong on our end. Please try again. | Retry with the same `Idempotency-Key`. | ## invalid_input ```json { "error": "invalid_input", "detail": [{ "loc": ["body", "input", "duration"], "msg": "must be one of 5, 10", "type": "enum" }] } ``` `loc` is the path to the field; its last item is the field's name. ## A failed run is not an error A request that was accepted and then failed answers `200` with `status: "failed"` and an `error` object. See [Requests](/docs/requests#failures). ## Chat completions errors `POST /v1/chat/completions` and `POST /v1/responses` answer errors in the OpenAI shape, so OpenAI SDKs read them. The Anthropic and Gemini doors answer in their own shapes with the same codes and HTTP statuses: see [Formats and model IDs](/docs/chat/formats#errors). ```json { "error": { "type": "invalid_request_error", "code": "context_length_exceeded", "message": "...", "param": "messages" } } ``` | HTTP | `code` | When | | --- | --- | --- | | 400 | `invalid_request` | The body does not fit the chat completions shape. | | 400 | `context_length_exceeded` | The messages are longer than the model's context window. | | 400 | `max_tokens_too_low` | The answer reached `max_tokens` before it could finish. Charged for the tokens used. | | 400 | `content_filtered` | The model refused the prompt or stopped its answer. Charged for the tokens used. | | 400 | `model_not_chat` | The model is not a language model: use `POST /v1/request`. | | 404 | `model_not_found` | No such model, or it is off for this workspace. | | 422 | `model_not_priced` | The model has no price yet. | | 429 | `spend_limit_exceeded` | The workspace's spend limit is used up. | | 429 | `rate_limited` | Over the workspace's requests per minute. Wait `Retry-After` seconds. | | 429 | `upstream_rate_limited` | The model is busy. Retry after a short wait. | | 500 | `internal_error` | Something went wrong on our end. Please try again. | | 502 | `upstream_error` | The model failed. Retry. | | 504 | `upstream_timeout` | The model took too long. Retry, or ask for a shorter answer. | ### What a failed chat call costs - A call that fails because of its own settings (`max_tokens_too_low`, `content_filtered`) is charged for the tokens the model used: the error has `charged_usd` and says so, e.g. "Charged $0.0000858 for 30 tokens used before max_tokens was reached." - A failure on our side or the model provider's side (`internal_error`, `upstream_*`, `rate_limited`) costs nothing. - A caller who closes a stream early: the model finishes the answer in the background and the call is charged its real tokens. --- # Limits > Requests per minute and spend limits of a workspace, and what happens at a limit. Limits belong to the **workspace**: all its keys and the console's playground count together. A key can also belong to a [service account](/docs/service-accounts), which adds limits of its own on top. ## Requests per minute | What | Default | At the limit | | --- | --- | --- | | Submits (`POST /v1/request`) | 300 a minute, for all models | `429 rate_limited` | | Submits of one model | as the workspace sets | `429 rate_limited` | | Reads (every `GET`) | a per-minute limit for each workspace, shown on your Limits page | `429 rate_limited` | | Catalogue (`/v1/catalog`, no key) | 120 a minute per IP address | `429 rate_limited` | Every `429` has a `Retry-After` header in seconds. Reads have their own counter, so polling never blocks your submits. ## Spend limits Your [balance](/docs/billing) decides *if* there is money; a spend limit decides *how fast* it may go. Owners, admins and Billing members set them in the console under [Limits](/manage/limits): - per **UTC day** (00:00 to 24:00) or per **calendar month** (from the 1st, 00:00 UTC); - for **all models** or for **one model**, of the whole workspace or of one [service account](/docs/service-accounts), so one app can be capped without stopping the others; - with emails to owners and Billing members when spend reaches the percentages you choose (or the default levels), once per period. A request must fit every limit that matches it: what was spent this period, plus what running requests have set aside, plus its own estimate. Over a limit, it answers `429 spend_limit_exceeded` and nothing is charged: ```json { "error": "spend_limit_exceeded", "message": "This service account's monthly spend limit of $50 is used up. It resets at 2026-12-01T00:00:00Z; raise it in the console (Limits) to run sooner.", "limit_usd": "50", "spent_usd": "49.80", "scope": "service_account", "period": "month", "resets_at": "2026-12-01T00:00:00Z" } ``` `scope` is `workspace`, `model` or `service_account`. invideo may set a limit too; yours can only be lower. `GET /v1/balance` lists every limit that applies to the key with this period's spend: the workspace's, and its service account's for a key that has one. ## Higher limits Need more? Ask from the console; we raise the limits of a workspace. --- # Billing and balance > Add funds, check your prepaid balance, and see how requests are billed. invideo Platform is **prepaid**: you add funds in advance and pay only for what you use. There is no subscription. Each **workspace** has a single balance in US dollars, shared by all of its API keys and the console's playground. Funds you add **never expire**. ## How a request is paid 1. When a request arrives, we set aside its estimated cost from your balance. 2. If your balance is $0 or less, or the available amount is less than that estimate, the request is declined with `402 insufficient_balance` and you are not charged. 3. When the request finishes, you are charged its exact price and any unused amount is released. Failed requests are free. A request priced by its actual cost can end slightly above its estimate, so your balance can dip a little below $0. Your next top-up covers that amount first. ## Adding funds Owners, admins and Billing members can add funds by card in the console under [Billing](/billing). The minimum and maximum amounts are shown when you add funds. Tax is added at checkout where applicable, and your balance receives the full dollar amount. Cards issued in India are charged in rupees at the day's exchange rate. **Auto top-up** charges your saved card a set amount whenever your balance falls below a threshold you choose, up to a monthly limit you set. We email you a receipt for every charge. If a charge fails, auto top-up pauses until you add funds manually. For larger amounts, or to pay by invoice with payment terms, contact us. ## Check the balance: GET /v1/balance ```bash curl https://platform-api.invideo.io/v1/balance -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ```json { "balance_usd": "42.10", "available_usd": "39.85", "held_usd": "2.25", "budgets": [ { "scope": "workspace", "period": "month", "limit_usd": "100", "spent_usd": "57.9", "resets_at": "2026-12-01T00:00:00Z" } ] } ``` - `balance_usd`: everything you have added, minus everything you have been charged. - `available_usd`: your balance minus the amount set aside for running requests. A new request must fit within this amount. - `held_usd`: the amount set aside for requests that are still running. - `budgets`: each [spend limit](/docs/limits#spend-limits) that applies, with the amount spent in the current period. All amounts are exact decimal strings. ## 402 insufficient_balance ```json { "error": "insufficient_balance", "message": "Your balance is too low for this request. Add funds at https://platform.invideo.io/billing.", "balance_usd": "3.10", "available_usd": "1.25", "needed_usd": "2.40" } ``` `needed_usd` is the amount this request needs to set aside. The LLM endpoints return the same `insufficient_balance` code with status 402, in their own error format (Anthropic, OpenAI or Gemini). Add funds, or wait for running requests to finish, then retry with the same `Idempotency-Key`. ## Refunds A refund, or a card dispute you lose, deducts that amount from your balance. If you win a dispute, the amount is credited back. --- # Catalogue > List public models and their input schemas without an API key. The catalog lists public models. You can query it without an API key. ```bash curl https://platform-api.invideo.io/v1/catalog curl https://platform-api.invideo.io/v1/catalog/nano-banana-2-1 ``` ## Endpoints - `GET /v1/catalog`: every model that is on for all workspaces, with `id`, `name`, `provider` (the maker), `modality`, `modes`, `units`, list `prices` and `price_summary` (resolution and duration bounds, with the individual unit rates in `tiers`). - `GET /v1/catalog/{model}`: the same, plus `input_schema` (JSON Schema per mode), `inputs` (fields with labels and limits) and `output`. ## List prices and your prices Prices here are list prices. Your workspace's prices, after any discount, and the models only your workspace has, are at `GET /v1/models` with your key. The answer may be up to 5 minutes old; a run is always charged at the live price. The catalogue allows 120 calls a minute per IP address. --- # Provider keys (BYOK) > Run models on your own provider accounts, what invideo charges, what happens when your key fails, and how a request asks for it. A workspace can add its own API keys for the providers behind our models. A request for a model of such a provider then runs on **your account at that provider**. Your provider bills you for the run, and invideo charges only a small fee instead of the model's price. [Provider keys (BYOK)](/manage/provider-keys) is available per workspace. Contact invideo to request access. ## Add a key Owners and admins can add keys under [Provider keys (BYOK)](/manage/provider-keys). invideo encrypts the key and the console shows its last four characters. Before saving a key, the console sends one small request to the provider. If the test passes, the key is **Active**. If it fails, the console shows why and what to do next. Choose **Save anyway** to keep the key marked **Not accepted** until it passes a test. To retry, choose **Test key** in the key’s menu. Turn a key off to go back to invideo's key and the normal prices; delete it to erase it. A change reaches every request within about a minute. | Provider | The key | | --- | --- | | fal, OpenAI, Anthropic, xAI, ElevenLabs, MiniMax, Kling, BytePlus, Ideogram, Alibaba Cloud, PixVerse, Luma, Runway, Black Forest Labs, Cartesia, OpenRouter | An API key | | Google Vertex | A service account key (JSON) for a project where Vertex AI is on. Gemini chat and the Google media models run in that project. | | Amazon Bedrock | No key: an IAM role in your AWS account that trusts invideo for the external id the console shows, and its ARN | `GET /v1/models` names the provider a model needs (`byok_provider`) and whether your workspace has a working key for it (`byok_active`). Your provider's own terms, limits and data retention apply to runs on your key. ## What invideo charges A request on your key costs invideo's fee, never the list price. Unless invideo set another fee for your workspace, it is **5% of the model's list price**, worked out exactly like the price you would have paid. A request that fails is free. Your Spend page and the request's `cost_usd` show the fee only. ## Which requests use your key By default every request for a model of a provider you have a working key for. In the console you can change this to *only requests that ask for it*, for the whole workspace, one provider or one model. One request can always decide for itself: - the JSON body of a media request takes `"byok": true` (or `false`); - every call, chat included, takes the header `X-Invideo-Byok: 1` (or `0`). A request that asks for your key and cannot have it fails with `422 byok_no_key`. The answer to a media request has the header `X-Invideo-Byok: true` when it runs on your key, and `GET /v1/request/{id}` has `"byok": true`. ## When your key fails These BYOK errors identify a problem with your key or provider account. | Code | Meaning | | --- | --- | | `byok_credential_rejected` | The provider did not accept your key. Three refusals in a row turn the key to Not accepted. | | `byok_provider_forbidden` | Your provider account knows the key but refused this request, usually because it has no access to the model. The key is not turned off for this. | | `byok_provider_quota` | Your provider account has no credit or quota left. | | `byok_provider_rate_limited` | Your provider account hit its rate limit. Retry in a moment. | | `byok_credential_unavailable` | The key could not be loaded. Check it in the console. | Set the key failure policy under **If your key fails** in the console. You can set it for the workspace, a provider, a model, or a single request with `X-Invideo-Byok-Fallback: invideo`. --- # Formats and model IDs > Call chat models in the Anthropic, OpenAI (Chat and Responses) or Gemini format with that provider's own SDK. Change only the base URL and the API key. # Formats and model IDs Keep your SDK and request format. Set the **base URL** to Platform and use your Platform **API key**. | Format | Endpoint | SDK | Base URL in the SDK | | --- | --- | --- | --- | | [Anthropic Messages](/docs/chat/anthropic) | `POST /v1/messages` | Anthropic SDK | `https://platform-api.invideo.io` | | [OpenAI Chat](/docs/chat/completions) | `POST /v1/chat/completions` | OpenAI SDK | `https://platform-api.invideo.io/v1` | | [OpenAI Responses](/docs/chat/responses) | `POST /v1/responses` | OpenAI SDK | `https://platform-api.invideo.io/v1` | | [Gemini](/docs/chat/gemini) | `POST /v1beta/models/{model}:generateContent` and `:streamGenerateContent?alt=sse` | Google GenAI SDK | `https://platform-api.invideo.io` | Every chat format on this page accepts any chat model enabled for your key. Use the canonical Platform model ID when sending a model through another provider’s format. | Provider | Path | Settled USD field | | --- | --- | --- | | xAI | `POST /xai/v1/chat/completions` | `usage.cost` | | DeepSeek | `POST /deepseek/v1/chat/completions` | `usage.cost` | | Moonshot AI | `POST /moonshot/v1/chat/completions` | `usage.cost` | | Z.ai | `POST /z-ai/api/paas/v4/chat/completions` | `usage.cost` | | OpenRouter | `POST /openrouter/api/v1/chat/completions` | `usage.cost` | | BytePlus | `POST /byteplus/api/v3/chat/completions` | `usage.cost` | | Perplexity | `POST /perplexity/chat/completions` | `usage.cost` | | MiniMax | `POST /minimax/anthropic/v1/messages` | `usage.cost_usd` | Use your Platform key as a Bearer token. MiniMax also accepts `x-api-key` for the Anthropic SDK. The OpenAI formats include `usage.cost`, Anthropic Messages includes `usage.cost_usd`, and Gemini includes `usageMetadata.cost_usd`. The exact amount is also in `x-invideo-cost-usd` on a completed JSON response. Live streams report it in their final usage event. ## Passthrough or translated - **Passthrough**: If you use the model’s native format, Platform sends the request unchanged. The response and stream events keep their original format. Supported fields include Anthropic `cache_control` breakpoints, `thinking`, system blocks, and PDF documents. Platform also keeps Responses API reasoning items and Gemini parts. - **Translated**: Platform converts the request when you use a different format. Text, images, tools and the system prompt carry over. Anthropic `cache_control` and `thinking` are dropped. Use Anthropic `document` blocks with models in the Anthropic format and Responses `input_file` with models in the OpenAI format. Other formats return HTTP 400 `unsupported_parameter` for PDFs. In `GET /v1/models/{id}`, `chat.native_format` names the model's own format, `chat.also_speaks` lists other formats, and `chat.features` lists capabilities (`tools`, `vision`, `pdf`, `prompt_cache`, `thinking`, `json`, `responses_api`). Logs show each request’s format and whether Platform sent it unchanged. ## The same call in each format ```python # Anthropic SDK import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-carbon", max_tokens=1024, messages=[{"role": "user", "content": "Name a video app for cooks."}], ) print(answer.content[0].text) ``` ```python # OpenAI SDK (Chat Completions or Responses) from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create(model="gemini-4-carbon", input="Name a video app for cooks.") print(answer.output_text) ``` ```python # Google GenAI SDK from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content(model="gemini-4-carbon", contents="Name a video app for cooks.") print(answer.text) ``` ## Model IDs and aliases Use the Platform model ID from `GET /v1/models` (for example `gemini-4-carbon`). When Platform recognises a provider ID as an alias for an enabled model, you can use that ID instead. - The answer's `model` is the id you sent. - An id we do not know gets the door's "not found" error (HTTP 404). ## Your key on each door Send your Platform key the way that door's SDK sends it: | Door | Header | | --- | --- | | Anthropic | `x-api-key: ` (or `Authorization: Bearer `) | | OpenAI | `Authorization: Bearer ` | | Gemini | `x-goog-api-key: ` (or `Authorization: Bearer `). A key in the URL (`?key=`) is refused (401): URLs end up in logs. | ## List models in each shape - `GET /v1/models`: the OpenAI shape. With an `anthropic-version` header (the Anthropic SDK's `client.models.list()`), the Anthropic shape: `{"data": [{"type": "model", "id", "display_name", "created_at"}], "has_more", "first_id", "last_id"}`. - `GET /v1beta/models`: the Gemini shape: `{"models": [{"name": "models/", "displayName", "inputTokenLimit", "outputTokenLimit", "supportedGenerationMethods"}]}`. ## What we do not run Some provider features keep data or run paid tools under the provider account, so the doors refuse them with HTTP 400 and the code `unsupported_parameter` (in that door's error shape): - **Stored state**: Anthropic Files (`source.type: "file"`), `container`, `mcp_servers`; OpenAI `file_id`, `previous_response_id` and `conversation`; Gemini `cachedContent`, and `fileData` with `gs://` or File API links. Send the content inline instead (base64 or an https link). - **Server-side tools**: Anthropic `web_search`, `web_fetch`, `code_execution`, `tool_search`, `memory`, `mcp_toolset` (the client tools `computer`, `bash` and `text_editor` work: your code runs them); OpenAI `web_search`, `file_search`, `code_interpreter`, `image_generation`, `mcp`, `computer_use`; Gemini `googleSearch`, `codeExecution`, `urlContext`. Your own function tools work on every door. - **Audio and video input** for any model but Gemini: HTTP 400 `unsupported_parameter`, "This model does not take audio or video input." (See below for Gemini.) - **Audio output** and more than one answer per call (`n` over 1). Platform does not ask OpenAI to store your response. On Platform, send `store: false` to opt out of [stored answer retrieval](/docs/chat/responses#recover-a-chat-answer); background mode and resume require retention. Platform drops `service_tier` and OpenAI `metadata`. Anthropic’s `metadata.user_id` remains the user tag in Logs. Endpoints we do not run (Files, Batches, Admin, `count_tokens`, embeddings) answer with the door's 404 error. An image or PDF given as an `https` link is fetched by us (public addresses only; 20 MB a file, 50 MB in all) and sent to the model inline. ## Audio and video input (Gemini models) Gemini models take audio and video: on the Gemini door as `inlineData` (or an `https` `fileData`), and on the OpenAI Chat and Responses doors as `input_audio` (`{"data": "", "format": "mp3"}`) or a `file` part with a `data:audio/...` or `data:video/...;base64,` URL. Inline files up to 20 MB in all. **Price.** Audio tokens (a video's sound included) cost the model's audio price, `audio_input_per_m` in `GET /v1/models` (per 1M audio tokens); about 25 tokens per second of audio. A video's frames cost the model's input price. Every other model refuses audio and video: HTTP 400 `unsupported_parameter`, "This model does not take audio or video input." ## Errors Each door answers errors in its provider's shape, so the SDKs raise their usual exceptions. Our own error code is always in an extra field. ```json // Anthropic door {"type": "error", "error": {"type": "not_found_error", "message": "...", "code": "model_not_found"}, "request_id": "..."} // OpenAI doors {"error": {"message": "...", "type": "invalid_request_error", "param": "model", "code": "model_not_found"}} // Gemini door {"error": {"code": 404, "message": "...", "status": "NOT_FOUND", "code_name": "model_not_found"}} ``` The HTTP status of a code is the same on every door: 401 bad key, 403 model not on for your workspace, 404 unknown model, 413 too large, 429 spend or rate limit, 400 invalid request (and `max_tokens_too_low`, which is charged), 502 or 503 the provider failed (free). All codes: [Errors](/docs/errors). ## Usage and cost **Max length.** Set a max length (`max_tokens` / `max_completion_tokens` / `max_output_tokens` / `maxOutputTokens`). Without it we hold the model's full maximum; if your spend limit can't cover that, we lower the max to what it can. Each door gives usage in its own shape, with `cost_usd` (what the call was charged) added. Cache reads, cache writes and thinking tokens are counted and charged. | Door | Where | | --- | --- | | Anthropic | `usage` (`input_tokens`, `output_tokens`, `cache_creation_input_tokens`, `cache_read_input_tokens`, `cost_usd`); when streaming, on the last `message_delta` | | OpenAI Chat | `usage` and `cost_usd`; when streaming, on the last chunk | | OpenAI Responses | `usage` (`input_tokens`, `input_tokens_details.cached_tokens`, `output_tokens`, `output_tokens_details.reasoning_tokens`, `total_tokens`, `cost_usd`); when streaming, in `response.completed` | | Gemini | `usageMetadata` (`promptTokenCount`, `candidatesTokenCount`, `cachedContentTokenCount`, `thoughtsTokenCount`, `totalTokenCount`, `cost_usd`); when streaming, on the last chunk | Every answer has the header `x-request-id`: the request's id in Logs. The answer's own id (Anthropic message id, Responses id, Chat id) is the same id. --- # Chat completions > Call any language model in the catalogue with one OpenAI-compatible endpoint and a Platform API key. # Chat completions `POST /v1/chat/completions` runs one turn of a chat model. The request and the answer have the same shape as OpenAI's Chat Completions API, so the OpenAI SDKs work as they are: set the base URL to `https://platform-api.invideo.io/v1` and use your Platform API key. **OpenAI Chat** accepts every chat model. Platform sends requests unchanged to models that use this format and translates them for other models. To use Anthropic cache breakpoints and thinking or Gemini parts, choose the provider’s format in [Formats and model IDs](/docs/chat/formats). Every call is one request in **Logs**, with its messages, its answer, its tokens and what it cost. ## Find a model List the chat models your workspace can call: ```bash curl https://platform-api.invideo.io/v1/models?modality=text \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` Each model has its `id`, `provider`, a `chat` object (`context_window`, `capabilities`, `token_prices`) and `endpoint: "/v1/chat/completions"`. A model must be on for your workspace; staff and owners turn models on in the console (**Manage → Models**). ## Send a request ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ {"role": "system", "content": "You write short product names."}, {"role": "user", "content": "Name a video app for cooks."} ], "max_tokens": 200 }' ``` ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[{"role": "user", "content": "Name a video app for cooks."}], ) print(answer.choices[0].message.content) ``` ```ts import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://platform-api.invideo.io/v1", apiKey: process.env.INVIDEO_API_KEY }); const answer = await client.chat.completions.create({ model: "gemini-4-carbon", messages: [{ role: "user", content: "Name a video app for cooks." }], }); console.log(answer.choices[0].message.content); ``` ## Request body | Field | Type | Notes | | --- | --- | --- | | `model` | string | A chat model id from `GET /v1/models?modality=text`, or one of its `aliases` (the provider's own id). Required. | | `messages` | array | The conversation. Roles: `system` (or `developer`), `user`, `assistant`, `tool`. Required. | | `max_tokens` / `max_completion_tokens` | integer | The most tokens of the answer. Without it, the model's maximum (see Max length below). Models in the OpenAI format go through unchanged. OpenAI's newer models refuse `max_tokens`: send `max_completion_tokens` to them. | | `temperature` | number | 0 to 2. Default 1. | | `top_p` | number | Nucleus sampling, where the model has it. | | `stop` | string or array | Stop sequences, where the model has them. | | `stream` | boolean | Send the answer as it is written. See [Streaming](/docs/chat/streaming). | | `tools`, `tool_choice` | array, string or object | Function calling. See [Tools](/docs/chat/tools). | | `response_format` | object | `json_object` or `json_schema`. See [Structured output](/docs/chat/structured-output). | | `reasoning_effort` | string | `none`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`, for models that reason. | With no `system` message, the model gets the system prompt `You are a helpful assistant.` (a few input tokens). **Max length.** Set a max length (`max_tokens` / `max_completion_tokens` / `max_output_tokens` / `maxOutputTokens`). Without it we hold the model's full maximum; if your spend limit can't cover that, we lower the max to what it can. A `user` message's `content` is a string or a list of parts: `{"type": "text", "text": "..."}` and, for models with `vision`, `{"type": "image_url", "image_url": {"url": "https://..."}}` (an https link, or a `data:image/png;base64,...` URL; PNG, JPEG, GIF or WebP; 20 MB an image, 50 MB in all). An https link must be public; it is fetched once, before the call. ## Answer ```json { "id": "0193b0c4-7640-72d1-91e7-e11f44de3708", "object": "chat.completion", "created": 1795680000, "model": "gemini-4-carbon", "choices": [ {"index": 0, "message": {"role": "assistant", "content": "SimmerCut"}, "finish_reason": "stop"} ], "usage": { "prompt_tokens": 31, "completion_tokens": 6, "total_tokens": 37, "prompt_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0}, "completion_tokens_details": {"reasoning_tokens": 0}, "cost": "0.000271", "cost_usd": "0.000271", "invideo_cost": { "lines": [ {"item": "request", "quantity": "1", "unit_price_usd": "0.000271", "amount_usd": "0.000271"} ], "total_usd": "0.000271" } }, "cost_usd": "0.000271" } ``` - For JSON responses, the body’s `id` is the Platform request ID and matches the `x-request-id` header. Look up that ID in Logs or call `GET /v1/request/{id}`. - `model` is the id you sent (ours or an alias). - `finish_reason`: `stop` (finished normally), `length` (it hit `max_tokens`), `tool_calls` (it called a tool) or `content_filter` (blocked). - `message.reasoning_content` is there when the model gave its reasoning. - `cost_usd` is what Platform charged. `usage.invideo_cost` shows the charge lines and total. - With `stream: true`, the same Platform request ID appears in each JSON chunk’s `id`. See [Streaming](/docs/chat/streaming) for the event sequence. ## Pricing A chat model is priced per million tokens of each kind: **input**, **output**, **cached input** (prompt tokens read from the provider's cache) and, for some models, **cache write**. Some models charge more per token when the prompt is over a size (the **long-context** tier). Each call is charged its exact tokens at these prices; reasoning tokens count as output. The prices of each model are in `chat.token_prices` of `GET /v1/models` (your workspace's prices) and in the public catalogue: ```json { "input_per_m": "4.68", "output_per_m": "23.4", "cache_read_per_m": "0.468", "cache_write_per_m": "5.85", "long_context_above": 271630, "long_input_per_m": "9.36", "long_output_per_m": "35.1" } ``` A field is `null` when the model has no such price. Before a call runs, what it can cost is held under your spend limit: its prompt and `max_tokens` at the model's prices (an image counts as 1,500 tokens). A call whose hold is over what is left of the limit is refused with `spend_limit_exceeded`. The charge is the exact amount afterwards. A call that fails is free, unless your request caused it (see Errors below). If you close a stream early, the model finishes the answer in the background and you are charged for it. ## Errors Errors have OpenAI's shape, so the SDKs raise the usual exceptions: ```json {"error": {"type": "invalid_request_error", "code": "model_not_found", "message": "...", "param": "model"}} ``` | HTTP | `code` | What to do | | --- | --- | --- | | 400 | `invalid_request` | Fix the field named in `param`. | | 400 | `max_tokens_too_low` | The model used up `max_tokens` before it answered (reasoning counts). Raise `max_tokens`. | | 400 | `context_length_exceeded` | Send fewer or shorter messages, or a lower `max_tokens`. | | 400 | `content_filtered` | The provider's filter or the model refused. Change the messages. | | 400 | `model_not_chat` | Use `POST /v1/request` for this model. | | 404 | `model_not_found` | Use an id from `GET /v1/models?modality=text`; it must be on for your workspace. | | 422 | `model_not_priced` | Use another model. | | 429 | `spend_limit_exceeded` | Raise the spend limit in the console, or wait for the next month. | | 429 | `rate_limited` | Your requests-per-minute limit. Retry after a short wait. | | 429 | `upstream_rate_limited` | The provider is busy. Retry, or use another model. | | 502 | `upstream_error` | The request failed upstream. Retry the request. | | 504 | `upstream_timeout` | Retry, lower `max_tokens`, or stream. | | 500 | `internal_error` | Retry. Nothing was charged. | A failure your own request caused is charged for the tokens the model used before it stopped: `max_tokens_too_low` (the model used all of `max_tokens`, reasoning included, before it answered) and `content_filtered`. The error then has `charged_usd`, and its message says what was charged and why, for example `Charged $0.0123 for 4,096 tokens used before max_tokens was reached.` The request log shows the charge. Every other failure (ours or the provider's: outages, 5xx, timeouts, rate limits) is free. All codes: [Errors](/docs/errors). Limits: [Limits](/docs/limits). --- # OpenAI Responses > Use the OpenAI SDK's Responses API with Platform: POST /v1/responses, passthrough for models in this format, translated for every other chat model. # OpenAI Responses `POST /v1/responses` takes OpenAI's Responses format, so `client.responses` in the OpenAI SDKs works as it is. Set the base URL to `https://platform-api.invideo.io/v1` and use your Platform API key. - **Native format (passthrough).** Your body goes to OpenAI unchanged (reasoning, `instructions`, `text.format`, function tools, images, `input_file` inline) and the answer and its stream events come back as OpenAI sends them. - **Other models: translated.** `input` text and images, `instructions` and function tools carry over; the answer is built as a Responses object. `input_file` (PDF) works only with models in this format; on others it is refused (HTTP 400 `unsupported_parameter`). Send the whole conversation in `input`. Platform refuses `previous_response_id` and `conversation`. Use `background: true` for a response that continues after you disconnect. Set `store: false` to opt out of stored response retrieval. See [Formats and model IDs](/docs/chat/formats) for model IDs and aliases. **Max length.** Set a max length (`max_tokens` / `max_completion_tokens` / `max_output_tokens` / `maxOutputTokens`). Without it we hold the model's full maximum; if your spend limit can't cover that, we lower the max to what it can. ## Send a request ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-4-carbon", instructions="You write short product names.", input="Name a video app for cooks.", reasoning={"effort": "low"}, ) print(answer.output_text) print(answer.usage) # input, cached, output and reasoning tokens, and cost_usd ``` ```ts import OpenAI from "openai"; const client = new OpenAI({ baseURL: "https://platform-api.invideo.io/v1", apiKey: process.env.INVIDEO_API_KEY }); const answer = await client.responses.create({ model: "gemini-4-carbon", input: "Name a video app for cooks." }); console.log(answer.output_text); ``` ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "gemini-4-carbon", "input": "Name a video app for cooks."}' ``` A conversation goes in `input` as a list: ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-4-carbon", # any chat model input=[ {"role": "user", "content": "Name a video app for cooks."}, {"role": "assistant", "content": "SimmerCut"}, {"role": "user", "content": "Another one, shorter."}, ], ) print(answer.output_text) ``` ## Streaming With `stream=True`, the answer comes as the Responses events (`response.created`, `response.output_text.delta`, ..., `response.completed`). `response.completed` has the usage, with `cost_usd`. ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) stream = client.responses.create(model="gemini-4-carbon", input="Write a haiku about soup.", stream=True) for event in stream: if event.type == "response.output_text.delta": print(event.delta, end="", flush=True) ``` ## Recover a chat answer Keep the Platform request ID from the `x-request-id` header or JSON `id` field. - `GET /v1/chat/completions/{id}` returns the stored Chat Completion. - `GET /v1/responses/{id}` returns the Response and its current status. - `GET /v1/request/{id}` returns the request status and, when available, the answer in `output.message.content`. Use this endpoint for Anthropic, Gemini, and other chat formats. Use the same workspace and service account that submitted the request. Retrieval does not run the model again or charge for another generation. ## Resume a Responses stream Call `POST /v1/responses` with `background: true` and `stream: true`. Keep the Response ID from `response.created` and the `sequence_number` of the last event you processed. Reconnect with `GET /v1/responses/{id}?stream=true&starting_after=N`. Platform sends events after N, then sends new events as they arrive. The stream buffer expires 10 minutes after the final event. After expiry, retrieve the Response without streaming. ```python import os from openai import OpenAI client = OpenAI( api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1", ) with client.responses.create( model="gemini-3-1-flash-lite", input="Explain why ice floats.", background=True, stream=True, ) as stream: event = next(stream) response_id = event.response.id last_sequence = event.sequence_number with client.responses.retrieve( response_id, stream=True, starting_after=last_sequence ) as stream: for event in stream: if event.type == "response.output_text.delta": print(event.delta, end="", flush=True) print(client.responses.retrieve(response_id).output_text) ``` ```sh curl -NsS -X POST https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-3-1-flash-lite","input":"Explain why ice floats.","background":true,"stream":true}' ``` From the events already processed, set `RESPONSE_ID` to the response ID and `LAST_SEQUENCE` to the last `sequence_number` processed. Then run the second command. ```sh curl -NsS "https://platform-api.invideo.io/v1/responses/$RESPONSE_ID?stream=true&starting_after=$LAST_SEQUENCE" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` To start a background Response without opening a stream, send `background: true` and omit `stream`. Poll the Response ID until it reaches a terminal status. To cancel a background Response, call `POST /v1/responses/{id}/cancel` or `client.responses.cancel(response_id)`. Background mode and replay require retention. Platform never saves answers or stream events for zero data retention requests. A request with `store: false` does not have a stored OpenAI-format response. ## Answer ```json { "id": "0193b0c4-...", "object": "response", "status": "completed", "model": "gemini-4-carbon", "output": [{"type": "message", "role": "assistant", "content": [{"type": "output_text", "text": "SimmerCut"}]}], "usage": { "input_tokens": 12, "input_tokens_details": {"cached_tokens": 0}, "output_tokens": 6, "output_tokens_details": {"reasoning_tokens": 0}, "total_tokens": 18, "cost_usd": "0.000021" } } ``` - `id` is the request's id in Logs (also the `x-request-id` header). - `model` is the id you sent. - `status`: `completed`, or `incomplete` with `incomplete_details.reason` (`max_output_tokens`: it hit the limit; `content_filter`: blocked). ## Errors OpenAI's shape, as on [Chat completions](/docs/chat/completions): `{"error": {"message", "type", "param", "code"}}`. Server-side tools (`web_search`, `file_search`, `code_interpreter`, `image_generation`, `mcp`, `computer_use`) and `file_id` inputs are refused with `unsupported_parameter`. All codes: [Errors](/docs/errors). --- # Anthropic Messages > Use the Anthropic SDK with Platform: POST /v1/messages, with cache breakpoints, thinking, system blocks, tools, images and PDFs kept for models in this format. # Anthropic Messages `POST /v1/messages` takes Anthropic's Messages format, so the Anthropic SDKs work as they are. Set the base URL to `https://platform-api.invideo.io` and use your Platform API key. - **Native format (passthrough).** Your body goes to the model unchanged, including `system` blocks, `cache_control` breakpoints, `thinking`, `tools` and `tool_choice`, images, PDF `document` blocks, `top_k`, `stop_sequences`, `temperature`, `top_p`. The answer and the stream events come back as Anthropic sends them. - **Other models: translated.** Text, images, tools and the system prompt carry over; `cache_control` and `thinking` are dropped. PDF `document` blocks are refused (HTTP 400 `unsupported_parameter`, "Document (PDF) blocks work only with models in this format on this endpoint."). See [Formats and model IDs](/docs/chat/formats) for model ids, aliases and what every door refuses. ## Send a request ```python import anthropic, os client = anthropic.Anthropic( base_url="https://platform-api.invideo.io", # was api.anthropic.com api_key=os.environ["INVIDEO_API_KEY"], # was ANTHROPIC_API_KEY ) document = "The team approved a trial of the new editor for ten workspaces." answer = client.messages.create( model="gemini-4-carbon", max_tokens=2000, system=[{"type": "text", "text": document, "cache_control": {"type": "ephemeral"}}], thinking={"type": "adaptive"}, output_config={"effort": "low"}, messages=[{"role": "user", "content": "Summarise the document."}], ) print(answer.content[-1].text) print(answer.usage) # input, output, cache read and cache write tokens, and cost_usd ``` ```ts import Anthropic from "@anthropic-ai/sdk"; const client = new Anthropic({ baseURL: "https://platform-api.invideo.io", apiKey: process.env.INVIDEO_API_KEY }); const answer = await client.messages.create({ model: "gemini-4-carbon", max_tokens: 1024, messages: [{ role: "user", content: "Name a video app for cooks." }], }); console.log(answer.content[0].type === "text" ? answer.content[0].text : answer.content[0]); ``` ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "max_tokens": 1024, "messages": [{"role": "user", "content": "Name a video app for cooks."}] }' ``` The key goes in `x-api-key` (what the SDK sends) or `Authorization: Bearer`. `anthropic-version` is accepted and not needed. Of `anthropic-beta`, only `interleaved-thinking` and `fine-grained-tool-streaming` are sent on; other betas are dropped. **Max length.** Set a max length (`max_tokens` / `max_completion_tokens` / `max_output_tokens` / `maxOutputTokens`). Without it we hold the model's full maximum; if your spend limit can't cover that, we lower the max to what it can. ## Streaming With `"stream": true` (or `client.messages.stream(...)`), the answer comes as Anthropic's events: `message_start`, `content_block_start`, `content_block_delta`, `content_block_stop`, `message_delta`, `message_stop` and `ping`. A failure mid-stream is an `event: error`. The last `message_delta` has the usage, with `cost_usd`. ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) with client.messages.stream( model="gemini-4-carbon", max_tokens=1024, messages=[{"role": "user", "content": "Write a haiku about soup."}], ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` ## PDFs and images Send them inline (base64) or as an `https` link. A link is fetched by us (public addresses only; 20 MB a file, 50 MB in all) and sent inline. Anthropic Files (`"source": {"type": "file"}`) are refused. Set `INVIDEO_PDF_MODEL` to an enabled model. In `GET /v1/models/{id}`, look for `chat.native_format` equal to `anthropic_messages` and `pdf` in `chat.features`. ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model=os.environ["INVIDEO_PDF_MODEL"], max_tokens=1024, messages=[{ "role": "user", "content": [ {"type": "document", "source": {"type": "url", "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"}}, {"type": "text", "text": "What does this document say?"}, ], }], ) print(answer.content[-1].text) ``` ## Answer ```json { "id": "0193b0c4-...", "type": "message", "role": "assistant", "model": "gemini-4-carbon", "content": [{"type": "text", "text": "SimmerCut"}], "stop_reason": "end_turn", "usage": { "input_tokens": 14, "output_tokens": 6, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0, "cost_usd": "0.000143" } } ``` - `id` is the request's id in Logs (also the `x-request-id` header). - `model` is the id you sent. - `stop_reason`: `end_turn` (finished normally), `max_tokens` (it hit `max_tokens`), `tool_use` (it called a tool), `stop_sequence`, or `refusal`. ## Not available - Server tools that run on Anthropic's side: `web_search`, `web_fetch`, `code_execution`, `tool_search`, `memory` and `mcp_toolset` (HTTP 400 `unsupported_parameter`). Client tools (`computer`, `bash`, `text_editor`) and your own tools work: your code runs them. - Files (`"source": {"type": "file"}`), `container` and `mcp_servers`. - Audio and video input (only Gemini models take them: [Formats](/docs/chat/formats#audio-and-video-input-gemini-models)). ## Errors Anthropic's shape, so the SDK raises `anthropic.NotFoundError`, `anthropic.RateLimitError` and so on. Our code is in `error.code`: ```json {"type": "error", "error": {"type": "rate_limit_error", "message": "...", "code": "spend_limit_exceeded"}, "request_id": "0193b0c4-..."} ``` Not run here: Files, Batches, Admin and `count_tokens` (HTTP 404 `not_found_error`). All codes: [Errors](/docs/errors). --- # Gemini > Use the Google GenAI SDK with Platform: generateContent and streamGenerateContent, passthrough for Gemini models, translated for every other chat model. # Gemini `POST /v1beta/models/{model}:generateContent` and `POST /v1beta/models/{model}:streamGenerateContent?alt=sse` take Gemini's format, so the Google GenAI SDKs work as they are. Set the base URL to `https://platform-api.invideo.io` and use your Platform API key. - **Gemini models: passthrough.** Your body (`contents`, `systemInstruction`, `generationConfig`, `tools`, `inlineData` parts, thinking) goes to Gemini as is, and the answer comes back as Gemini sends it. - **Other models: translated.** Text, images, function tools and the system instruction carry over. `{model}` is our id or the provider's own id (its `aliases` in `GET /v1/models`). See [Formats and model IDs](/docs/chat/formats) for aliases and what every door refuses. ## Send a request ```python from google import genai from google.genai import types import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-4-carbon", contents="Name a video app for cooks.", config=types.GenerateContentConfig(system_instruction="You write short product names.", max_output_tokens=200), ) print(answer.text) print(answer.usage_metadata) # prompt, answer, cached and thought tokens, and cost_usd ``` ```ts import { GoogleGenAI } from "@google/genai"; const client = new GoogleGenAI({ apiKey: process.env.INVIDEO_API_KEY, httpOptions: { baseUrl: "https://platform-api.invideo.io", apiVersion: "v1beta" } }); const answer = await client.models.generateContent({ model: "gemini-4-carbon", contents: "Name a video app for cooks." }); console.log(answer.text); ``` ```bash curl "https://platform-api.invideo.io/v1beta/models/gemini-4-carbon:generateContent" \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"contents": [{"role": "user", "parts": [{"text": "Name a video app for cooks."}]}]}' ``` The key goes in `x-goog-api-key` (what the SDK sends) or in `Authorization: Bearer`. A key in the URL (`?key=`) is refused with 401: URLs end up in logs. **Max length.** Set a max length (`max_tokens` / `max_completion_tokens` / `max_output_tokens` / `maxOutputTokens`). Without it we hold the model's full maximum; if your spend limit can't cover that, we lower the max to what it can. ## Gemini 4 thinking Set `generationConfig.thinkingConfig.thinkingLevel` to `LOW`, `MEDIUM`, or `HIGH` to control how much reasoning a Gemini 4 model uses. Reasoning tokens count toward `maxOutputTokens` and are billed at the model's output rate. Check the model's page or `GET /v1/models` for its output limit and token prices. [Google's thinking guide](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/thinking) ## Streaming `streamGenerateContent?alt=sse` (the SDK's `generate_content_stream`) sends `data:` chunks in Gemini's shape. The last chunk has `usageMetadata`, with `cost_usd`. ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) for chunk in client.models.generate_content_stream(model="gemini-4-carbon", contents="Write a haiku about soup."): print(chunk.text, end="", flush=True) ``` ## Audio and video Send audio or video as `inlineData` (base64, up to 20 MB in all) or an `https` `fileData`, next to your text: ```python from google import genai from google.genai import types import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) audio = open("talk.mp3", "rb").read() answer = client.models.generate_content( model="gemini-4-carbon", contents=[types.Part.from_bytes(data=audio, mime_type="audio/mpeg"), "Summarise this recording."], ) print(answer.text) ``` Audio tokens (a video's sound included, about 25 tokens per second) cost the model's audio price, `audio_input_per_m` in `GET /v1/models`; a video's frames cost the input price. Only Gemini models take audio and video. ## Answer ```json { "responseId": "0193b0c4-...", "modelVersion": "gemini-4-carbon", "candidates": [{"content": {"role": "model", "parts": [{"text": "SimmerCut"}]}, "finishReason": "STOP"}], "usageMetadata": { "promptTokenCount": 9, "candidatesTokenCount": 4, "cachedContentTokenCount": 0, "thoughtsTokenCount": 0, "totalTokenCount": 13, "cost_usd": "0.000004" } } ``` - `responseId` is the request's id in Logs (also the `x-request-id` header). - `finishReason`: `STOP` (finished normally), `MAX_TOKENS` (it hit `maxOutputTokens`), `SAFETY` (blocked). ## Errors Gemini's shape, so the SDK raises `genai.errors.APIError` with the status. Our code is in `error.code_name`: ```json {"error": {"code": 404, "message": "...", "status": "NOT_FOUND", "code_name": "model_not_found"}} ``` Refused with `unsupported_parameter` (HTTP 400): `cachedContent`, `fileData` with `gs://` or File API links (send `inlineData`, or an `https` link), and the `googleSearch`, `codeExecution` and `urlContext` tools. `GET /v1beta/models` lists models in Gemini's shape. All codes: [Errors](/docs/errors). --- # Streaming chat answers > Read chat output, the Platform request ID, and usage and cost in OpenAI-compatible server-sent events. # Streaming Set `"stream": true` and the answer comes as server-sent events while the model writes it, in OpenAI's `chat.completion.chunk` format. The stream ends with `data: [DONE]`. ```bash curl -N https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "gemini-4-carbon", "stream": true, "messages": [{"role": "user", "content": "Write a haiku about rain."}]}' ``` ```text data: {"id":"0193b0c4-7640-72d1-91e7-e11f44de3708","object":"chat.completion.chunk","created":1795680000,"model":"gemini-4-carbon","choices":[{"index":0,"delta":{"content":"Soft"},"finish_reason":null}]} data: {"id":"0193b0c4-7640-72d1-91e7-e11f44de3708","object":"chat.completion.chunk","created":1795680000,"model":"gemini-4-carbon","choices":[{"index":0,"delta":{"content":" rain on"},"finish_reason":null}]} data: {"id":"0193b0c4-7640-72d1-91e7-e11f44de3708","object":"chat.completion.chunk","created":1795680000,"model":"gemini-4-carbon","choices":[{"index":0,"delta":{},"finish_reason":"stop"}],"usage":{"prompt_tokens":14,"completion_tokens":19,"total_tokens":33,"cost":"0.000101","cost_usd":"0.000101","invideo_cost":{"lines":[{"item":"request","quantity":"1","unit_price_usd":"0.000101","amount_usd":"0.000101"}],"total_usd":"0.000101"}},"cost_usd":"0.000101"} data: {"id":"0193b0c4-7640-72d1-91e7-e11f44de3708","object":"chat.completion.chunk","created":1795680000,"model":"gemini-4-carbon","choices":[],"usage":{"prompt_tokens":14,"completion_tokens":19,"total_tokens":33}} data: [DONE] ``` ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) stream = client.chat.completions.create( model="gemini-4-carbon", messages=[{"role": "user", "content": "Write a haiku about rain."}], stream=True, ) for chunk in stream: if chunk.choices and chunk.choices[0].delta.content: print(chunk.choices[0].delta.content, end="") ``` ## What the chunks hold - `delta.content`: the next piece of the answer. - `delta.reasoning_content`: the next piece of the model's reasoning, for models that give it. - `delta.tool_calls`: tool calls as they are written (`index`, then `id`, `function.name` and pieces of `function.arguments`), as OpenAI sends them. - The finishing choice carries `finish_reason`. Its chunk carries `cost_usd` and `usage`, including `usage.cost_usd` and `usage.invideo_cost` with the charge lines and total. - A usage chunk with `choices: []` follows before `[DONE]`. You can read usage without setting `stream_options`. A chunk with `{"error": {...}}` ends the stream. See [Errors](/docs/errors) for error codes. Errors before the stream opens arrive as HTTP errors. ## Closing early If you close the connection early, the model finishes in the background. Platform bills the tokens used and records the request in Logs. Lower `max_tokens` to cap the length of the answer. Get the stored answer with `GET /v1/chat/completions/{id}` if your connection drops. To resume a live stream from a cursor, use [Responses background streaming](/docs/chat/responses#resume-a-responses-stream). The stream opens as soon as the request is accepted. Lines that start with `:` are keep-alive comments while a model thinks; SSE clients skip them. Every JSON chunk’s `id` is the Platform request ID and matches the `x-request-id` response header. Use it to find the request in Logs. Read the ID from the JSON or header. The stream has no SSE `id:` lines or separate `request_id` field. --- # Tools (function calling) > Let a chat model call your functions with OpenAI-compatible tools and tool_choice, then send the results back for the final answer. # Tools Give a model `tools` and it can answer with calls to them instead of text. You run the functions, send the results back as `tool` messages, and the model writes its answer. Models with tools have `chat.capabilities.tools: true` in `GET /v1/models`. ## 1. Offer the tools ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [{"role": "user", "content": "What is the weather in Pune?"}], "tools": [{ "type": "function", "function": { "name": "get_weather", "description": "The weather now in a city.", "parameters": { "type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"] } } }] }' ``` The answer has `finish_reason: "tool_calls"`: ```json { "choices": [{ "index": 0, "finish_reason": "tool_calls", "message": { "role": "assistant", "content": null, "tool_calls": [{"id": "toolu_01", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\":\"Pune\"}"}}] } }] } ``` ## 2. Send the results back Send the whole conversation again: the assistant message with its `tool_calls`, then one `tool` message per call with its `tool_call_id`. ```json { "model": "gemini-4-carbon", "messages": [ {"role": "user", "content": "What is the weather in Pune?"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "toolu_01", "type": "function", "function": {"name": "get_weather", "arguments": "{\"city\":\"Pune\"}"}}]}, {"role": "tool", "tool_call_id": "toolu_01", "content": "{\"temp_c\": 29, \"sky\": \"clear\"}"} ], "tools": [ ... the same tools ... ] } ``` The next answer is text (or more tool calls). ## tool_choice | Value | The model | | --- | --- | | `"auto"` (default) | Answers in text or calls tools. | | `"none"` | Answers in text; the tools are not sent. | | `"required"` | Must call one or more tools. | | `{"type": "function", "function": {"name": "get_weather"}}` | Must call that tool. | Each call is one request in Logs and is charged its own tokens: a tool loop of three turns is three requests. --- # Structured output (JSON) > Get a chat model's answer as JSON that matches your JSON Schema, with response_format json_schema or json_object. # Structured output Ask for JSON with `response_format`. ## json_schema The answer is one JSON object that matches your schema. It works on every model with tools (`chat.capabilities.structured_output: true`). ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [{"role": "user", "content": "Three scene ideas for a 30 second ad for running shoes."}], "response_format": { "type": "json_schema", "json_schema": { "name": "scenes", "schema": { "type": "object", "properties": { "scenes": { "type": "array", "items": { "type": "object", "properties": {"title": {"type": "string"}, "seconds": {"type": "integer"}}, "required": ["title", "seconds"] } } }, "required": ["scenes"] } } } }' ``` `choices[0].message.content` is the JSON as a string: ```json {"scenes": [{"title": "Dawn run on the bridge", "seconds": 10}, {"title": "Close-up of the sole", "seconds": 8}, {"title": "Finish line", "seconds": 12}]} ``` ```python from openai import OpenAI import json, os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) messages = [{"role": "user", "content": "Three scene ideas for a 30 second ad for running shoes."}] response_format = { "type": "json_schema", "json_schema": { "name": "scenes", "schema": { "type": "object", "properties": { "scenes": { "type": "array", "items": { "type": "object", "properties": {"title": {"type": "string"}, "seconds": {"type": "integer"}}, "required": ["title", "seconds"], }, } }, "required": ["scenes"], }, }, } answer = client.chat.completions.create(model="gemini-4-carbon", messages=messages, response_format=response_format) scenes = json.loads(answer.choices[0].message.content)["scenes"] print(json.dumps(scenes, indent=2)) ``` With `stream: true` the JSON arrives in `delta.content` pieces; parse it once the stream ends. `json_schema` cannot be sent with `tools` in the same request: use one of them. ## json_object `{"type": "json_object"}` asks the model for one JSON object with no schema. Say in your messages what the object holds. Parse it, and check it, in your code. --- # Video > Generate and edit video from prompts, frames and reference media. Track the run and download its results. Use `POST /v1/request` to generate or edit video with a Platform API key. If you already use a provider SDK, keep its request format and set its base URL to the Platform. Each video format takes canonical Platform IDs for video models your workspace can call. [Video formats](/docs/sdks/video) ## Find a model List the models and prices available to your key with `GET /v1/models?modality=video`. Read `GET /v1/models/{model}` for the model's `modes`, `input_schema`, output shape and price tiers. Use the input schema for the mode you submit. [Catalogue](/docs/catalog) ## Submit a video This request makes a four-second Veo 3 Fast clip. Use a new idempotency key for each new clip and reuse the key if you retry the same body. ```bash curl https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: paper-boat-01" \ -d '{ "model": "veo-3-fast", "mode": "generate", "input": { "prompt": "A paper boat floats down a rain-soaked street", "duration": 4, "resolution": "720p", "aspect_ratio": "16:9", "generate_audio": false } }' ``` Set `REQUEST_ID` to the `id` from the response. If the model is unavailable to your key, choose an enabled model and use its mode and input options. ## Choose inputs | Input | What it does | | --- | --- | | Prompt | Describes the scene, motion or edit. Some models also take a negative prompt or a seed. | | Start and end frames | The start image anchors the opening. Models with an end-frame input can also target a closing image. Veo 3 Fast takes `image_url` for a start frame. | | Reference images or video | Guide the look, subject or motion. For example, Seedance 2.0's reference mode takes `reference_image_urls` and `reference_video_urls`. Edit models may instead take one source video. | | Audio | Some models take a driving track or reference audio. Seedance 2.0's reference mode takes `reference_audio_urls`. Where available, `generate_audio` controls whether the model makes a soundtrack. | | Duration, resolution and aspect ratio | Use the values allowed by the selected model. Veo 3 Fast accepts 4, 6 or 8 seconds, `720p` or `1080p`, and `16:9` or `9:16`. A source-driven edit may determine these values from the input. | Use a downloadable HTTPS URL or a base64 data URI where the model takes a file. Use an array of file strings where the schema says `files`. Check the schema for accepted containers, sizes, clip lengths and number of references. [Files](/docs/files) ## Poll and download Read `GET /v1/request/{id}` every 2 to 5 seconds while the request is queued or running. Provider formats that return a task use their own status or result route. Follow its status URL when one is returned. Use polling for completion because media webhooks are unavailable. [Requests](/docs/requests) · [Video formats](/docs/sdks/video) ```bash curl "https://platform-api.invideo.io/v1/request/${REQUEST_ID:?Set REQUEST_ID to the id from the submit response}" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` On `succeeded`, download the signed links in `output.files[].url`. Each file includes its content type and, when available, its width, height and duration in seconds. The links expire after one hour. Read the request again for fresh links. On `failed`, read `error` for the reason and whether you can retry. ## Prices and limits The [Pricing page](/pricing) and each model page show the billed unit and the exact rate for each priced option. For models priced by the second, your rate depends on the model and can vary with settings such as resolution or generated audio. Check the model details for the rate conditions. The model may bill the source duration for editing or the generated duration for a new clip. The Platform holds an estimate at submission and settles the exact charge when the run ends. The generic result shows the charge in `cost_usd`. Provider formats expose the settled customer cost in `x-invideo-cost-usd` and may also put it in the result body. [Billing and balance](/docs/billing) · [Video formats](/docs/sdks/video) The request body can be up to 64 MB. Downloadable input URLs allow up to 300 MB per video, 30 MB per image and 100 MB per audio file. Individual models can impose smaller limits. For a rate-limit response, wait the number of seconds in `Retry-After`. [Files](/docs/files) · [Limits](/docs/limits) ## Fix a field error A provider format translates its fields into the selected model's inputs. If the model cannot use a translated field, the API returns a `422` that names it. For example, Kling's `contents.last_frame` fails for Veo 3 Fast, which takes only a start frame. Remove the field or select a model whose schema supports it. With `POST /v1/request`, read `detail[].loc` for the path to an invalid field. [Errors](/docs/errors) --- # Audio > Generate speech or music, edit audio and transcribe recordings. Track the run and download its output. Use `POST /v1/request` to generate speech, music or sound effects, process a recording, or turn it into text. If you already use a provider SDK, keep its request format and use the Platform base URL and your Platform API key. Use a canonical Platform model ID in the format's model field. [Audio formats](/docs/sdks/audio) ## Find a model List the models and prices available to your key with `GET /v1/models?modality=audio`. Read `GET /v1/models/{model}` for the model's `modes`, `input_schema`, output shape and price tiers. Choose the mode and fields for the job you want to run. [Catalogue](/docs/catalog) ## Submit an audio request This example transcribes a recording with Nova-3. Set `INVIDEO_AUDIO_URL` to an HTTPS recording the Platform can download. The example uses `jq` to encode that URL in JSON. Use a new idempotency key for each recording and reuse it if you retry the same body. ```bash curl https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: meeting-transcript-01" \ --data-binary "$(jq -cn --arg url "${INVIDEO_AUDIO_URL:?Set an HTTPS recording URL}" \ '{model:"deepgram-nova-3",mode:"transcribe",input:{audio_url:$url,language:"en",diarize:true}}')" ``` Save the response `id`. For a speech generation example, use `cartesia-sonic-3` with mode `generate` and pass the text in `input.prompt` and a Cartesia voice ID in `input.voice_id`. ## Choose inputs | Task | Fields to look for | | --- | --- | | Text to speech | Text and a voice ID. The model may also accept language, speed, emotion, volume, an output format or a sample rate. | | Music or sound effects | A prompt and, for some models, lyrics, a duration, or an instrumental setting. | | Transcription | A source audio file and optional controls such as language, word timing or speaker labels. | | Audio editing, stems or dubbing | A source recording, plus controls such as stem count or target language where the model supports them. | | Reference audio or video | Some models use reference clips for voice or style. Voice-over models can use a source video to time the track. | Audio files can be downloadable HTTPS URLs or base64 data URIs. Use the field name, accepted containers, clip length and reference count from the model's schema. [Files](/docs/files) ## Poll and download For `POST /v1/request`, read `GET /v1/request/{id}` every 2 to 5 seconds while the request is queued or running. Some provider formats return bytes or a transcript when the request finishes. Those that return a task have a status or result route of their own. Use polling for asynchronous completion because media webhooks are unavailable. [Requests](/docs/requests) · [Audio formats](/docs/sdks/audio) On `succeeded`, download `output.files[].url`. Use each file's `content_type` to select a player or extension. For stems, read `name` when present. For transcription, read `output.transcript.text` and the words, timings and speaker labels the model provides. The transcript is also available as a JSON download. Signed links expire after one hour. Read the request again for fresh links. On `failed`, read `error` for what happened. ## Prices and limits The [Pricing page](/pricing) and each model page show the billed unit and the exact rate for each priced option. Models priced per second may bill the source length, as with speech-to-text and dubbing, or the generated length. Other models use a different unit, such as characters for Cartesia Sonic 3. Check `prices[].unit` and `prices[].conditions` in the model details before you submit. The Platform holds an estimate and settles the exact charge when the run ends. Look for `cost_usd` on the generic result or the `x-invideo-cost-usd` header on a settled provider response. Some formats also carry the cost in the body. [Billing and balance](/docs/billing) · [Audio formats](/docs/sdks/audio) The request body can be up to 64 MB. Use a downloadable HTTPS URL for larger files, up to 100 MB per audio file or 300 MB per reference video. The model may impose smaller limits on files, duration or text length. For a rate-limit response, wait the number of seconds in `Retry-After`. [Files](/docs/files) · [Limits](/docs/limits) ## Fix a field error A provider format can expose fields the selected model does not take. The API returns a `422` naming a translated field the model cannot use. For example, if you choose a transcript model in a speech synthesis format, send its audio source and omit the speech voice field. Check its input schema for the names and accepted values. With `POST /v1/request`, read `detail[].loc` for the path to an invalid field. [Errors](/docs/errors) --- # Use your own SDK > Change the base URL and the model id, and a tool built for another provider's API runs any Platform model. OpenAI, ElevenLabs, Replicate, fal, Gemini, xAI, Runway, Luma, Deepgram, Cartesia and more. Keep your provider’s request format. Set the base URL to Platform, use your Platform API key, and pass a model ID. The same billing, limits, and logs apply as for `POST /v1/request`. Choose a model in the Playground to see the formats available for it. Replicate and fal offer general-purpose formats. Maker-specific endpoints take the models and inputs shown in their guides. Every base URL starts with: ```text https://platform-api.invideo.io ``` Add the path below. | You use | Path | Page | | --- | --- | --- | | OpenAI SDK: images, speech to text, text to speech | `/v1` | [OpenAI media](/docs/sdks/openai-media) | | ElevenLabs SDK | `/elevenlabs` | [ElevenLabs](/docs/sdks/elevenlabs) | | Replicate clients | `/replicate` | [Replicate](/docs/sdks/replicate) | | fal queue API | `/fal` | [fal](/docs/sdks/fal) | | Google GenAI SDK: Nano Banana, Gemini speech, Veo, Imagen | no path | [Gemini media](/docs/sdks/gemini-media) | | xAI video | `/xai` | [xAI](/docs/sdks/xai) | | Runway SDK | `/runway` | [Runway](/docs/sdks/runway) | | Luma SDK | `/luma` | [Luma](/docs/sdks/luma) | | Deepgram and Cartesia | `/deepgram`, `/cartesia` | [Deepgram and Cartesia](/docs/sdks/speech) | | BFL, Kling, MiniMax, Ideogram, BytePlus, DashScope, Meshy | `/` | [Makers' own APIs](/docs/sdks/makers) | ## More native media formats Use the paths below with your Platform key. The OpenAPI description lists the full submit and poll paths. [OpenAPI](https://platform-api.invideo.io/v1/openapi.json) | Provider | Submit or result path | Settled USD field | | --- | --- | --- | | OpenAI media | `/v1/images/*`, `/v1/audio/*` | `usage.cost` in JSON, header on byte or text responses | | Gemini media | `/v1beta/models/{model}:predict`, `:generateContent`, `:predictLongRunning`, and operations | `usageMetadata.cost_usd` | | Replicate | `/replicate/v1/predictions` | `metrics.cost_usd` | | fal | `/fal/{model}` and its queue status or result | `usage.cost` | | xAI and Recraft images | `/xai/v1/images/*`, `/recraft/v1/images/generations` | `usage.cost` | | xAI videos | `/xai/v1/videos/generations`, `/xai/v1/videos/{id}` | `usage.cost` on result | | Runway, Luma, BFL, Ideogram, legacy Kling, DashScope, Meshy | Maker submit and result endpoints | `metadata.invideo_cost_usd` | | Kling 3 Omni | `/kling/omni-video/kling-3.0-omni`, `/kling/tasks?task_ids=…` | `data[].usage.invideo_cost_usd` on terminal tasks | | Firefly, Phota, Reve, Topaz Bloom | `/adobe/v3`, `/phota/v2/phota`, `/reve/v1/image`, `/topaz/image/v1` | `metadata.invideo_cost_usd` | | Magnific | `/freepik/v1/ai` | `data.cost_usd` | | Higgsfield and Pruna | `/higgsfield/v1/job-sets/{id}`, `/pruna/v1/predictions/status/{id}` | `metadata.invideo_cost_usd` | | Runware | `/runware/v1` with one task per JSON array, `getResponse` to poll | `usage.cost` for images, `data[].usage.invideo_cost_usd` for video | | BytePlus ModelArk | `/byteplus/api/v3/images/generations`, `/byteplus/api/v3/contents/generations/tasks` | `usage.cost` | | BytePlus Seed Audio and Seed TTS | `/byteplus/api/v3/tts`, `/byteplus/api/v3/contents/generations` | `usage.invideo_cost_usd` | | BytePlus Vision | `/byteplusvision` with submit or result action | `metadata.invideo_cost_usd` for images, `usage.invideo_cost_usd` for video | | ElevenLabs, Deepgram and Cartesia | Speech, transcription and stem separation | `metadata.invideo_cost_usd` in JSON, header on audio or ZIP | | Fish Audio, Sarvam, MiniMax and Cleanvoice | `/fishaudio/v1`, `/sarvam/text-to-speech`, `/minimax/v1`, `/cleanvoice/v2/edits` | `metadata.invideo_cost_usd` in JSON, header on audio | | Mureka, LTX, HeyGen and Tencent Wand | `/mureka/v1`, `/ltx/v2`, `/heygen/v3`, `/tencent/v1/wand` | `usage.invideo_cost_usd` on result | | Bach, Beeble and Tencent MPS | `/bach/api/vdr/video/v2`, `/beeble/v1/switchx/generations`, `/tencentmps` | `metadata.invideo_cost_usd` on result | | PixVerse | `/pixverse/openapi/v2/video/{action}/generate`, `/pixverse/openapi/v2/video/result/{id}` | `Resp.usage.invideo_cost_usd` | Completed requests carry the exact charged USD as a decimal string in `x-invideo-cost-usd` when the amount is known before response headers. Pending tasks gain their charge on the terminal result. This amount is the Platform charge to your workspace. The accompanying `invideo_cost` object in the same usage or metadata section lists the total and each billed item. In the invideo API, read `cost.total_usd` and `cost.lines` on the completed request. The final usage event of a chat stream carries its cost object. For audio or other byte responses, read the JSON object from the `x-invideo-cost-breakdown` header. ## The same rules everywhere - **Your key.** Send it the way that tool does: `Authorization: Bearer`, `Authorization: Key` (fal), `Authorization: Token` (Replicate, Deepgram), `xi-api-key` (ElevenLabs), `x-key` (BFL), `x-api-key`, `x-goog-api-key`. A key in the URL is refused. - **Fields a provider has no slot for.** Put the model's own inputs in `extra` (`extra_body` for the OpenAI SDK). They are checked against the model's inputs, like `input` in `POST /v1/request`. - **What we refuse.** A field that would change the price or the result and that the model has no input for is a 400 in that provider's error shape, naming the field. Webhooks, `n` above 1 and cancelling a run are not supported yet. - **Waiting.** Calls that return the result at once (OpenAI audio, ElevenLabs, Deepgram, Cartesia, Ideogram, ...) answer when the run ends, up to the model's longest run and at most 30 minutes. Calls that are asynchronous in that provider's API (Replicate, fal, Runway, Luma, Veo, ...) stay asynchronous. - **Unsupported parameters.** The API names parameters it cannot map to the selected model. For zero data retention, use a [supported provider format](/docs/security#zero-data-retention). - **Results.** Asset links and request IDs are issued by Platform. Media failures have no charge. If an LLM request uses tokens before a content or output-limit stop, the response reports the charge for those tokens. - **Media retries.** Reuse the same `Idempotency-Key` and body after an uncertain media submit. The API can return the original request without starting another generation. Check an existing request's status before retrying a chat submission. --- # OpenAI media > Generate images, transcribe audio and create speech with the OpenAI SDK, the Vercel AI SDK, LiteLLM or n8n. Change the base URL and the model. These endpoints take OpenAI's request and answer in OpenAI's shape, so the OpenAI SDK works as it is. Base URL: ```text https://platform-api.invideo.io/v1 ``` | Endpoint | Models | | --- | --- | | `POST /v1/images/generations`, `POST /v1/images/edits` | every image model | | `POST /v1/audio/transcriptions` | every speech-to-text model | | `POST /v1/audio/speech` | every text-to-speech model | ## Images ```python import os, base64 from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nano-banana-2-1", prompt="A red fox in fresh snow, golden hour", size="1536x1024") open("fox.png", "wb").write(base64.b64decode(result.data[0].b64_json)) ``` - The image comes back as `b64_json`. With `response_format="url"` you get a link of ours instead. - `size` becomes the model's closest aspect ratio. `quality` and `background` are passed to models that have them. - `images.edit` sends your `image` (one or several) with the prompt. A `mask` is not supported. - `n` must be 1: each image is priced and billed as its own request. ## Speech to text ```python with open("meeting.mp3", "rb") as audio: text = client.audio.transcriptions.create(model=os.environ["INVIDEO_TRANSCRIPTION_MODEL"], file=audio) print(text.text) ``` Set `INVIDEO_TRANSCRIPTION_MODEL` to an enabled speech-to-text model from `GET /v1/models?modality=audio`. `response_format` can be `json`, `text`, `verbose_json` (with `words`), `srt` or `vtt`. ## Text to speech ```python speech = client.audio.speech.create( model="elevenlabs-tts-multilingual-v2", voice=os.environ["INVIDEO_TTS_VOICE"], input="Welcome to the show.", ) speech.write_to_file("welcome.mp3") ``` Set `INVIDEO_TTS_VOICE` to an ElevenLabs voice ID. You can find the model's voice inputs with `GET /v1/models/elevenlabs-tts-multilingual-v2`. Read the `Content-Type` header for the returned audio format. ## Model inputs OpenAI has no field for ```python client.images.generate( model="nano-banana-2-1", prompt="A red fox in fresh snow", extra_body={"resolution": "1K"}, ) ``` This example sets Nano Banana 2.1’s image resolution. `extra_body` takes the selected model’s own input names and values. Look them up with `GET /v1/models/{id}`. These calls answer when the run ends. --- # ElevenLabs > Use the ElevenLabs SDK with the Platform: speech to text, text to speech, sound effects, music, dialogue and speech to speech. Change the base URL. Base URL: ```text https://platform-api.invideo.io/elevenlabs ``` Your Platform key goes where the ElevenLabs key goes (`xi-api-key`). ```python import os from elevenlabs.client import ElevenLabs client = ElevenLabs(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/elevenlabs") with open("meeting.mp3", "rb") as audio: transcript = client.speech_to_text.convert(file=audio, model_id="scribe_v2", diarize=True) print(transcript.text) ``` ```ts import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js"; const client = new ElevenLabsClient({ apiKey: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/elevenlabs" }); const voiceId = process.env.ELEVENLABS_VOICE_ID; if (!voiceId) throw new Error("Set ELEVENLABS_VOICE_ID to an ElevenLabs voice ID."); const audio = await client.textToSpeech.convert(voiceId, { text: "Hello", modelId: "eleven_v3" }); ``` | Route | What it runs | | --- | --- | | `POST /v1/speech-to-text` | every speech-to-text model (`scribe_v2` is Scribe v2) | | `POST /v1/text-to-speech/{voice_id}` (and `/stream`) | every text-to-speech model | | `POST /v1/sound-generation`, `POST /v1/music` | sound-effect and music models | | `POST /v1/text-to-dialogue` | dialogue models (up to four voices) | | `POST /v1/speech-to-speech/{voice_id}` | speech-to-speech models | | `GET /v1/models` | the audio models | `model_id` is our id or an ElevenLabs id such as `eleven_v3`, `eleven_multilingual_v2` or `scribe_v2`. Inputs ElevenLabs has no field for go in `extra`. Each call returns when the run ends. --- # Replicate > Use Replicate's clients with the Platform. Every model, one generic API: create a prediction, wait with Prefer, read the result. Base URL: ```text https://platform-api.invideo.io/replicate ``` Use the owner `invideo` for Platform models: `invideo/`. ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nano-banana-2-1", input={"prompt": "A red fox in fresh snow"}) print(output) ``` ```bash curl -X POST https://platform-api.invideo.io/replicate/v1/models/invideo/nano-banana-2-1/predictions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Prefer: wait=60" \ -H "Content-Type: application/json" \ -d '{"input": {"prompt": "A red fox in fresh snow"}}' ``` - `input` is the model's own input object (see `GET /v1/models/{id}`); `image_url`, `audio_url` and `video_url` go to the model's file input. - `Prefer: wait` (or `wait=N`, 1 to 60 seconds) returns when the run ends. Without it the prediction is `starting`; read it with `GET /v1/predictions/{id}` until `succeeded` or `failed`. - `output` is a link of ours (a list for several files). Links last one hour; read the prediction again for a fresh one. - Webhooks and cancelling are not supported yet. --- # fal > Call the Platform in fal's queue API format with your Platform API key. Base URL: ```text https://platform-api.invideo.io/fal ``` Use a Platform model ID, an alias, or the part of a fal app ID after the owner. ```js const response = await fetch("https://platform-api.invideo.io/fal/nano-banana-2-1", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "A red fox in fresh snow" }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ```bash curl -X POST https://platform-api.invideo.io/fal/nano-banana-2-1 \ -H "Authorization: Key $INVIDEO_API_KEY" -H "Content-Type: application/json" \ -d '{"prompt": "A red fox in fresh snow"}' # {"request_id": "...", "status_url": ".../status", "response_url": "..."} ``` - Send the same authorization header to the Platform `status_url` until it returns `COMPLETED`, then GET the Platform `response_url` to read the result in fal's shape. - A target of `fal.run` (the proxy header `x-fal-target-url`) or `/fal/run/{app}` returns when the run ends. - `num_images` must be 1. Webhooks and cancelling are not supported yet. --- # Gemini media > Generate images, speech and video with the Google GenAI SDK: generateContent, predict and predictLongRunning through the Gemini endpoints. The [Gemini endpoints](/docs/chat/gemini) also run media models. Base URL: ```text https://platform-api.invideo.io ``` ```python from google import genai from google.genai import types import os, base64 client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="gemini-2.5-flash-image", contents="A red fox in fresh snow", config=types.GenerateContentConfig(response_modalities=["IMAGE"], image_config=types.ImageConfig(aspect_ratio="16:9")), ) image = response.candidates[0].content.parts[0].inline_data.data ``` - `generateContent` and `streamGenerateContent` run image and speech models and answer `inlineData` parts. - `predict` runs image models in Imagen's shape (`predictions[].bytesBase64Encoded`). - `predictLongRunning` runs video models (Veo); read the operation with `GET /v1beta/models/{model}/operations/{id}` until `done`. The video is `response.generateVideoResponse.generatedSamples[0].video.uri`. - `candidateCount` and `sampleCount` must be 1. --- # xAI > Generate video with xAI’s API format and images with OpenAI’s API format through Platform. Base URL: ```text https://platform-api.invideo.io/xai ``` Use `jq` to read the request ID from the submit response. ```bash REQUEST_ID=$(curl -fsS -X POST https://platform-api.invideo.io/xai/v1/videos/generations \ -H "Authorization: Bearer $INVIDEO_API_KEY" -H "Content-Type: application/json" \ -d '{"model": "veo-3-fast", "prompt": "A red fox running through snow", "duration": 4}' | jq -er .request_id) curl "https://platform-api.invideo.io/xai/v1/videos/$REQUEST_ID" -H "Authorization: Bearer $INVIDEO_API_KEY" # {"status": "done", "video": {"url": "..."}} ``` `status` is `pending`, `done` or `failed`. Images use the [OpenAI shape](/docs/sdks/openai-media) at `/xai/v1/images/generations`. Use a Platform video or image model that matches the endpoint. --- # Runway > Use the Runway SDK with the Platform: image to video, text to video, video to video and text to image. Change the base URL. Base URL: ```text https://platform-api.invideo.io/runway ``` ```python import os, time from runwayml import RunwayML client = RunwayML(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/runway") task = client.text_to_video.create(model="veo-3-fast", prompt_text="A red fox running through snow", ratio="1280:720", duration=4) while (task := client.tasks.retrieve(task.id)).status in ("PENDING", "RUNNING"): time.sleep(5) if task.status != "SUCCEEDED": raise RuntimeError(getattr(task, "failure", None) or f"Task ended in {task.status}") print(task.output) ``` Routes: `POST /v1/image_to_video`, `text_to_video`, `video_to_video`, `text_to_image`, `character_performance`, `video_upscale`, and `GET /v1/tasks/{id}` (`PENDING`, `RUNNING`, `SUCCEEDED`, `FAILED`). Use any Platform model that matches the route’s modality. Cancelling a task is not supported. --- # Luma > Generate video and images through Platform with the Luma SDK and Dream Machine’s API format. Base URL: ```text https://platform-api.invideo.io/luma ``` ```python import os, time from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A red fox running through snow", model="veo-3-fast", duration="4s") while (generation := client.generations.get(generation.id)).state in ("queued", "dreaming"): time.sleep(5) if generation.state != "completed": raise RuntimeError(generation.failure_reason or f"Generation ended in {generation.state}") print(generation.assets.video) ``` Routes: `POST /dream-machine/v1/generations` (video), `/generations/image`, `GET /dream-machine/v1/generations/{id}`. `keyframes.frame0` and `frame1` are the first and last frame. `callback_url` is not supported yet. --- # Deepgram and Cartesia > Use Deepgram's and Cartesia's own speech APIs with the Platform. Every speech-to-text and text-to-speech model answers. ## Deepgram Base URL: ```text https://platform-api.invideo.io/deepgram ``` `POST /v1/listen` takes the audio as the body (or `{"url": ...}`) and the options in the query; the answer is Deepgram's `results.channels[].alternatives[]`. Set `INVIDEO_TRANSCRIPTION_MODEL` to an enabled speech-to-text model from `GET /v1/models?modality=audio`. ```bash curl -X POST "https://platform-api.invideo.io/deepgram/v1/listen?model=${INVIDEO_TRANSCRIPTION_MODEL:?Choose an enabled speech-to-text model}&smart_format=true" \ -H "Authorization: Token $INVIDEO_API_KEY" -H "Content-Type: audio/mpeg" --data-binary @meeting.mp3 ``` ## Cartesia Base URL: ```text https://platform-api.invideo.io/cartesia ``` - `POST /tts/bytes` takes Cartesia's JSON (`model_id`, `transcript`, `voice: {mode: "id", id}`) and answers the audio. `output_format` is not applied: the audio is in the model's own format (see `Content-Type`). - `POST /stt` takes the multipart `file` and answers `text`, `language`, `duration` and `words`. Both answer when the run ends. --- # Makers' own APIs > BFL, Kling, MiniMax, Ideogram, BytePlus, DashScope and Meshy: call the Platform in each maker's own create-then-read shape. Every maker has its own prefix on the same host: ```text https://platform-api.invideo.io/ ``` A route takes every model of its kind; the maker's own model name works when it is an alias of one of ours, and our id always works. | Maker | Create | Read | | --- | --- | --- | | BFL (`x-key`) | `POST /bfl/v1/{model}` | `GET /bfl/v1/get_result?id=` | | Kling | `POST /kling/v1/videos/text2video`, `image2video`, `/kling/v1/images/generations` | `GET` the same path + `/{task_id}` | | MiniMax | `POST /minimax/v1/video_generation` | `GET /minimax/v1/query/video_generation?task_id=`, `GET /minimax/v1/files/retrieve?file_id=` | | MiniMax (at once) | `POST /minimax/v1/image_generation`, `POST /minimax/v1/t2a_v2` | | | Ideogram (at once) | `POST /ideogram/generate`, `POST /ideogram/v1/{model}/generate` | | | BytePlus ModelArk | `POST /byteplus/api/v3/contents/generations/tasks`, `POST /byteplus/api/v3/images/generations` (at once) | `GET /byteplus/api/v3/contents/generations/tasks/{id}` | | DashScope | `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis`, `.../text2image/image-synthesis` | `GET /dashscope/api/v1/tasks/{id}` | | Meshy | `POST /meshy/openapi/v2/text-to-3d`, `/v1/image-to-3d`, `/v1/multi-image-to-3d` | `GET` the same path + `/{id}` | ```bash curl -X POST https://platform-api.invideo.io/bfl/v1/nano-banana-2-1 \ -H "x-key: $INVIDEO_API_KEY" -H "Content-Type: application/json" \ -d '{"prompt": "A red fox in fresh snow"}' ``` Callbacks and cancelling are not supported yet. Fields that change the result and that the model has no input for are refused with a 400 in the maker's error shape. --- # Video provider formats > Switch video generation and editing code to a Platform endpoint. ## Use your existing provider code Choose your existing request format. Set the base URL and API key, then put an enabled Platform model ID from [Models](/models) in the field listed below. Use the provider's operation path after the base URL. If your client already appends a version prefix, supply it only once. Depending on the operation, the call returns a result directly or a task ID to poll on the same Platform endpoint. | Format | Platform base URL | Authentication | Model ID goes in | | --- | --- | --- | --- | | invideo API | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` and `mode` | | Adobe Firefly | `https://platform-api.invideo.io/adobe` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Alibaba Model Studio | `https://platform-api.invideo.io/dashscope` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Bach | `https://platform-api.invideo.io/bach` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model_name` | | Beeble | `https://platform-api.invideo.io/beeble` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | BytePlus ModelArk | `https://platform-api.invideo.io/byteplus` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | BytePlus Vision | `https://platform-api.invideo.io/byteplusvision` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` alongside the native `req_key` | | Cleanvoice | `https://platform-api.invideo.io/cleanvoice` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | fal | `https://platform-api.invideo.io/fal` | `Authorization: Key $INVIDEO_API_KEY` | App ID `{model-id}` | | Gemini | `https://platform-api.invideo.io` | `x-goog-api-key: $INVIDEO_API_KEY` | SDK `model` argument or REST path `/v1beta/models/{model-id}:…` | | HeyGen | `https://platform-api.invideo.io/heygen` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Higgsfield | `https://platform-api.invideo.io/higgsfield` | `hf-api-key: $INVIDEO_API_KEY` | Body `model` | | Kling | `https://platform-api.invideo.io/kling` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model_name` | | LTX | `https://platform-api.invideo.io/ltx` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Luma | `https://platform-api.invideo.io/luma/dream-machine/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | MiniMax | `https://platform-api.invideo.io/minimax` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | PixVerse | `https://platform-api.invideo.io/pixverse` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Pruna AI | `https://platform-api.invideo.io/pruna` | `Authorization: Bearer $INVIDEO_API_KEY` | Header `Model` | | Replicate | `https://platform-api.invideo.io/replicate` | `Authorization: Bearer $INVIDEO_API_KEY` | SDK model `invideo/{model-id}` or REST path `/v1/models/invideo/{model-id}/predictions` | | Runware | `https://platform-api.invideo.io/runware` | `Authorization: Bearer $INVIDEO_API_KEY` | Each inference task's `model` field | | Runway | `https://platform-api.invideo.io/runway` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Tencent Wand | `https://platform-api.invideo.io/tencent` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | xAI | `https://platform-api.invideo.io/xai` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | --- # Image provider formats > Switch image generation, editing and upscaling code to a Platform endpoint. ## Use your existing provider code Choose your existing request format. Set the base URL and API key, then put an enabled Platform model ID from [Models](/models) in the field listed below. Use the provider's operation path after the base URL. If your client already appends a version prefix, supply it only once. Depending on the operation, the call returns a result directly or a task ID to poll on the same Platform endpoint. See the [image guide](/docs/guides/image) for image inputs, sizes and pricing. | Format | Platform base URL | Authentication | Model ID goes in | | --- | --- | --- | --- | | invideo API | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` and `mode` | | Adobe Firefly | `https://platform-api.invideo.io/adobe` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Alibaba Model Studio | `https://platform-api.invideo.io/dashscope` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Black Forest Labs | `https://platform-api.invideo.io/bfl` | `x-key: $INVIDEO_API_KEY` | Path `/v1/{model-id}` | | BytePlus ModelArk | `https://platform-api.invideo.io/byteplus` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | BytePlus Vision | `https://platform-api.invideo.io/byteplusvision` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` alongside the native `req_key` | | fal | `https://platform-api.invideo.io/fal` | `Authorization: Key $INVIDEO_API_KEY` | App ID `{model-id}` | | Gemini | `https://platform-api.invideo.io` | `x-goog-api-key: $INVIDEO_API_KEY` | SDK `model` argument or REST path `/v1beta/models/{model-id}:…` | | Higgsfield | `https://platform-api.invideo.io/higgsfield` | `hf-api-key: $INVIDEO_API_KEY` | Body `model` | | Ideogram | `https://platform-api.invideo.io/ideogram` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Kling | `https://platform-api.invideo.io/kling` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model_name` | | Luma | `https://platform-api.invideo.io/luma/dream-machine/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Magnific | `https://platform-api.invideo.io/freepik` | `x-freepik-api-key: $INVIDEO_API_KEY` | Body `model` | | MiniMax | `https://platform-api.invideo.io/minimax` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | OpenAI | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Phota Labs | `https://platform-api.invideo.io/phota` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model`, or `base_model` on generate and edit | | Pruna AI | `https://platform-api.invideo.io/pruna` | `Authorization: Bearer $INVIDEO_API_KEY` | Header `Model` | | Recraft | `https://platform-api.invideo.io/recraft` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Replicate | `https://platform-api.invideo.io/replicate` | `Authorization: Bearer $INVIDEO_API_KEY` | SDK model `invideo/{model-id}` or REST path `/v1/models/invideo/{model-id}/predictions` | | Reve | `https://platform-api.invideo.io/reve` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Runware | `https://platform-api.invideo.io/runware` | `Authorization: Bearer $INVIDEO_API_KEY` | Each inference task's `model` field | | Runway | `https://platform-api.invideo.io/runway` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Topaz | `https://platform-api.invideo.io/topaz` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | xAI | `https://platform-api.invideo.io/xai` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | --- # Audio provider formats > Switch speech, transcription, music and audio editing code to a Platform endpoint. ## Use your existing provider code Choose your existing request format. Set the base URL and API key, then put an enabled Platform model ID from [Models](/models) in the field listed below. Use the provider's operation path after the base URL. If your client already appends a version prefix, supply it only once. Depending on the operation, the call returns a result directly or a task ID to poll on the same Platform endpoint. Choose an operation your format supports. Available operations vary by format, including speech synthesis, transcription, music generation, and audio editing. | Format | Platform base URL | Authentication | Model ID goes in | | --- | --- | --- | --- | | invideo API | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` and `mode` | | Adobe Firefly | `https://platform-api.invideo.io/adobe` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | BytePlus ModelArk | `https://platform-api.invideo.io/byteplus` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Cartesia | `https://platform-api.invideo.io/cartesia` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model_id` for speech or `model` for transcription | | Cleanvoice | `https://platform-api.invideo.io/cleanvoice` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | ElevenLabs | `https://platform-api.invideo.io/elevenlabs` | `xi-api-key: $INVIDEO_API_KEY` | Body or multipart field `model_id` | | fal | `https://platform-api.invideo.io/fal` | `Authorization: Key $INVIDEO_API_KEY` | App ID `{model-id}` | | Fish Audio | `https://platform-api.invideo.io/fishaudio` | `Authorization: Bearer $INVIDEO_API_KEY` | Header `Model` | | Gemini | `https://platform-api.invideo.io` | `x-goog-api-key: $INVIDEO_API_KEY` | SDK `model` argument or REST path `/v1beta/models/{model-id}:…` | | MiniMax | `https://platform-api.invideo.io/minimax` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Mureka | `https://platform-api.invideo.io/mureka` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | OpenAI | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Replicate | `https://platform-api.invideo.io/replicate` | `Authorization: Bearer $INVIDEO_API_KEY` | SDK model `invideo/{model-id}` or REST path `/v1/models/invideo/{model-id}/predictions` | | Sarvam | `https://platform-api.invideo.io/sarvam` | `api-subscription-key: $INVIDEO_API_KEY` | Body `model` | | Deepgram | `https://platform-api.invideo.io/deepgram` | `Authorization: Token $INVIDEO_API_KEY` | Query parameter `model` | --- # LLM provider formats > Switch chat and text generation code to a Platform endpoint. ## Use your existing provider code Keep your chat protocol and replace the provider credentials with a Platform API key. Use an enabled Platform text model ID from [Models](/models). Set your client’s base URL to the value below. Keep your request options and select your model in the field shown. [Chat format details](/docs/chat/formats) | Format | Platform base URL | Authentication | Model ID goes in | | --- | --- | --- | --- | | OpenAI Chat | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | OpenAI Responses | `https://platform-api.invideo.io/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Anthropic Messages | `https://platform-api.invideo.io` | `x-api-key: $INVIDEO_API_KEY` | Body `model` | | Gemini | `https://platform-api.invideo.io` | `x-goog-api-key: $INVIDEO_API_KEY` | SDK `model` argument or REST path `/v1beta/models/{model-id}:…` | | xAI | `https://platform-api.invideo.io/xai/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | DeepSeek | `https://platform-api.invideo.io/deepseek/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Moonshot AI | `https://platform-api.invideo.io/moonshot/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Z.ai | `https://platform-api.invideo.io/z-ai/api/paas/v4` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | OpenRouter | `https://platform-api.invideo.io/openrouter/api/v1` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | BytePlus | `https://platform-api.invideo.io/byteplus/api/v3` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | Perplexity | `https://platform-api.invideo.io/perplexity` | `Authorization: Bearer $INVIDEO_API_KEY` | Body `model` | | MiniMax | `https://platform-api.invideo.io/minimax/anthropic/v1` | `x-api-key: $INVIDEO_API_KEY` | Body `model` | --- # Generate and edit images > Submit image jobs, supply reference images and sizes, and track their results and cost. ## Submit an image job Choose an image model and mode from [Models](/models#models-image). Send your Platform API key and the model's input to `POST /v1/request`. ```bash curl https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: fox-thumbnail-1" \ -d '{ "model": "nano-banana-2-1", "mode": "generate", "input": {"prompt": "A red fox crossing fresh snow at sunrise"} }' ``` Save the returned `id`. Poll `GET /v1/request/{id}` with the same workspace key every 2–5 seconds until `status` is `succeeded` or `failed`. On success, download the files from `output.files[].url`. Each URL is valid for one hour. Read the request again for fresh links. [Requests](/docs/requests) Keep your provider client’s request and response format by using the matching Platform endpoint. [Image provider formats](/docs/sdks/image) ## Inputs Use `GET /v1/models/{id}` or the model's page to find its input field names, defaults, and allowed values. Put model inputs inside `input` when using `POST /v1/request`. Depending on the model, inputs can include a prompt, aspect ratio, seed, quality, or output count. Use the mode listed for the operation you want, such as generation, editing, or upscaling. [Catalog](/docs/catalog) ## Edit and reference images Choose a model that supports the operation and add your source image to the field in its schema. Use an HTTPS URL the API can fetch or a base64 data URI with the image's MIME type. A `file` field takes one string. A `files` field takes an array of strings. For a model with an `image_url` input, an edit might send `"input": {"image_url": "https://example.com/photo.png", "prompt": "Replace the background with pale blue"}`. Use the exact field names from your model for multiple references, a separate style reference, or a mask. [Files](/docs/files) ## Sizes Set the aspect ratio or size from the model's allowed values. When the schema exposes both `aspect_ratio` and `resolution`, select both to control the shape and detail. Edit and upscale inputs can have their own pixel bounds and aspect ratio limits. Read the actual dimensions in `output.files[].width` and `output.files[].height` after the run. [Models](/models#models-image) ## Pricing The [Pricing page](/pricing) lists each model’s billed units and option-specific rates. Each model page shows the same rate table. Check the model's USD rate in the catalog or Playground. Price can vary with options such as resolution or quality and with how many images are generated. The Platform reserves an estimate when you submit and charges the actual price when the run succeeds. Failed runs are free. The terminal invideo API request includes `cost_usd`. Provider-format endpoints report the customer charge in their native response and the `x-invideo-cost-usd` header once the charge is final. [Billing](/docs/billing) ## Errors | What you see | What to do | | --- | --- | | `422 invalid_input` or a provider field error | Check the named input against the model's schema. | | `402 insufficient_balance` | Add funds or wait for active requests to release their holds. | | `429` | Honor `Retry-After` for a rate limit. Check the workspace's Limits page for a spend limit. | | `status: "failed"` | Read the request's `error` and check `retryable` before starting another run. | Reuse the same `Idempotency-Key` and body after a network error or an uncertain submit. [Errors](/docs/errors) ## Limits A JSON request body can be up to 64 MB, including any data URIs. Use HTTPS URLs for larger inputs within the model's file limits. Check your model for supported file types, byte and pixel limits, and maximum reference count. Workspace request and spend limits apply across its API keys and Playground. [Limits](/docs/limits) --- # Test your integration > Try successful requests, errors, and slow replies with free test models. Use the test models to see how your app handles success, errors, and interruptions before you use a paid model. Ask Platform support to enable them for your workspace. Use your usual Platform API key. Every test-model request costs $0. | Model | What it returns | | --- | --- | | `test-chat` | A text reply | | `test-image` | A PNG image | | `test-video` | An MP4 video | | `test-audio` | An MP3 audio file | ## Choose what the test model does Use `test_scenario` to tell the model what to do. Leave it out for a successful request. The JSON text you send for the scenario can be up to 1,024 bytes. For chat, that includes the outer `{"test_scenario": ...}` wrapper. | Field | What it does | | --- | --- | | `outcome` | Choose how the request ends. `ok` succeeds and is the default. `provider_400` acts like a rejected request, `provider_429` like a rate limit, and `provider_503` like a service outage. `timeout` makes the call wait until it times out, `malformed` sends a broken response, and `disconnect` closes the connection. For example, use `"outcome": "provider_429"` to test your rate-limit handling. | | `attempts` | List one to four outcomes in order, in place of `outcome`. For example, `["provider_503", "provider_429", "ok"]` gives the first try a service error, the second a rate limit, and the third a success. If there are more tries, the last outcome repeats. Your usual retry rules still apply. | | `stage` | For image, video, and audio, choose when the outcome and first reply delay apply. Use `submit` to start the job (the default), `status` to check progress, or `download` to fetch the file. For example, use `"stage": "download"` to test a failed download. | | `first_byte_ms` | Wait before the reply starts. Use 0 to 10,000 milliseconds. For example, `"first_byte_ms": 1500` waits a second and a half. | | `chunk_gap_ms` | For streamed chat replies, wait between pieces of text. Use 0 to 10,000 milliseconds. For example, `"chunk_gap_ms": 250` waits a quarter of a second between pieces. | | `output` | Choose the result size. For image, video, and audio, use `"output": "small"` (the default) or `"output": "large"`. For chat, `"output": {"chunks": 4, "text_bytes": 200}` streams 200 bytes in four pieces. Use 1 to 32 pieces (default 4). The byte count must be at least the number of pieces and at most 8,192. | | `after_chunks` | For a chat stream that disconnects, choose how many pieces arrive first. Use a whole number from 0 up to one fewer than `output.chunks`. For example, `"after_chunks": 3` with four pieces drops the connection after the third. | You get the same kind of error, streamed event, or job status your chosen API format uses for other models. Check the final status and $0 charge with the [Requests API](/docs/requests). ## Chat Use `test-chat` with any [chat format](/docs/sdks/llm). Put the scenario in the system message or instructions as JSON text, wrapped in a `test_scenario` object. | Format | Where to put the JSON text | | --- | --- | | OpenAI Chat Completions and compatible formats | `messages[].content` on a message with `role: "system"` | | OpenAI Responses | `instructions` | | Anthropic Messages and MiniMax Messages | `system` | | Gemini | `systemInstruction.parts[].text` | ### Example: Drop a chat stream after three pieces This request sends three pieces of the reply and then closes the connection before the fourth. ```bash curl -N https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "model": "test-chat", "stream": true, "messages": [ { "role": "system", "content": "{\"test_scenario\":{\"outcome\":\"disconnect\",\"output\":{\"chunks\":4,\"text_bytes\":32},\"after_chunks\":3}}" }, {"role": "user", "content": "Hello"} ] } JSON ``` ## Image, video, and audio Send the request to `POST /v1/request`. Set `mode` to `generate` for `test-image` or `test-video`, and `speech` for `test-audio`. Put the scenario JSON string in `input.test_scenario`. If you use a [provider format](/docs/sdks), pass `test_scenario` as a model input where that format accepts extra inputs. ### Example: Fail an image job at download This request starts an image job. The failure happens when Platform tries to fetch the finished file. Take the request ID from the first response and [check the job status](/docs/requests). ```bash curl https://platform-api.invideo.io/v1/request \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary @- <<'JSON' { "model": "test-image", "mode": "generate", "input": { "prompt": "A red square", "test_scenario": "{\"stage\":\"download\",\"outcome\":\"provider_400\"}" } } JSON ``` --- # Workspaces and members > Workspaces hold keys, limits and usage; invite your team with roles. A **workspace** holds API keys, the models that are on, limits, requests and spend. Everything in the API happens in the workspace of the key. ## Members and roles Invite people from the console, under [Members](/manage/members). Each member has a role in the workspace: | Role | Can | | --- | --- | | Owner | Everything, including members, limits and the workspace itself. | | Admin | Keys, models, limits and members. | | Member | Run models in the playground, use keys, read logs. | | Billing | Spend and prices. | The console's Members page shows exactly what each role may do. ## Usage and logs The console's [Dashboard](/dashboard), [Spend](/analytics/spend) and [Logs](/analytics/logs) show every request of the workspace, with its input, output and cost. Logs are kept 90 days. --- # Security > How API keys are kept safe, their format, and what to do when one leaks. ## API keys - We keep only a SHA-256 hash of a key's secret part. Nobody at invideo can read your key, and a lost key cannot be shown again: make a new one. - A key works only on the API (`platform-api.invideo.io`), never to sign in to the console. - Delete a key in the console and it stops at once. ## Key format Keys have a fixed shape, so scanners can find a leaked one: ```text iv_[0-9A-Za-z]{22}_[0-9A-Za-z]{49} ``` `iv_`, a 22-character id, `_`, a 43-character secret and a 6-character checksum. The checksum lets a scanner tell a real key from random text without asking us. ## If a key leaks Delete it in the console at once, under [API keys](/api-keys), make a new one, and remove the old one from your code and its history. ## Provider keys (BYOK) [Provider keys (BYOK)](/docs/provider-keys) lets you use your own account with supported providers. Check your workspace settings for access. ## Zero data retention For a zero data retention request, Logs and Playground history show status, timing, usage, and cost. They omit prompts, attachments, and results. Download output files before they expire. Zero data retention works in three steps. invideo turns it on for your workspace, then approves each model for it. You then choose which requests use it, and how long output files are kept. To use it on one request, switch it on in the Playground or send `X-Zero-Data-Retention: 1`. To use it on more, go to **Manage > Zero data retention** and choose a policy: - **Off**: only requests that ask for it. - **Models that support it**: every request to a model with zero data retention uses it. Other models run as usual, and new models are covered when they are added. - **Every request**: every request uses it. Requests to models that don’t support it are rejected. On the same page, **Always use ZDR** requires it for chosen models or providers, and **Keep results for** sets how long output files last, from 5 minutes to 24 hours. Select several models to change them together. Only an owner can make the policy less strict. For provider formats, send `X-Zero-Data-Retention: 1`. To set a result window in seconds, send `X-ZDR-Retention-Seconds` as well. Workspace rules apply even when you omit the opt-in header. The following formats support ZDR for eligible models: - **fal** for ZDR-enabled fal models, such as Z-Image Turbo V2. - **ElevenLabs** for supported transcription, text-to-speech, dialogue, speech-to-speech, and sound effects models. - **Deepgram** for Nova-3 transcription. - **OpenAI Audio** for supported ElevenLabs or Deepgram models that accept the equivalent OpenAI Audio request. Check the format menu with zero data retention on to see the formats available for your model. ## Report a problem Found a security problem? Write to security@invideo.io. --- # Service accounts > Give each app or team its own keys, models and limits inside one workspace. A **service account** is a named caller inside a workspace: your production backend, a CI job, an agent. It has no email and no sign-in. It owns API keys, and it can have its own model list and limits, which apply on top of the workspace's. Use one when a workspace runs more than one app or team and you want to: - stop one app (a leaked key, a runaway job) without stopping the others; - cap what one app can spend each day or month; - keep an app to the models it needs; - see what each app costs. Keys that belong to no service account keep working exactly as before. They act as the whole workspace. ## Create one Owners and admins create service accounts in the console under [Service accounts](/manage/service-accounts), then create keys inside them. A key belongs to one service account for its whole life: to move an app, create a new key and delete the old one. ## What a service account changes | | Workspace key | Service account key | | --- | --- | --- | | Models | the workspace's | the workspace's, less any the account turned off | | Limits | the workspace's | the workspace's **and** the account's: the lower one wins | | Spend limits | the workspace's | the workspace's **and** the account's | | Reading requests, logs and the balance | the whole workspace | the whole workspace | A service account can only narrow what its workspace allows. It never gives a key more. The API is the same for both kinds of key; nothing in your requests changes. ## At a limit A request over a service account's limit fails the same way as one over the workspace's, and says which it was: ```json { "error": "spend_limit_exceeded", "message": "This service account's daily spend limit of $5 is used up. It resets at 2026-12-01T00:00:00Z; raise it in the console (Limits) to run sooner.", "scope": "service_account", "period": "day" } ``` See [Limits](/docs/limits) for the other limits. ## Archive, or turn off - **Archive** a service account in the console when you are done with it. Its keys stop working at once; requests already running finish. Restore it to use the keys again. - If invideo turns a service account off, its keys stop and only invideo can turn it on again. `GET /v1/balance` shows the budgets of the key's service account next to the workspace's. --- # Models Every model on invideo Platform, with its id, its maker and its unit rates. Each model's page has its inputs and every price. As JSON: `GET https://platform-api.invideo.io/v1/catalog` (no key needed). ## Video | Model | ID | Made by | Resolution | Length | Unit rates | | --- | --- | --- | --- | --- | --- | | [Gemini Omni Flash 1.2](https://platform.invideo.io/models/gemini-omni-flash-12-preview.md) | `gemini-omni-flash-12-preview` | Google | 360p – 4k | 3s – 15s | Frames · Resolution: 360p: $0.023172 / second · Frames · Resolution: 720p: $0.069504 / second · Frames · Resolution: 1080p: $0.104256 / second · Frames · Resolution: 4k: $0.208512 / second | | [Gemini Omni Flash 1.2](https://platform.invideo.io/models/gemini-omni-flash-12-preview-reference.md) | `gemini-omni-flash-12-preview-reference` | Google | 360p – 4k | 3s – 10s | Reference · Resolution: 360p: $0.023172 / second · Reference · Resolution: 720p: $0.069504 / second · Reference · Resolution: 1080p: $0.104256 / second · Reference · Resolution: 4k: $0.208512 / second | | [Gemini Omni Flash 1.2](https://platform.invideo.io/models/gemini-omni-flash-12-preview-extend.md) | `gemini-omni-flash-12-preview-extend` | Google | 360p – 4k | 3s – 10s | Extend · Resolution: 360p: $0.023172 / second · Extend · Resolution: 720p: $0.069504 / second · Extend · Resolution: 1080p: $0.104256 / second · Extend · Resolution: 4k: $0.208512 / second | | [Gemini Omni Flash 1.2](https://platform.invideo.io/models/gemini-omni-flash-12-preview-edit.md) | `gemini-omni-flash-12-preview-edit` | Google | 360p – 4k | per second | Edit · Resolution: 360p: $0.023172 / second · Edit · Resolution: 720p: $0.069504 / second · Edit · Resolution: 1080p: $0.104256 / second · Edit · Resolution: 4k: $0.208512 / second | | [Gemini Omni Flash 1.2](https://platform.invideo.io/models/gemini-omni-flash-12-preview-upscale.md) | `gemini-omni-flash-12-preview-upscale` | Google | 360p – 4k | per second | Upscale · Resolution: 360p: $0.02 / second (typical) · Upscale · Resolution: 720p: $0.034752 / second · Upscale · Resolution: 1080p: $0.10 / second (typical) · Upscale · Resolution: 4k: $0.139008 / second | | [Gemini Omni Flash 1.1](https://platform.invideo.io/models/gemini-omni-flash-11-preview.md) | `gemini-omni-flash-11-preview` | Google | 360p – 4k | 3s – 10s | Frames · Resolution: 360p: $0.0337925 / second · Frames · Resolution: 720p: $0.10136 / second · Frames · Resolution: 1080p: $0.15204 / second · Frames · Resolution: 4k: $0.30408 / second | | [Gemini Omni Flash 1.1](https://platform.invideo.io/models/gemini-omni-flash-11-preview-reference.md) | `gemini-omni-flash-11-preview-reference` | Google | 360p – 4k | 3s – 10s | Reference · Resolution: 360p: $0.0337925 / second · Reference · Resolution: 720p: $0.10136 / second · Reference · Resolution: 1080p: $0.15204 / second · Reference · Resolution: 4k: $0.30408 / second | | [Gemini Omni Flash 1.1](https://platform.invideo.io/models/gemini-omni-flash-11-preview-extend.md) | `gemini-omni-flash-11-preview-extend` | Google | 360p – 4k | 3s – 10s | Extend · Resolution: 360p: $0.0337925 / second · Extend · Resolution: 720p: $0.10136 / second · Extend · Resolution: 1080p: $0.15204 / second · Extend · Resolution: 4k: $0.30408 / second | | [Veo 3.1 Lite](https://platform.invideo.io/models/veo-3-1-lite.md) | `veo-3-1-lite` | Google | 720p – 1080p | 4s – 8s | Frames · No audio · Resolution: 720p: $0.03 / second · Frames · No audio · Resolution: 1080p: $0.05 / second · Frames · Audio · Resolution: 720p: $0.05 / second · Frames · Audio · Resolution: 1080p: $0.08 / second | | [Veo 3.1](https://platform.invideo.io/models/veo-3-1.md) | `veo-3-1` | Google | 720p – 4k | 4s – 8s | Frames · Audio · Resolution: 720p: $0.40 / second · Frames · Audio · Resolution: 1080p: $0.40 / second · Frames · Audio · Resolution: 4k: $0.60 / second · Frames · No audio · Resolution: 720p: $0.20 / second · Frames · No audio · Resolution: 1080p: $0.20 / second · Frames · No audio · Resolution: 4k: $0.40 / second | | [Veo 3.1](https://platform.invideo.io/models/veo-3-1-ingredients.md) | `veo-3-1-ingredients` | Google | 720p – 4k | 8s | Ingredients · Audio · Resolution: 720p: $0.40 / second · Ingredients · Audio · Resolution: 1080p: $0.40 / second · Ingredients · Audio · Resolution: 4k: $0.60 / second · Ingredients · No audio · Resolution: 720p: $0.20 / second · Ingredients · No audio · Resolution: 1080p: $0.20 / second · Ingredients · No audio · Resolution: 4k: $0.40 / second | | [Veo 3.1 Fast](https://platform.invideo.io/models/veo-3-1-fast.md) | `veo-3-1-fast` | Google | 720p – 4k | 4s – 8s | Frames · Audio · Resolution: 720p: $0.10 / second · Frames · Audio · Resolution: 1080p: $0.12 / second · Frames · Audio · Resolution: 4k: $0.30 / second · Frames · No audio · Resolution: 720p: $0.08 / second · Frames · No audio · Resolution: 1080p: $0.10 / second · Frames · No audio · Resolution: 4k: $0.25 / second | | [Veo 3.1 Fast](https://platform.invideo.io/models/veo-3-1-fast-ingredients.md) | `veo-3-1-fast-ingredients` | Google | 720p – 4k | 8s | Ingredients · Audio · Resolution: 720p: $0.10 / second · Ingredients · Audio · Resolution: 1080p: $0.12 / second · Ingredients · Audio · Resolution: 4k: $0.30 / second · Ingredients · No audio · Resolution: 720p: $0.08 / second · Ingredients · No audio · Resolution: 1080p: $0.10 / second · Ingredients · No audio · Resolution: 4k: $0.25 / second | | [Veo 3](https://platform.invideo.io/models/veo-3.md) | `veo-3` | Google | 720p – 1080p | 4s – 8s | Generate · Generate audio: $0.40 / second · Generate · No generate audio: $0.20 / second | | [Veo 3 Fast](https://platform.invideo.io/models/veo-3-fast.md) | `veo-3-fast` | Google | 720p – 1080p | 4s – 8s | Generate · Generate audio: $0.207252375 / second · Generate · No generate audio: $0.13816825 / second | ## Image | Model | ID | Made by | Resolution | Length | Unit rates | | --- | --- | --- | --- | --- | --- | | [Nano Banana 2.1](https://platform.invideo.io/models/nano-banana-2-1.md) | `nano-banana-2-1` | Google | 1k – 4k | — | Generate · Resolution: 1K: $0.0336 / image · Generate · Resolution: 2K: $0.0504 / image · Generate · Resolution: 4K: $0.1134 / image · Generate · Input tokens: $0.0018 / request (typical) | | [Nano Banana Lite](https://platform.invideo.io/models/nanobanana-lite.md) | `nanobanana-lite` | Google | — | — | Generate: $0.0336 / image · Generate · Input tokens: $0.0003 / request (typical) | | [Nano Banana 2](https://platform.invideo.io/models/nanobanana-2.md) | `nanobanana-2` | Google | 1k – 4k | — | Generate · Resolution: 1K · Thinking: minimal: $0.0672 / image · Generate · Resolution: 1K · Thinking: high: $0.0672 / image · Generate · Resolution: 2K · Thinking: minimal: $0.1008 / image · Generate · Resolution: 2K · Thinking: high: $0.1008 / image · Generate · Resolution: 4K · Thinking: minimal: $0.1512 / image · Generate · Resolution: 4K · Thinking: high: $0.1512 / image · Generate · Web search: $0.036 / request · Generate · Image search: $0.036 / request | | [Nano Banana Pro](https://platform.invideo.io/models/nano-banana-pro.md) | `nano-banana-pro` | Google | 1k – 4k | per image | Generate · Resolution: 1K: $0.1344 / image · Generate · Resolution: 2K: $0.1344 / image · Generate · Resolution: 4K: $0.24 / image | | [Nano Banana 2](https://platform.invideo.io/models/nano-banana-2.md) | `nano-banana-2` | Google | — | per image | Ingredients: $0.0672 / image | | [Nano Banana](https://platform.invideo.io/models/nano-banana.md) | `nano-banana` | Google | — | — | Generate: $0.0387 / image · Generate · Input tokens: $0.00036 / request (typical) | ## Audio | Model | ID | Made by | Resolution | Length | Unit rates | | --- | --- | --- | --- | --- | --- | | [Gemini 3.1 Flash TTS](https://platform.invideo.io/models/gemini-3-1-flash-tts.md) | `gemini-3-1-flash-tts` | Google | — | — | Generate: $0.000048 / character (typical) · Generate: $0.0005 / second | | [Google Lyria 3 Clip](https://platform.invideo.io/models/lyria-3-clip.md) | `lyria-3-clip` | Google | — | per request | Generate: $0.04 / request | | [Google Lyria 3 Pro](https://platform.invideo.io/models/lyria-3-pro.md) | `lyria-3-pro` | Google | — | per request | Generate: $0.08 / request | | [Google Lyria-002](https://platform.invideo.io/models/lyria-002.md) | `lyria-002` | Google | — | per second | Generate: $0.002 / second | ## LLM | Model | ID | Made by | Resolution | Length | Unit rates | | --- | --- | --- | --- | --- | --- | | [Gemini 4 Carbon](https://platform.invideo.io/models/gemini-4-carbon.md) | `gemini-4-carbon` | Google | — | per request | Input: $4.00 · Audio input: $4.00 · Cached input: $0.20 · Cached audio input: $0.20 · Output: $20.00 | | [Gemini 4 Hydrogen](https://platform.invideo.io/models/gemini-4-hydrogen.md) | `gemini-4-hydrogen` | Google | — | per request | Input: $1.50 · Audio input: $1.50 · Cached input: $0.075 · Cached audio input: $0.075 · Output: $7.50 | | [Gemini 4 Neon](https://platform.invideo.io/models/gemini-4-neon.md) | `gemini-4-neon` | Google | — | per request | Input: $3.00 · Audio input: $3.00 · Cached input: $0.15 · Cached audio input: $0.15 · Output: $15.00 | | [Gemini 4 Argon](https://platform.invideo.io/models/gemini-4-argon.md) | `gemini-4-argon` | Google | — | per request | Input: $4.00 · Audio input: $4.00 · Cached input: $0.20 · Cached audio input: $0.20 · Output: $20.00 | | [Gemini 3.8 Flash](https://platform.invideo.io/models/gemini-3-8-flash.md) | `gemini-3-8-flash` | Google | — | per request | Input: $0.75 · Audio input: $0.75 · Cached input: $0.075 · Cached audio input: $0.075 · Output: $3.75 | | [Gemini 3.7 Flash](https://platform.invideo.io/models/gemini-3-7-flash.md) | `gemini-3-7-flash` | Google | — | per request | Input: $0.75 · Audio input: $0.75 · Cached input: $0.075 · Cached audio input: $0.075 · Output: $3.75 | | [Gemini 3.5 Flash-Lite](https://platform.invideo.io/models/gemini-3-5-flash-lite.md) | `gemini-3-5-flash-lite` | Google | — | per request | Input: $0.30 · Audio input: $0.30 · Cached input: $0.03 · Cached audio input: $0.03 · Output: $2.50 | | [Gemini 3.5 Flash](https://platform.invideo.io/models/gemini-3-5-flash.md) | `gemini-3-5-flash` | Google | — | per request | Input: $1.50 · Audio input: $1.50 · Cached input: $0.15 · Cached audio input: $0.15 · Output: $9.00 | | [Gemini 3.1 Flash-Lite](https://platform.invideo.io/models/gemini-3-1-flash-lite.md) | `gemini-3-1-flash-lite` | Google | — | per request | Input: $0.25 · Audio input: $0.50 · Cached input: $0.025 · Cached audio input: $0.05 · Output: $1.50 | | [Gemini 3.1 Pro](https://platform.invideo.io/models/gemini-3-1-pro.md) | `gemini-3-1-pro` | Google | — | per request | Input: $2.00 (USD / 1M through 200,000 input tokens) / $4.00 (USD / 1M above 200,000 input tokens) · Audio input: $2.00 (USD / 1M through 200,000 input tokens) / $4.00 (USD / 1M above 200,000 input tokens) · Cached input: $0.20 (USD / 1M through 200,000 input tokens) / $0.40 (USD / 1M above 200,000 input tokens) · Cached audio input: $0.20 (USD / 1M through 200,000 input tokens) / $0.40 (USD / 1M above 200,000 input tokens) · Output: $12.00 (USD / 1M through 200,000 input tokens) / $18.00 (USD / 1M above 200,000 input tokens) | | [Gemini 3.1 Pro Preview](https://platform.invideo.io/models/gemini-3-1-pro-preview.md) | `gemini-3-1-pro-preview` | Google | — | per request | Input: $2.00 (USD / 1M through 200,000 input tokens) / $4.00 (USD / 1M above 200,000 input tokens) · Audio input: $2.00 (USD / 1M through 200,000 input tokens) / $4.00 (USD / 1M above 200,000 input tokens) · Cached input: $0.20 (USD / 1M through 200,000 input tokens) / $0.40 (USD / 1M above 200,000 input tokens) · Cached audio input: $0.20 (USD / 1M through 200,000 input tokens) / $0.40 (USD / 1M above 200,000 input tokens) · Output: $12.00 (USD / 1M through 200,000 input tokens) / $18.00 (USD / 1M above 200,000 input tokens) | | [Gemini 3 Flash Preview](https://platform.invideo.io/models/gemini-3-flash-preview.md) | `gemini-3-flash-preview` | Google | — | per request | Input: $0.50 · Audio input: $1.00 · Cached input: $0.05 · Cached audio input: $0.10 · Output: $4.68 | --- # Gemini 4 Carbon API Model id: `gemini-4-carbon` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-carbon", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-4-carbon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-4-carbon:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-4-carbon:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-4-carbon", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-4-carbon:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-carbon", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-4-carbon", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-4-carbon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-carbon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-carbon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-carbon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $4.00 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $4.00 | | Audio input | $4.00 | | Cached input | $0.20 | | Cached audio input | $0.20 | | Output | $20.00 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-4-carbon` | | Context window | 1,048,576 tokens | | Max output | 32,768 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini 4 Hydrogen API Model id: `gemini-4-hydrogen` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-hydrogen", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-4-hydrogen\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-hydrogen", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-4-hydrogen:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-4-hydrogen:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-4-hydrogen", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-4-hydrogen:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-hydrogen", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-hydrogen", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-hydrogen", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-4-hydrogen", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-4-hydrogen\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-hydrogen", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-hydrogen", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-hydrogen", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-hydrogen", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-hydrogen","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $1.50 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $1.50 | | Audio input | $1.50 | | Cached input | $0.075 | | Cached audio input | $0.075 | | Output | $7.50 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-4-hydrogen` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini 4 Neon API Model id: `gemini-4-neon` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-neon", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-4-neon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-neon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-4-neon:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-4-neon:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-4-neon", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-4-neon:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-neon", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-neon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-neon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-4-neon", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-4-neon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-neon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-neon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-neon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-neon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-neon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $3.00 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $3.00 | | Audio input | $3.00 | | Cached input | $0.15 | | Cached audio input | $0.15 | | Output | $15.00 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-4-neon` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini Omni Flash 1.2 API Model id: `gemini-omni-flash-12-preview` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "mode": "frames", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"mode\":\"frames\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","mode":"frames","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-12-preview` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-12-preview:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-12-preview" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="gemini-omni-flash-12-preview") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-12-preview"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-12-preview' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-12-preview\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-12-preview" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-12-preview/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-12-preview/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-12-preview", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-12-preview", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-12-preview", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-12-preview\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-12-preview","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `first_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | First frame | | `last_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Last frame | | `duration` | number | no | `6` | `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15` | Duration | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `resolution` | string | no | `"720p"` | `"360p"`, `"720p"`, `"1080p"`, `"4k"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-12-preview", "mode": "frames", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.023172 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Frames · Resolution: 360p | $0.023172 / second | | Frames · Resolution: 720p | $0.069504 / second | | Frames · Resolution: 1080p | $0.104256 / second | | Frames · Resolution: 4k | $0.208512 / second | --- # Gemini Omni Flash 1.2 API Model id: `gemini-omni-flash-12-preview-reference` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "mode": "reference", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"mode\":\"reference\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","mode":"reference","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-12-preview-reference` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-reference' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-reference", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-reference", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-12-preview-reference:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-reference:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ], "extra": { "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-reference:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}],\"extra\":{\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-reference:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}],"extra":{"reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "mode": "image-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"mode\":\"image-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","mode":"image-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/image2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/image2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/image2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/image2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/image2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/image-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/image-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/image-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/image-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/image-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-12-preview-reference", "extra": { "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-12-preview-reference","extra":{"reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/image/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/image/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/image/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/image/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-12-preview-reference' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-12-preview-reference\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-12-preview-reference" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-12-preview-reference/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-12-preview-reference/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-12-preview-reference", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png", ], }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-12-preview-reference", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-12-preview-reference", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-12-preview-reference\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-12-preview-reference","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/image_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/image_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "promptImage": "https://platform.invideo.io/share.png", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/image_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"promptImage\":\"https://platform.invideo.io/share.png\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/image_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","promptImage":"https://platform.invideo.io/share.png","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-reference", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-reference\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-reference","prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 5 files; PNG, JPEG or WebP | Reference images | | `reference_video_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 3 files; MP4, MOV or WebM | Reference videos | | `duration` | number | no | `6` | `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` | Duration | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `resolution` | string | no | `"720p"` | `"360p"`, `"720p"`, `"1080p"`, `"4k"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-12-preview-reference", "mode": "reference", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.023172 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Reference · Resolution: 360p | $0.023172 / second | | Reference · Resolution: 720p | $0.069504 / second | | Reference · Resolution: 1080p | $0.104256 / second | | Reference · Resolution: 4k | $0.208512 / second | --- # Gemini Omni Flash 1.2 API Model id: `gemini-omni-flash-12-preview-extend` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "mode": "extend", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"mode\":\"extend\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","mode":"extend","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-12-preview-extend` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-extend' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-extend", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-extend", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-12-preview-extend:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-extend:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ], "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-extend:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}],\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-extend:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}],"extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-12-preview-extend", "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-12-preview-extend","extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-12-preview-extend' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-12-preview-extend\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-12-preview-extend" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-12-preview-extend/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-12-preview-extend/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-12-preview-extend", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-12-preview-extend", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-12-preview-extend", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-12-preview-extend\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-12-preview-extend","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-extend", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-extend\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-extend","prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `extend_video_url` | string (URL or data URI) | yes | - | MP4, MOV or WebM; at most 27.49 seconds | Video to extend | | `duration` | number | no | `6` | `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` | Duration | | `resolution` | string | no | `"720p"` | `"360p"`, `"720p"`, `"1080p"`, `"4k"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-12-preview-extend", "mode": "extend", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.023172 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Extend · Resolution: 360p | $0.023172 / second | | Extend · Resolution: 720p | $0.069504 / second | | Extend · Resolution: 1080p | $0.104256 / second | | Extend · Resolution: 4k | $0.208512 / second | --- # Gemini Omni Flash 1.2 API Model id: `gemini-omni-flash-12-preview-edit` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "mode": "edit", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"mode\":\"edit\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","mode":"edit","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-12-preview-edit` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-edit' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-edit", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-edit", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-12-preview-edit:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-edit:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ], "extra": { "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-edit:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}],\"extra\":{\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-edit:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}],"extra":{"edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-12-preview-edit", "extra": { "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-12-preview-edit","extra":{"edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-12-preview-edit' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-12-preview-edit\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-12-preview-edit" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-12-preview-edit/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-12-preview-edit/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-12-preview-edit", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-12-preview-edit", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-12-preview-edit", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-12-preview-edit\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-12-preview-edit","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "edit_video_url": "https://example.com/video.mp4" } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"edit_video_url\":\"https://example.com/video.mp4\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-edit", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "edit_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-edit\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"edit_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-edit","prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"edit_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `edit_video_url` | string (URL or data URI) | yes | - | MP4, MOV or WebM; at most 15.49 seconds | Video to edit | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 5 files; PNG, JPEG or WebP | Reference images | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-12-preview-edit", "mode": "edit", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.023172 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Edit · Resolution: 360p | $0.023172 / second | | Edit · Resolution: 720p | $0.069504 / second | | Edit · Resolution: 1080p | $0.104256 / second | | Edit · Resolution: 4k | $0.208512 / second | --- # Gemini Omni Flash 1.2 API Model id: `gemini-omni-flash-12-preview-upscale` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "mode": "upscale", "input": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"mode\":\"upscale\",\"input\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","mode":"upscale","input":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "generation_type": "video", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"generation_type\":\"video\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","generation_type":"video","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-12-preview-upscale` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-upscale' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "video_url": "https://example.com/video.mp4" }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-upscale", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "video_url": "https://example.com/video.mp4" }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-12-preview-upscale", headers=headers, json=json.loads("{\"video_url\":\"https://example.com/video.mp4\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-12-preview-upscale:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-upscale:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ {} ], "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-upscale:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{}],\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-12-preview-upscale:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{}],"extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "mode": "text-to-video", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"mode\":\"text-to-video\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","mode":"text-to-video","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-12-preview-upscale' \ --data-binary '{ "input": {}, "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-12-preview-upscale\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-12-preview-upscale" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-12-preview-upscale/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-12-preview-upscale/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "video_url": "https://example.com/video.mp4" } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-12-preview-upscale", input={ "video_url": "https://example.com/video.mp4", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-12-preview-upscale", { input: { "video_url": "https://example.com/video.mp4" } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-12-preview-upscale", "deliveryMethod": "async", "extra": { "video_url": "https://example.com/video.mp4" } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-12-preview-upscale\",\"deliveryMethod\":\"async\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-12-preview-upscale","deliveryMethod":"async","extra":{"video_url":"https://example.com/video.mp4"}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/video_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/video_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "videoUri": "https://example.com/video.mp4" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/video_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"videoUri\":\"https://example.com/video.mp4\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/video_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","videoUri":"https://example.com/video.mp4"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-12-preview-upscale", "extra": { "video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-12-preview-upscale\",\"extra\":{\"video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-12-preview-upscale","extra":{"video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `video_url` | string (URL or data URI) | yes | - | MP4, MOV or WebM; each side at least 360 px; each side at most 1920 px; shorter side 360 or 720 or 1080 px; at most 15.49 seconds | Video | | `target_resolution` | string | no | `"1080p"` | `"720p"`, `"1080p"`, `"4k"` | Target resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-12-preview-upscale", "mode": "upscale", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.034752 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Upscale · Resolution: 360p | $0.02 / second (typical) | | Upscale · Resolution: 720p | $0.034752 / second | | Upscale · Resolution: 1080p | $0.10 / second (typical) | | Upscale · Resolution: 4k | $0.139008 / second | --- # Gemini 4 Argon API Model id: `gemini-4-argon` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-argon", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-4-argon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-argon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-4-argon:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-4-argon:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-4-argon", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-4-argon:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-4-argon", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-argon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-argon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-4-argon", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-4-argon\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-argon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-argon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-4-argon", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-4-argon", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-4-argon","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $4.00 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $4.00 | | Audio input | $4.00 | | Cached input | $0.20 | | Cached audio input | $0.20 | | Output | $20.00 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-4-argon` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Nano Banana 2.1 API Model id: `nano-banana-2-1` · Google · Image ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "mode": "generate", "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","mode":"generate","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Black Forest Labs Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bfl/v1/nano-banana-2-1` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bfl/v1/nano-banana-2-1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bfl/v1/nano-banana-2-1", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bfl/v1/nano-banana-2-1", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "Ready", "result": { "sample": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/nano-banana-2-1` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/nano-banana-2-1' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/nano-banana-2-1", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/nano-banana-2-1", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/nano-banana-2-1:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/nano-banana-2-1:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "A blue ceramic vase on a plain cream background, soft studio light." } ] } ], "generationConfig": { "responseModalities": [ "IMAGE" ] } }' ``` ### Google GenAI SDK · Python ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="nano-banana-2-1", contents="A blue ceramic vase on a plain cream background, soft studio light.", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) image = response.candidates[0].content.parts[0].inline_data.data ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/nano-banana-2-1:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Ideogram Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ideogram/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ideogram/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model_name":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "image": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Magnific Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result. `data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nano-banana-2-1", prompt="A blue ceramic vase on a plain cream background, soft studio light.") print(result.data[0].b64_json[:60]) ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const result = await client.images.generate({ model: "nano-banana-2-1", prompt: "A blue ceramic vase on a plain cream background, soft studio light." }); console.log(result.data[0].b64_json.slice(0, 60)); ``` the image as `b64_json` in `data[0]`, when the run ends. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Phota Labs Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "async": true, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a job ID for polling. The completed job contains `result.download_urls`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: nano-banana-2-1' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nano-banana-2-1\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "nano-banana-2-1" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Recraft Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/nano-banana-2-1/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nano-banana-2-1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nano-banana-2-1", input={ "prompt": "A blue ceramic vase on a plain cream background, soft studio light.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/nano-banana-2-1", { input: { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Reve Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /reve/v1/image/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "imageInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "nano-banana-2-1", "deliveryMethod": "async", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nano-banana-2-1\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nano-banana-2-1","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'X-Runway-Version: 2024-11-06' \ --data-binary '{ "model": "nano-banana-2-1", "ratio": "1280:720", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_image", cast_to=httpx.Response, body=json.loads("{\"model\":\"nano-banana-2-1\",\"ratio\":\"1280:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "X-Runway-Version": "2024-11-06" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","ratio":"1280:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Topaz Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2-1", "extra_body": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-2-1\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2-1","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The image is returned in `data[]`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 30,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 14 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio | | `resolution` | string | no | `"1K"` | `"1K"`, `"2K"`, `"4K"` | Resolution | | `thinking` | string | no | `"medium"` | `"minimal"`, `"medium"`, `"high"` | Thinking | | `output_mime_type` | string | no | `"image/png"` | `"image/png"`, `"image/jpeg"` | Output format | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "nano-banana-2-1", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "image", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "image/png", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": null } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0336 / image. | Mode and options | Unit rate (USD) | | --- | --- | | Generate · Resolution: 1K | $0.0336 / image | | Generate · Resolution: 2K | $0.0504 / image | | Generate · Resolution: 4K | $0.1134 / image | | Generate · Input tokens | $0.0018 / request (typical) | --- # Gemini 3.8 Flash API Model id: `gemini-3-8-flash` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-8-flash", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-8-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-8-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-8-flash:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-8-flash:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-8-flash", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-8-flash:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-8-flash", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-8-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-8-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-8-flash", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-8-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-8-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-8-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-8-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-8-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-8-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $0.75 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $0.75 | | Audio input | $0.75 | | Cached input | $0.075 | | Cached audio input | $0.075 | | Output | $3.75 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-8-flash` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini Omni Flash 1.1 API Model id: `gemini-omni-flash-11-preview` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "mode": "frames", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"mode\":\"frames\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","mode":"frames","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-11-preview` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-11-preview:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-11-preview" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="gemini-omni-flash-11-preview") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-11-preview"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-11-preview' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-11-preview\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-11-preview" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-11-preview/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-11-preview/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-11-preview", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-11-preview", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-11-preview", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-11-preview\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-11-preview","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `first_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | First frame | | `last_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Last frame | | `duration` | number | no | `6` | `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` | Duration | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `resolution` | string | no | `"720p"` | `"360p"`, `"720p"`, `"1080p"`, `"4k"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-11-preview", "mode": "frames", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0337925 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Frames · Resolution: 360p | $0.0337925 / second | | Frames · Resolution: 720p | $0.10136 / second | | Frames · Resolution: 1080p | $0.15204 / second | | Frames · Resolution: 4k | $0.30408 / second | --- # Gemini Omni Flash 1.1 API Model id: `gemini-omni-flash-11-preview-reference` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "mode": "reference", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"mode\":\"reference\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","mode":"reference","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-11-preview-reference` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview-reference' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview-reference", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview-reference", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-11-preview-reference:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview-reference:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ], "extra": { "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview-reference:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}],\"extra\":{\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview-reference:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}],"extra":{"reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "mode": "image-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"mode\":\"image-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","mode":"image-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/image2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/image2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/image2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/image2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/image2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/image-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/image-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/image-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/image-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/image-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-11-preview-reference", "extra": { "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-11-preview-reference","extra":{"reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/image/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/image/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/image/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/image/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-11-preview-reference' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-11-preview-reference\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-11-preview-reference" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-11-preview-reference/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-11-preview-reference/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-11-preview-reference", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png", ], }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-11-preview-reference", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-11-preview-reference", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-11-preview-reference\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-11-preview-reference","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/image_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/image_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "promptImage": "https://platform.invideo.io/share.png", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/image_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"promptImage\":\"https://platform.invideo.io/share.png\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/image_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","promptImage":"https://platform.invideo.io/share.png","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-reference", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "reference_image_urls": [ "https://platform.invideo.io/share.png" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-reference\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"reference_image_urls\":[\"https://platform.invideo.io/share.png\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-reference","prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"reference_image_urls":["https://platform.invideo.io/share.png"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 5 files; PNG, JPEG or WebP | Reference images | | `reference_video_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 3 files; MP4, MOV or WebM | Reference videos | | `duration` | number | no | `6` | `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` | Duration | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `resolution` | string | no | `"720p"` | `"360p"`, `"720p"`, `"1080p"`, `"4k"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-11-preview-reference", "mode": "reference", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0337925 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Reference · Resolution: 360p | $0.0337925 / second | | Reference · Resolution: 720p | $0.10136 / second | | Reference · Resolution: 1080p | $0.15204 / second | | Reference · Resolution: 4k | $0.30408 / second | --- # Gemini Omni Flash 1.1 API Model id: `gemini-omni-flash-11-preview-extend` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "mode": "extend", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"mode\":\"extend\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","mode":"extend","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-omni-flash-11-preview-extend` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview-extend' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview-extend", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-omni-flash-11-preview-extend", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-omni-flash-11-preview-extend:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview-extend:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ], "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview-extend:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}],\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-omni-flash-11-preview-extend:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}],"extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "gemini-omni-flash-11-preview-extend", "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"gemini-omni-flash-11-preview-extend","extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-omni-flash-11-preview-extend' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-omni-flash-11-preview-extend\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-omni-flash-11-preview-extend" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-omni-flash-11-preview-extend/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-omni-flash-11-preview-extend/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-omni-flash-11-preview-extend", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-omni-flash-11-preview-extend", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "gemini-omni-flash-11-preview-extend", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"gemini-omni-flash-11-preview-extend\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"gemini-omni-flash-11-preview-extend","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-omni-flash-11-preview-extend", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "extra": { "extend_video_url": "https://example.com/video.mp4" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"gemini-omni-flash-11-preview-extend\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"extra\":{\"extend_video_url\":\"https://example.com/video.mp4\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"gemini-omni-flash-11-preview-extend","prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","extra":{"extend_video_url":"https://example.com/video.mp4"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `extend_video_url` | string (URL or data URI) | yes | - | MP4, MOV or WebM; at most 27.49 seconds | Video to extend | | `duration` | number | no | `6` | `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10` | Duration | | `resolution` | string | no | `"720p"` | `"360p"`, `"720p"`, `"1080p"`, `"4k"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-omni-flash-11-preview-extend", "mode": "extend", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0337925 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Extend · Resolution: 360p | $0.0337925 / second | | Extend · Resolution: 720p | $0.10136 / second | | Extend · Resolution: 1080p | $0.15204 / second | | Extend · Resolution: 4k | $0.30408 / second | --- # Gemini 3.7 Flash API Model id: `gemini-3-7-flash` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-7-flash", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-7-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-7-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-7-flash:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-7-flash:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-7-flash", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-7-flash:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-7-flash", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-7-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-7-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-7-flash", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-7-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-7-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-7-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-7-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-7-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-7-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $0.75 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $0.75 | | Audio input | $0.75 | | Cached input | $0.075 | | Cached audio input | $0.075 | | Output | $3.75 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-7-flash` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini 3.5 Flash-Lite API Model id: `gemini-3-5-flash-lite` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-5-flash-lite", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-5-flash-lite\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-5-flash-lite:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-5-flash-lite:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-5-flash-lite", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-5-flash-lite:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-5-flash-lite", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-5-flash-lite", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-5-flash-lite\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $0.30 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $0.30 | | Audio input | $0.30 | | Cached input | $0.03 | | Cached audio input | $0.03 | | Output | $2.50 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-5-flash-lite` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini 3.5 Flash API Model id: `gemini-3-5-flash` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-5-flash", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-5-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-5-flash:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-5-flash:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-5-flash", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-5-flash:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-5-flash", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-5-flash", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-5-flash\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-5-flash", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-5-flash", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-5-flash","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $1.50 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $1.50 | | Audio input | $1.50 | | Cached input | $0.15 | | Cached audio input | $0.15 | | Output | $9.00 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-5-flash` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini 3.1 Flash-Lite API Model id: `gemini-3-1-flash-lite` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-1-flash-lite", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-1-flash-lite\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-1-flash-lite:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-1-flash-lite:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-1-flash-lite", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-1-flash-lite:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-1-flash-lite", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-1-flash-lite", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-1-flash-lite\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-flash-lite", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-flash-lite", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-lite","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $0.25 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $0.25 | | Audio input | $0.50 | | Cached input | $0.025 | | Cached audio input | $0.05 | | Output | $1.50 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-1-flash-lite` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Nano Banana Lite API Model id: `nanobanana-lite` · Google · Image ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "mode": "generate", "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","mode":"generate","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Black Forest Labs Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bfl/v1/nanobanana-lite` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bfl/v1/nanobanana-lite' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bfl/v1/nanobanana-lite", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bfl/v1/nanobanana-lite", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "Ready", "result": { "sample": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/nanobanana-lite` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/nanobanana-lite' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/nanobanana-lite", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/nanobanana-lite", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/nanobanana-lite:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/nanobanana-lite:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "A blue ceramic vase on a plain cream background, soft studio light." } ] } ], "generationConfig": { "responseModalities": [ "IMAGE" ] } }' ``` ### Google GenAI SDK · Python ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="nanobanana-lite", contents="A blue ceramic vase on a plain cream background, soft studio light.", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) image = response.candidates[0].content.parts[0].inline_data.data ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/nanobanana-lite:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Ideogram Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ideogram/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ideogram/generate", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model_name":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "image": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Magnific Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result. `data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nanobanana-lite", prompt="A blue ceramic vase on a plain cream background, soft studio light.") print(result.data[0].b64_json[:60]) ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const result = await client.images.generate({ model: "nanobanana-lite", prompt: "A blue ceramic vase on a plain cream background, soft studio light." }); console.log(result.data[0].b64_json.slice(0, 60)); ``` the image as `b64_json` in `data[0]`, when the run ends. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Phota Labs Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "async": true, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a job ID for polling. The completed job contains `result.download_urls`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: nanobanana-lite' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nanobanana-lite\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "nanobanana-lite" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Recraft Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/nanobanana-lite/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nanobanana-lite/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nanobanana-lite", input={ "prompt": "A blue ceramic vase on a plain cream background, soft studio light.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/nanobanana-lite", { input: { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Reve Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /reve/v1/image/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "imageInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "nanobanana-lite", "deliveryMethod": "async", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nanobanana-lite\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nanobanana-lite","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'X-Runway-Version: 2024-11-06' \ --data-binary '{ "model": "nanobanana-lite", "ratio": "1280:720", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_image", cast_to=httpx.Response, body=json.loads("{\"model\":\"nanobanana-lite\",\"ratio\":\"1280:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "X-Runway-Version": "2024-11-06" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","ratio":"1280:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Topaz Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-lite", "extra_body": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-lite\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-lite","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The image is returned in `data[]`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 30,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 14 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio | | `thinking` | string | no | `"minimal"` | `"minimal"`, `"high"` | Thinking | | `output_mime_type` | string | no | `"image/png"` | `"image/png"`, `"image/jpeg"` | Output format | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "nanobanana-lite", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "image", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "image/png", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": null } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0336 / image. | Mode and options | Unit rate (USD) | | --- | --- | | Generate | $0.0336 / image | | Generate · Input tokens | $0.0003 / request (typical) | --- # Veo 3.1 Lite API Model id: `veo-3-1-lite` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "mode": "frames", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"mode\":\"frames\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","mode":"frames","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3-1-lite` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3-1-lite' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3-1-lite", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3-1-lite", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3-1-lite:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3-1-lite:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3-1-lite:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3-1-lite:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3-1-lite" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3-1-lite") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3-1-lite"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3-1-lite' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3-1-lite\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3-1-lite" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3-1-lite/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3-1-lite/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3-1-lite", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3-1-lite", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3-1-lite", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3-1-lite\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3-1-lite","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3-1-lite\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-lite", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-lite\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-lite","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `first_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | First frame | | `last_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Last frame | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `duration` | number | no | `8` | `4`, `6`, `8` | Duration | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Generate audio | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3-1-lite", "mode": "frames", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.03 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Frames · No audio · Resolution: 720p | $0.03 / second | | Frames · No audio · Resolution: 1080p | $0.05 / second | | Frames · Audio · Resolution: 720p | $0.05 / second | | Frames · Audio · Resolution: 1080p | $0.08 / second | --- # Gemini 3.1 Flash TTS API Model id: `gemini-3-1-flash-tts` · Google · Audio ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "mode": "generate", "input": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"mode\":\"generate\",\"input\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","mode":"generate","input":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v1/dub` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v1/dub' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v1/dub", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v1/dub", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/tts/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/tts/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/tts/create", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/tts/create", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cartesia Set the base URL to `https://platform-api.invideo.io/cartesia`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cartesia/tts/bytes` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cartesia/tts/bytes' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_id": "gemini-3-1-flash-tts", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### Cartesia SDK · Python ```python import json import os from pathlib import Path import httpx from cartesia import Cartesia client = Cartesia(base_url="https://platform-api.invideo.io/cartesia", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/tts/bytes", cast_to=httpx.Response, body=json.loads("{\"model_id\":\"gemini-3-1-flash-tts\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cartesia/tts/bytes", { method: "POST", headers, body: JSON.stringify({"model_id":"gemini-3-1-flash-tts","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## ElevenLabs Set the base URL to `https://platform-api.invideo.io/elevenlabs`. Use `xi-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /elevenlabs/v1/text-to-speech/Zephyr` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/elevenlabs/v1/text-to-speech/Zephyr' \ -H "xi-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "text": "The afternoon light is soft and warm.", "model_id": "gemini-3-1-flash-tts" }' ``` ### ElevenLabs SDK · Python ```python import os from elevenlabs.client import ElevenLabs client = ElevenLabs(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/elevenlabs") audio = client.text_to_speech.convert("Zephyr", text="The afternoon light is soft and warm.", model_id="gemini-3-1-flash-tts") open("speech.mp3", "wb").write(b"".join(audio)) ``` ### ElevenLabs SDK · JavaScript ```js import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js"; const client = new ElevenLabsClient({ apiKey: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/elevenlabs" }); const audio = await client.textToSpeech.convert("Zephyr", { text: "The afternoon light is soft and warm.", modelId: "gemini-3-1-flash-tts" }); ``` the audio bytes, when the run ends. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/gemini-3-1-flash-tts` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/gemini-3-1-flash-tts' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/gemini-3-1-flash-tts", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/gemini-3-1-flash-tts", headers=headers, json=json.loads("{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Fish Audio Set the base URL to `https://platform-api.invideo.io/fishaudio`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /fishaudio/v1/tts` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fishaudio/v1/tts' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: gemini-3-1-flash-tts' \ --data-binary '{ "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"gemini-3-1-flash-tts\"}").items()} response = requests.post("https://platform-api.invideo.io/fishaudio/v1/tts", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "gemini-3-1-flash-tts" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/fishaudio/v1/tts", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-1-flash-tts:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/gemini-3-1-flash-tts:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "The afternoon light is soft and warm." } ] } ], "generationConfig": { "responseModalities": [ "AUDIO" ] }, "extra": { "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/gemini-3-1-flash-tts:generateContent", headers=headers, json=json.loads("{\"contents\":[{\"parts\":[{\"text\":\"The afternoon light is soft and warm.\"}]}],\"generationConfig\":{\"responseModalities\":[\"AUDIO\"]},\"extra\":{\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-1-flash-tts:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"The afternoon light is soft and warm."}]}],"generationConfig":{"responseModalities":["AUDIO"]},"extra":{"voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` The audio bytes are in `candidates[0].content.parts[0].inlineData`. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/music_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/music_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "output_format": "url", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/music_generation", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"output_format\":\"url\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/music_generation", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","output_format":"url","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `extra_info.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "extra_info": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Mureka Set the base URL to `https://platform-api.invideo.io/mureka`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /mureka/v1/song/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/mureka/v1/song/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/mureka/v1/song/generate", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/mureka/v1/song/generate", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /mureka/v1/song/query/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/audio/speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/audio/speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "voice": "Zephyr", "input": "The afternoon light is soft and warm." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") speech = client.audio.speech.create(model="gemini-3-1-flash-tts", voice="Zephyr", input="The afternoon light is soft and warm.") speech.write_to_file("speech.mp3") ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; import { writeFile } from "node:fs/promises"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const speech = await client.audio.speech.create({ model: "gemini-3-1-flash-tts", voice: "Zephyr", input: "The afternoon light is soft and warm." }); await writeFile("speech.mp3", Buffer.from(await speech.arrayBuffer())); ``` the audio bytes, when the run ends (the `Content-Type` header says the format). The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/gemini-3-1-flash-tts/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/gemini-3-1-flash-tts/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/gemini-3-1-flash-tts", input={ "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/gemini-3-1-flash-tts", { input: { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Sarvam Set the base URL to `https://platform-api.invideo.io/sarvam`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /sarvam/text-to-speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/sarvam/text-to-speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "gemini-3-1-flash-tts", "extra": { "prompt": "The afternoon light is soft and warm.", "voice_1": "Zephyr" } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/sarvam/text-to-speech", headers=headers, json=json.loads("{\"model\":\"gemini-3-1-flash-tts\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\",\"voice_1\":\"Zephyr\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/sarvam/text-to-speech", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-flash-tts","extra":{"prompt":"The afternoon light is soft and warm.","voice_1":"Zephyr"}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The `audios[]` list contains base64-encoded audio. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 50,000 characters | Prompt | | `voice_1` | string | yes | - | `"Zephyr"`, `"Puck"`, `"Charon"`, `"Kore"`, `"Fenrir"`, `"Leda"`, `"Orus"`, `"Aoede"`, `"Callirrhoe"`, `"Autonoe"`, `"Enceladus"`, `"Iapetus"`, `"Umbriel"`, `"Algieba"`, `"Despina"`, `"Erinome"`, `"Algenib"`, `"Rasalgethi"`, `"Laomedeia"`, `"Achernar"`, `"Alnilam"`, `"Schedar"`, `"Gacrux"`, `"Pulcherrima"`, `"Achird"`, `"Zubenelgenubi"`, `"Vindemiatrix"`, `"Sadachbia"`, `"Sadaltager"`, `"Sulafat"` | Voice | | `speaker_1` | string | no | - | up to 100 characters | Speaker name | | `voice_2` | string | no | - | `"Zephyr"`, `"Puck"`, `"Charon"`, `"Kore"`, `"Fenrir"`, `"Leda"`, `"Orus"`, `"Aoede"`, `"Callirrhoe"`, `"Autonoe"`, `"Enceladus"`, `"Iapetus"`, `"Umbriel"`, `"Algieba"`, `"Despina"`, `"Erinome"`, `"Algenib"`, `"Rasalgethi"`, `"Laomedeia"`, `"Achernar"`, `"Alnilam"`, `"Schedar"`, `"Gacrux"`, `"Pulcherrima"`, `"Achird"`, `"Zubenelgenubi"`, `"Vindemiatrix"`, `"Sadachbia"`, `"Sadaltager"`, `"Sulafat"` | Second voice | | `speaker_2` | string | no | - | up to 100 characters | Second speaker name | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "gemini-3-1-flash-tts", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "audio", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "audio/mpeg", "size_bytes": 1048576, "width": null, "height": null, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0005 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Generate | $0.000048 / character (typical) | | Generate | $0.0005 / second | --- # Google Lyria 3 Clip API Model id: `lyria-3-clip` · Google · Audio ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "mode": "generate", "input": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"mode\":\"generate\",\"input\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","mode":"generate","input":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v1/dub` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v1/dub' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v1/dub", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v1/dub", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/tts/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/tts/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/tts/create", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/tts/create", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cartesia Set the base URL to `https://platform-api.invideo.io/cartesia`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cartesia/tts/bytes` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cartesia/tts/bytes' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_id": "lyria-3-clip", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### Cartesia SDK · Python ```python import json import os from pathlib import Path import httpx from cartesia import Cartesia client = Cartesia(base_url="https://platform-api.invideo.io/cartesia", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/tts/bytes", cast_to=httpx.Response, body=json.loads("{\"model_id\":\"lyria-3-clip\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cartesia/tts/bytes", { method: "POST", headers, body: JSON.stringify({"model_id":"lyria-3-clip","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## ElevenLabs Set the base URL to `https://platform-api.invideo.io/elevenlabs`. Use `xi-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /elevenlabs/v1/sound-generation` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/elevenlabs/v1/sound-generation' \ -H "xi-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "text": "The afternoon light is soft and warm.", "model_id": "lyria-3-clip" }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"xi-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/elevenlabs/v1/sound-generation", headers=headers, json=json.loads("{\"text\":\"The afternoon light is soft and warm.\",\"model_id\":\"lyria-3-clip\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "xi-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/elevenlabs/v1/sound-generation", { method: "POST", headers, body: JSON.stringify({"text":"The afternoon light is soft and warm.","model_id":"lyria-3-clip"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` the audio bytes, when the run ends. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/lyria-3-clip` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/lyria-3-clip' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "The afternoon light is soft and warm." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/lyria-3-clip", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "The afternoon light is soft and warm." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/lyria-3-clip", headers=headers, json=json.loads("{\"prompt\":\"The afternoon light is soft and warm.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Fish Audio Set the base URL to `https://platform-api.invideo.io/fishaudio`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /fishaudio/v1/tts` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fishaudio/v1/tts' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: lyria-3-clip' \ --data-binary '{ "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"lyria-3-clip\"}").items()} response = requests.post("https://platform-api.invideo.io/fishaudio/v1/tts", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "lyria-3-clip" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/fishaudio/v1/tts", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/lyria-3-clip:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/lyria-3-clip:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "The afternoon light is soft and warm." } ] } ], "generationConfig": { "responseModalities": [ "AUDIO" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/lyria-3-clip:generateContent", headers=headers, json=json.loads("{\"contents\":[{\"parts\":[{\"text\":\"The afternoon light is soft and warm.\"}]}],\"generationConfig\":{\"responseModalities\":[\"AUDIO\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/lyria-3-clip:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"The afternoon light is soft and warm."}]}],"generationConfig":{"responseModalities":["AUDIO"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` The audio bytes are in `candidates[0].content.parts[0].inlineData`. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/music_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/music_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "output_format": "url", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/music_generation", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"output_format\":\"url\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/music_generation", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","output_format":"url","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `extra_info.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "extra_info": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Mureka Set the base URL to `https://platform-api.invideo.io/mureka`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /mureka/v1/song/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/mureka/v1/song/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/mureka/v1/song/generate", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/mureka/v1/song/generate", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /mureka/v1/song/query/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/audio/speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/audio/speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "input": "The afternoon light is soft and warm." }' ``` ### OpenAI SDK · Python ```python import json import os from pathlib import Path import httpx2 from openai import OpenAI client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/audio/speech", cast_to=httpx2.Response, body=json.loads("{\"model\":\"lyria-3-clip\",\"input\":\"The afternoon light is soft and warm.\"}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/audio/speech", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","input":"The afternoon light is soft and warm."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` the audio bytes, when the run ends (the `Content-Type` header says the format). The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/lyria-3-clip/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/lyria-3-clip/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "The afternoon light is soft and warm." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/lyria-3-clip", input={ "prompt": "The afternoon light is soft and warm.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/lyria-3-clip", { input: { "prompt": "The afternoon light is soft and warm." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Sarvam Set the base URL to `https://platform-api.invideo.io/sarvam`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /sarvam/text-to-speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/sarvam/text-to-speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-clip", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/sarvam/text-to-speech", headers=headers, json=json.loads("{\"model\":\"lyria-3-clip\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/sarvam/text-to-speech", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-clip","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The `audios[]` list contains base64-encoded audio. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 10 files; PNG, JPEG or WebP | Reference images | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "lyria-3-clip", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "audio", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "audio/mpeg", "size_bytes": 1048576, "width": null, "height": null, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.04 / request. | Mode and options | Unit rate (USD) | | --- | --- | | Generate | $0.04 / request | --- # Google Lyria 3 Pro API Model id: `lyria-3-pro` · Google · Audio ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "mode": "generate", "input": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"mode\":\"generate\",\"input\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","mode":"generate","input":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v1/dub` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v1/dub' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v1/dub", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v1/dub", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/tts/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/tts/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/tts/create", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/tts/create", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cartesia Set the base URL to `https://platform-api.invideo.io/cartesia`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cartesia/tts/bytes` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cartesia/tts/bytes' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_id": "lyria-3-pro", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### Cartesia SDK · Python ```python import json import os from pathlib import Path import httpx from cartesia import Cartesia client = Cartesia(base_url="https://platform-api.invideo.io/cartesia", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/tts/bytes", cast_to=httpx.Response, body=json.loads("{\"model_id\":\"lyria-3-pro\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cartesia/tts/bytes", { method: "POST", headers, body: JSON.stringify({"model_id":"lyria-3-pro","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## ElevenLabs Set the base URL to `https://platform-api.invideo.io/elevenlabs`. Use `xi-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /elevenlabs/v1/sound-generation` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/elevenlabs/v1/sound-generation' \ -H "xi-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "text": "The afternoon light is soft and warm.", "model_id": "lyria-3-pro" }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"xi-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/elevenlabs/v1/sound-generation", headers=headers, json=json.loads("{\"text\":\"The afternoon light is soft and warm.\",\"model_id\":\"lyria-3-pro\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "xi-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/elevenlabs/v1/sound-generation", { method: "POST", headers, body: JSON.stringify({"text":"The afternoon light is soft and warm.","model_id":"lyria-3-pro"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` the audio bytes, when the run ends. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/lyria-3-pro` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/lyria-3-pro' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "The afternoon light is soft and warm." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/lyria-3-pro", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "The afternoon light is soft and warm." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/lyria-3-pro", headers=headers, json=json.loads("{\"prompt\":\"The afternoon light is soft and warm.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Fish Audio Set the base URL to `https://platform-api.invideo.io/fishaudio`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /fishaudio/v1/tts` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fishaudio/v1/tts' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: lyria-3-pro' \ --data-binary '{ "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"lyria-3-pro\"}").items()} response = requests.post("https://platform-api.invideo.io/fishaudio/v1/tts", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "lyria-3-pro" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/fishaudio/v1/tts", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/lyria-3-pro:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/lyria-3-pro:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "The afternoon light is soft and warm." } ] } ], "generationConfig": { "responseModalities": [ "AUDIO" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/lyria-3-pro:generateContent", headers=headers, json=json.loads("{\"contents\":[{\"parts\":[{\"text\":\"The afternoon light is soft and warm.\"}]}],\"generationConfig\":{\"responseModalities\":[\"AUDIO\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/lyria-3-pro:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"The afternoon light is soft and warm."}]}],"generationConfig":{"responseModalities":["AUDIO"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` The audio bytes are in `candidates[0].content.parts[0].inlineData`. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/music_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/music_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "output_format": "url", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/music_generation", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"output_format\":\"url\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/music_generation", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","output_format":"url","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `extra_info.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "extra_info": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Mureka Set the base URL to `https://platform-api.invideo.io/mureka`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /mureka/v1/song/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/mureka/v1/song/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/mureka/v1/song/generate", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/mureka/v1/song/generate", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /mureka/v1/song/query/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/audio/speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/audio/speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "input": "The afternoon light is soft and warm." }' ``` ### OpenAI SDK · Python ```python import json import os from pathlib import Path import httpx2 from openai import OpenAI client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/audio/speech", cast_to=httpx2.Response, body=json.loads("{\"model\":\"lyria-3-pro\",\"input\":\"The afternoon light is soft and warm.\"}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/audio/speech", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","input":"The afternoon light is soft and warm."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` the audio bytes, when the run ends (the `Content-Type` header says the format). The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/lyria-3-pro/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/lyria-3-pro/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "The afternoon light is soft and warm." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/lyria-3-pro", input={ "prompt": "The afternoon light is soft and warm.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/lyria-3-pro", { input: { "prompt": "The afternoon light is soft and warm." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Sarvam Set the base URL to `https://platform-api.invideo.io/sarvam`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /sarvam/text-to-speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/sarvam/text-to-speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-3-pro", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/sarvam/text-to-speech", headers=headers, json=json.loads("{\"model\":\"lyria-3-pro\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/sarvam/text-to-speech", { method: "POST", headers, body: JSON.stringify({"model":"lyria-3-pro","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The `audios[]` list contains base64-encoded audio. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 4,974 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 10 files; PNG, JPEG or WebP | Reference images | | `duration_s` | number | no | `60` | `15`, `30`, `45`, `60`, `90`, `120`, `180` | Duration (s) | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "lyria-3-pro", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "audio", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "audio/mpeg", "size_bytes": 1048576, "width": null, "height": null, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.08 / request. | Mode and options | Unit rate (USD) | | --- | --- | | Generate | $0.08 / request | --- # Gemini 3.1 Pro API Model id: `gemini-3-1-pro` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-1-pro", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-1-pro\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-1-pro:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-1-pro:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-1-pro", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-1-pro:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-1-pro", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-1-pro", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-1-pro\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $2.00 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | USD / 1M through 200,000 input tokens | USD / 1M above 200,000 input tokens | | --- | --- | --- | | Input | $2.00 | $4.00 | | Audio input | $2.00 | $4.00 | | Cached input | $0.20 | $0.40 | | Cached audio input | $0.20 | $0.40 | | Output | $12.00 | $18.00 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-1-pro` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Gemini 3.1 Pro Preview API Model id: `gemini-3-1-pro-preview` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-1-pro-preview", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-1-pro-preview\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-1-pro-preview:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-1-pro-preview:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-1-pro-preview", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-1-pro-preview:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-1-pro-preview", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-1-pro-preview", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-1-pro-preview\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-1-pro-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-1-pro-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-1-pro-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $2.00 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | USD / 1M through 200,000 input tokens | USD / 1M above 200,000 input tokens | | --- | --- | --- | | Input | $2.00 | $4.00 | | Audio input | $2.00 | $4.00 | | Cached input | $0.20 | $0.40 | | Cached audio input | $0.20 | $0.40 | | Output | $12.00 | $18.00 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-1-pro-preview` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Nano Banana 2 API Model id: `nanobanana-2` · Google · Image ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "mode": "generate", "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","mode":"generate","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Black Forest Labs Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bfl/v1/nanobanana-2` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bfl/v1/nanobanana-2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bfl/v1/nanobanana-2", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bfl/v1/nanobanana-2", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "Ready", "result": { "sample": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/nanobanana-2` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/nanobanana-2' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/nanobanana-2", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/nanobanana-2", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/nanobanana-2:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/nanobanana-2:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "A blue ceramic vase on a plain cream background, soft studio light." } ] } ], "generationConfig": { "responseModalities": [ "IMAGE" ] } }' ``` ### Google GenAI SDK · Python ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="nanobanana-2", contents="A blue ceramic vase on a plain cream background, soft studio light.", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) image = response.candidates[0].content.parts[0].inline_data.data ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/nanobanana-2:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Ideogram Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ideogram/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ideogram/generate", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model_name":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "image": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Magnific Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result. `data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nanobanana-2", prompt="A blue ceramic vase on a plain cream background, soft studio light.") print(result.data[0].b64_json[:60]) ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const result = await client.images.generate({ model: "nanobanana-2", prompt: "A blue ceramic vase on a plain cream background, soft studio light." }); console.log(result.data[0].b64_json.slice(0, 60)); ``` the image as `b64_json` in `data[0]`, when the run ends. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Phota Labs Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "async": true, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a job ID for polling. The completed job contains `result.download_urls`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: nanobanana-2' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nanobanana-2\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "nanobanana-2" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Recraft Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/nanobanana-2/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nanobanana-2/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nanobanana-2", input={ "prompt": "A blue ceramic vase on a plain cream background, soft studio light.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/nanobanana-2", { input: { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Reve Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /reve/v1/image/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "imageInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "nanobanana-2", "deliveryMethod": "async", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nanobanana-2\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nanobanana-2","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'X-Runway-Version: 2024-11-06' \ --data-binary '{ "model": "nanobanana-2", "ratio": "1280:720", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_image", cast_to=httpx.Response, body=json.loads("{\"model\":\"nanobanana-2\",\"ratio\":\"1280:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "X-Runway-Version": "2024-11-06" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","ratio":"1280:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Topaz Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nanobanana-2", "extra_body": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nanobanana-2\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nanobanana-2","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The image is returned in `data[]`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 30,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 8 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"auto"`, `"1:1"`, `"1:4"`, `"1:8"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:1"`, `"4:3"`, `"4:5"`, `"5:4"`, `"8:1"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio | | `resolution` | string | no | `"1K"` | `"1K"`, `"2K"`, `"4K"` | Resolution | | `thinking` | string | no | `"minimal"` | `"minimal"`, `"high"` | Thinking | | `web_search_grounding` | boolean | no | `false` | `true`, `false` | Web search | | `image_search_grounding` | boolean | no | `false` | `true`, `false` | Image search | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "nanobanana-2", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "image", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "image/png", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": null } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.036 / request. | Mode and options | Unit rate (USD) | | --- | --- | | Generate · Resolution: 1K · Thinking: minimal | $0.0672 / image | | Generate · Resolution: 1K · Thinking: high | $0.0672 / image | | Generate · Resolution: 2K · Thinking: minimal | $0.1008 / image | | Generate · Resolution: 2K · Thinking: high | $0.1008 / image | | Generate · Resolution: 4K · Thinking: minimal | $0.1512 / image | | Generate · Resolution: 4K · Thinking: high | $0.1512 / image | | Generate · Web search | $0.036 / request | | Generate · Image search | $0.036 / request | --- # Gemini 3 Flash Preview API Model id: `gemini-3-flash-preview` · Google · LLM ## Anthropic Messages Set the base URL to `https://platform-api.invideo.io`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-flash-preview", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## BytePlus Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/byteplus/api/v3/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### BytePlus Ark SDK · Python ```python import json import os from volcenginesdkarkruntime import Ark client = Ark(base_url="https://platform-api.invideo.io/byteplus/api/v3", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create(**json.loads("{\"model\":\"gemini-3-flash-preview\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## DeepSeek Set the base URL to `https://platform-api.invideo.io/deepseek/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /deepseek/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/deepseek/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/deepseek/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-flash-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/deepseek/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/gemini-3-flash-preview:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl https://platform-api.invideo.io/v1beta/models/gemini-3-flash-preview:generateContent \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence." } ] } ], "generationConfig": {} }' ``` ### Google GenAI SDK · Python ```python from google import genai import os client = genai.Client( api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}, ) answer = client.models.generate_content( model="gemini-3-flash-preview", contents=[ { "role": "user", "parts": [ { "text": "Explain why the sky looks blue in one sentence.", }, ], }, ], ) print(answer.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/gemini-3-flash-preview:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"role":"user","parts":[{"text":"Explain why the sky looks blue in one sentence."}]}],"generationConfig":{}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text from `candidates[0].content.parts[]`. `usageMetadata.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "candidates": [ { "content": { "role": "model", "parts": [ { "text": "Air scatters blue light more than red light." } ] }, "finishReason": "STOP" } ], "usageMetadata": { "promptTokenCount": 10, "candidatesTokenCount": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax/anthropic`. Use `x-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/anthropic/v1/messages` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/minimax/anthropic/v1/messages \ -H "x-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "max_tokens": 256, "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### Anthropic SDK · Python ```python import anthropic, os client = anthropic.Anthropic(base_url="https://platform-api.invideo.io/minimax/anthropic", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.messages.create( model="gemini-3-flash-preview", max_tokens=256, messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print("".join(block.text for block in answer.content if block.type == "text")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/anthropic/v1/messages", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","max_tokens":256,"messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read the text blocks in `content[]` of the returned message. `usage.cost_usd`. Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "type": "message", "role": "assistant", "content": [ { "type": "text", "text": "Air scatters blue light more than red light." } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Moonshot AI Set the base URL to `https://platform-api.invideo.io/moonshot/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /moonshot/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/moonshot/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/moonshot/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-flash-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/moonshot/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Chat Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-flash-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## OpenAI Responses Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/responses` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/v1/responses \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "input": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.responses.create( model="gemini-3-flash-preview", input=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.output_text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/responses", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","input":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read text items in `output[].content[]`. SDKs expose the combined text as `output_text`. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "response", "status": "completed", "output": [ { "type": "message", "role": "assistant", "content": [ { "type": "output_text", "text": "Air scatters blue light more than red light." } ] } ], "usage": { "input_tokens": 10, "output_tokens": 2, "cost_usd": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] }, "cost": "0.000002" } } ``` ## OpenRouter Set the base URL to `https://platform-api.invideo.io/openrouter/api/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /openrouter/api/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/openrouter/api/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenRouter SDK · Python ```python import json import os from openrouter import OpenRouter with OpenRouter(server_url="https://platform-api.invideo.io/openrouter/api/v1", api_key=os.environ["INVIDEO_API_KEY"]) as client: answer = client.chat.send(**json.loads("{\"model\":\"gemini-3-flash-preview\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain why the sky looks blue in one sentence.\"}]}")) print(answer) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/openrouter/api/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Perplexity Set the base URL to `https://platform-api.invideo.io/perplexity`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /perplexity/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/perplexity/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/perplexity", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-flash-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/perplexity/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/xai/v1/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/xai/v1", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-flash-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Z.ai Set the base URL to `https://platform-api.invideo.io/z-ai/api/paas/v4`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /z-ai/api/paas/v4/chat/completions` · Model ID in `model`. ### curl ```bash curl https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-flash-preview", "messages": [ { "role": "user", "content": "Explain why the sky looks blue in one sentence." } ] }' ``` ### OpenAI SDK · Python ```python from openai import OpenAI import os client = OpenAI(base_url="https://platform-api.invideo.io/z-ai/api/paas/v4", api_key=os.environ["INVIDEO_API_KEY"]) answer = client.chat.completions.create( model="gemini-3-flash-preview", messages=[ { "role": "user", "content": "Explain why the sky looks blue in one sentence.", }, ], ) print(answer.choices[0].message.content) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/z-ai/api/paas/v4/chat/completions", { method: "POST", headers, body: JSON.stringify({"model":"gemini-3-flash-preview","messages":[{"role":"user","content":"Explain why the sky looks blue in one sentence."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Read `choices[0].message.content`. For streaming, read the deltas from the event stream. `usage.cost` (also `usage.cost_usd`). Streams report the exact charge in the final usage event. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Air scatters blue light more than red light." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 10, "completion_tokens": 2, "cost": "0.000002", "invideo_cost": { "total_usd": "0.000002", "lines": [ { "item": "input_tokens", "quantity": "10", "unit_price_usd": "0.0000001", "amount_usd": "0.000001" }, { "item": "output_tokens", "quantity": "2", "unit_price_usd": "0.0000005", "amount_usd": "0.000001" } ] } } } ``` ## Price From $0.50 / 1M input tokens. Reasoning tokens are charged at the output rate. | Token type | Price per 1M tokens | | --- | --- | | Input | $0.50 | | Audio input | $1.00 | | Cached input | $0.05 | | Cached audio input | $0.10 | | Output | $4.68 | ## Input Use the input shape for the selected format. OpenAI Chat and Anthropic Messages use `messages`. OpenAI Responses uses `input`. Gemini uses `contents`. ## Errors Errors follow the selected format. For a 429 rate limit, wait for `Retry-After` before retrying. [API errors](/docs/errors) ## Model | - | - | | --- | --- | | Model ID | `gemini-3-flash-preview` | | Context window | 1,048,576 tokens | | Max output | 65,536 tokens | | Features | tools, JSON output, images, PDFs, prompt cache, thinking, audio, video | ## Capabilities | - | - | | --- | --- | | Streaming | yes | | Tools (function calling) | yes | | Structured output (JSON schema) | yes | | Images in messages | yes | | Reasoning | yes | --- # Nano Banana Pro API Model id: `nano-banana-pro` · Google · Image ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "mode": "generate", "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","mode":"generate","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Black Forest Labs Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bfl/v1/nano-banana-pro` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bfl/v1/nano-banana-pro' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bfl/v1/nano-banana-pro", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bfl/v1/nano-banana-pro", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "Ready", "result": { "sample": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/nano-banana-pro` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/nano-banana-pro' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/nano-banana-pro", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/nano-banana-pro", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/nano-banana-pro:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/nano-banana-pro:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "A blue ceramic vase on a plain cream background, soft studio light." } ] } ], "generationConfig": { "responseModalities": [ "IMAGE" ] } }' ``` ### Google GenAI SDK · Python ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="nano-banana-pro", contents="A blue ceramic vase on a plain cream background, soft studio light.", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) image = response.candidates[0].content.parts[0].inline_data.data ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/nano-banana-pro:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Ideogram Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ideogram/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ideogram/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model_name":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "image": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Magnific Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result. `data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nano-banana-pro", prompt="A blue ceramic vase on a plain cream background, soft studio light.") print(result.data[0].b64_json[:60]) ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const result = await client.images.generate({ model: "nano-banana-pro", prompt: "A blue ceramic vase on a plain cream background, soft studio light." }); console.log(result.data[0].b64_json.slice(0, 60)); ``` the image as `b64_json` in `data[0]`, when the run ends. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Phota Labs Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "async": true, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a job ID for polling. The completed job contains `result.download_urls`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: nano-banana-pro' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nano-banana-pro\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "nano-banana-pro" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Recraft Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/nano-banana-pro/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nano-banana-pro/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nano-banana-pro", input={ "prompt": "A blue ceramic vase on a plain cream background, soft studio light.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/nano-banana-pro", { input: { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Reve Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /reve/v1/image/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "imageInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "nano-banana-pro", "deliveryMethod": "async", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nano-banana-pro\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nano-banana-pro","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'X-Runway-Version: 2024-11-06' \ --data-binary '{ "model": "nano-banana-pro", "ratio": "1280:720", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_image", cast_to=httpx.Response, body=json.loads("{\"model\":\"nano-banana-pro\",\"ratio\":\"1280:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "X-Runway-Version": "2024-11-06" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","ratio":"1280:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Topaz Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-pro", "extra_body": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-pro\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-pro","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The image is returned in `data[]`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 30,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 8 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio | | `resolution` | string | no | `"1K"` | `"1K"`, `"2K"`, `"4K"` | Resolution | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "nano-banana-pro", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "image", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "image/png", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": null } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.1344 / image. | Mode and options | Unit rate (USD) | | --- | --- | | Generate · Resolution: 1K | $0.1344 / image | | Generate · Resolution: 2K | $0.1344 / image | | Generate · Resolution: 4K | $0.24 / image | --- # Nano Banana 2 API Model id: `nano-banana-2` · Google · Image ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "mode": "ingredients", "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"mode\":\"ingredients\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","mode":"ingredients","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Black Forest Labs Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bfl/v1/nano-banana-2` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bfl/v1/nano-banana-2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bfl/v1/nano-banana-2", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bfl/v1/nano-banana-2", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "Ready", "result": { "sample": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/nano-banana-2` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/nano-banana-2' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/nano-banana-2", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/nano-banana-2", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/nano-banana-2:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/nano-banana-2:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "A blue ceramic vase on a plain cream background, soft studio light." } ] } ], "generationConfig": { "responseModalities": [ "IMAGE" ] } }' ``` ### Google GenAI SDK · Python ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="nano-banana-2", contents="A blue ceramic vase on a plain cream background, soft studio light.", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) image = response.candidates[0].content.parts[0].inline_data.data ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/nano-banana-2:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Ideogram Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ideogram/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ideogram/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model_name":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "image": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Magnific Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result. `data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nano-banana-2", prompt="A blue ceramic vase on a plain cream background, soft studio light.") print(result.data[0].b64_json[:60]) ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const result = await client.images.generate({ model: "nano-banana-2", prompt: "A blue ceramic vase on a plain cream background, soft studio light." }); console.log(result.data[0].b64_json.slice(0, 60)); ``` the image as `b64_json` in `data[0]`, when the run ends. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Phota Labs Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "async": true, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a job ID for polling. The completed job contains `result.download_urls`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: nano-banana-2' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nano-banana-2\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "nano-banana-2" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Recraft Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/nano-banana-2/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nano-banana-2/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nano-banana-2", input={ "prompt": "A blue ceramic vase on a plain cream background, soft studio light.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/nano-banana-2", { input: { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Reve Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /reve/v1/image/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "imageInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "nano-banana-2", "deliveryMethod": "async", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nano-banana-2\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nano-banana-2","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'X-Runway-Version: 2024-11-06' \ --data-binary '{ "model": "nano-banana-2", "ratio": "720:720", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_image", cast_to=httpx.Response, body=json.loads("{\"model\":\"nano-banana-2\",\"ratio\":\"720:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "X-Runway-Version": "2024-11-06" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","ratio":"720:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Topaz Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana-2", "extra_body": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana-2\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana-2","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The image is returned in `data[]`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 30,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 14 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"1:1"` | `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "nano-banana-2", "mode": "ingredients", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "image", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "image/png", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": null } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0672 / image. | Mode and options | Unit rate (USD) | | --- | --- | | Ingredients | $0.0672 / image | --- # Google Lyria-002 API Model id: `lyria-002` · Google · Audio ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "mode": "generate", "input": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"mode\":\"generate\",\"input\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","mode":"generate","input":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v1/dub` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v1/dub' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v1/dub", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v1/dub", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/tts/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/tts/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/tts/create", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/tts/create", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cartesia Set the base URL to `https://platform-api.invideo.io/cartesia`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cartesia/tts/bytes` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cartesia/tts/bytes' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_id": "lyria-002", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### Cartesia SDK · Python ```python import json import os from pathlib import Path import httpx from cartesia import Cartesia client = Cartesia(base_url="https://platform-api.invideo.io/cartesia", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/tts/bytes", cast_to=httpx.Response, body=json.loads("{\"model_id\":\"lyria-002\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cartesia/tts/bytes", { method: "POST", headers, body: JSON.stringify({"model_id":"lyria-002","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## ElevenLabs Set the base URL to `https://platform-api.invideo.io/elevenlabs`. Use `xi-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /elevenlabs/v1/sound-generation` · Model ID in `model_id`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/elevenlabs/v1/sound-generation' \ -H "xi-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "text": "The afternoon light is soft and warm.", "model_id": "lyria-002" }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"xi-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/elevenlabs/v1/sound-generation", headers=headers, json=json.loads("{\"text\":\"The afternoon light is soft and warm.\",\"model_id\":\"lyria-002\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "xi-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/elevenlabs/v1/sound-generation", { method: "POST", headers, body: JSON.stringify({"text":"The afternoon light is soft and warm.","model_id":"lyria-002"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` the audio bytes, when the run ends. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/lyria-002` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/lyria-002' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "The afternoon light is soft and warm." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/lyria-002", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "The afternoon light is soft and warm." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/lyria-002", headers=headers, json=json.loads("{\"prompt\":\"The afternoon light is soft and warm.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Fish Audio Set the base URL to `https://platform-api.invideo.io/fishaudio`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /fishaudio/v1/tts` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fishaudio/v1/tts' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: lyria-002' \ --data-binary '{ "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"lyria-002\"}").items()} response = requests.post("https://platform-api.invideo.io/fishaudio/v1/tts", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "lyria-002" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/fishaudio/v1/tts", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/lyria-002:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/lyria-002:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "The afternoon light is soft and warm." } ] } ], "generationConfig": { "responseModalities": [ "AUDIO" ] } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/lyria-002:generateContent", headers=headers, json=json.loads("{\"contents\":[{\"parts\":[{\"text\":\"The afternoon light is soft and warm.\"}]}],\"generationConfig\":{\"responseModalities\":[\"AUDIO\"]}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/lyria-002:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"The afternoon light is soft and warm."}]}],"generationConfig":{"responseModalities":["AUDIO"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` The audio bytes are in `candidates[0].content.parts[0].inlineData`. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/music_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/music_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "output_format": "url", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/music_generation", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"output_format\":\"url\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/music_generation", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","output_format":"url","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. `extra_info.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "extra_info": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Mureka Set the base URL to `https://platform-api.invideo.io/mureka`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /mureka/v1/song/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/mureka/v1/song/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/mureka/v1/song/generate", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/mureka/v1/song/generate", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /mureka/v1/song/query/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/audio/speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/audio/speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "input": "The afternoon light is soft and warm." }' ``` ### OpenAI SDK · Python ```python import json import os from pathlib import Path import httpx2 from openai import OpenAI client = OpenAI(base_url="https://platform-api.invideo.io/v1", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post("/audio/speech", cast_to=httpx2.Response, body=json.loads("{\"model\":\"lyria-002\",\"input\":\"The afternoon light is soft and warm.\"}")) if result.headers.get("content-type", "").startswith("audio/"): Path("output.audio").write_bytes(result.content) else: print(result.json()) print(result.headers.get("x-invideo-cost-usd")) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/audio/speech", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","input":"The afternoon light is soft and warm."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` the audio bytes, when the run ends (the `Content-Type` header says the format). The audio response is bytes. Read the USD charge from `x-invideo-cost-usd`. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "x-invideo-cost-usd": "0.024", "x-invideo-cost-breakdown": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/lyria-002/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/lyria-002/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "The afternoon light is soft and warm." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/lyria-002", input={ "prompt": "The afternoon light is soft and warm.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/lyria-002", { input: { "prompt": "The afternoon light is soft and warm." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Sarvam Set the base URL to `https://platform-api.invideo.io/sarvam`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /sarvam/text-to-speech` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/sarvam/text-to-speech' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "lyria-002", "extra": { "prompt": "The afternoon light is soft and warm." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/sarvam/text-to-speech", headers=headers, json=json.loads("{\"model\":\"lyria-002\",\"extra\":{\"prompt\":\"The afternoon light is soft and warm.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/sarvam/text-to-speech", { method: "POST", headers, body: JSON.stringify({"model":"lyria-002","extra":{"prompt":"The afternoon light is soft and warm."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed audio in the provider's response format. The `audios[]` list contains base64-encoded audio. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "request", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 2,000 characters | Prompt | | `seed` | integer | no | `-1` | -1 to 2147483647 | Seed | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "lyria-002", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "audio", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "audio/mpeg", "size_bytes": 1048576, "width": null, "height": null, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.002 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Generate | $0.002 / second | --- # Veo 3.1 API Model id: `veo-3-1` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "mode": "frames", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"mode\":\"frames\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","mode":"frames","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3-1` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3-1' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3-1", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3-1", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3-1:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3-1:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3-1:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3-1:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3-1" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3-1") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3-1"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3-1' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3-1\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3-1" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3-1/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3-1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3-1", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3-1", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3-1", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3-1\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3-1","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3-1\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 3,000 characters | Prompt | | `first_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | First frame | | `last_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Last frame | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `duration` | number | no | `8` | `4`, `6`, `8` | Duration | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"`, `"4k"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Audio | | `negative_prompt` | string | no | - | up to 3,000 characters | Negative prompt | | `seed` | integer | no | `-1` | -1 to 2147483647 | Seed | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3-1", "mode": "frames", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.20 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Frames · Audio · Resolution: 720p | $0.40 / second | | Frames · Audio · Resolution: 1080p | $0.40 / second | | Frames · Audio · Resolution: 4k | $0.60 / second | | Frames · No audio · Resolution: 720p | $0.20 / second | | Frames · No audio · Resolution: 1080p | $0.20 / second | | Frames · No audio · Resolution: 4k | $0.40 / second | --- # Veo 3.1 API Model id: `veo-3-1-ingredients` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "mode": "ingredients", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"mode\":\"ingredients\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","mode":"ingredients","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3-1-ingredients` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3-1-ingredients' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3-1-ingredients", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3-1-ingredients", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3-1-ingredients:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3-1-ingredients:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3-1-ingredients:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3-1-ingredients:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3-1-ingredients" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3-1-ingredients") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3-1-ingredients"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3-1-ingredients' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3-1-ingredients\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3-1-ingredients" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3-1-ingredients/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3-1-ingredients/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3-1-ingredients", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3-1-ingredients", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3-1-ingredients", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3-1-ingredients\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3-1-ingredients","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3-1-ingredients\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-ingredients", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-ingredients\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-ingredients","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 3,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 3 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"` | Aspect ratio | | `duration` | number | no | `8` | `8` | Duration | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"`, `"4k"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Audio | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3-1-ingredients", "mode": "ingredients", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.20 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Ingredients · Audio · Resolution: 720p | $0.40 / second | | Ingredients · Audio · Resolution: 1080p | $0.40 / second | | Ingredients · Audio · Resolution: 4k | $0.60 / second | | Ingredients · No audio · Resolution: 720p | $0.20 / second | | Ingredients · No audio · Resolution: 1080p | $0.20 / second | | Ingredients · No audio · Resolution: 4k | $0.40 / second | --- # Veo 3.1 Fast API Model id: `veo-3-1-fast` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "mode": "frames", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"mode\":\"frames\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","mode":"frames","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3-1-fast` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3-1-fast' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3-1-fast", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3-1-fast", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3-1-fast:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3-1-fast:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3-1-fast:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3-1-fast:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3-1-fast" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3-1-fast") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3-1-fast"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3-1-fast' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3-1-fast\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3-1-fast" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3-1-fast/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3-1-fast/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3-1-fast", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3-1-fast", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3-1-fast", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3-1-fast\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3-1-fast","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3-1-fast\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 3,000 characters | Prompt | | `first_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | First frame | | `last_frame_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Last frame | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `duration` | number | no | `8` | `4`, `6`, `8` | Duration | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"`, `"4k"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Audio | | `negative_prompt` | string | no | - | up to 3,000 characters | Negative prompt | | `seed` | integer | no | `-1` | -1 to 2147483647 | Seed | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3-1-fast", "mode": "frames", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.08 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Frames · Audio · Resolution: 720p | $0.10 / second | | Frames · Audio · Resolution: 1080p | $0.12 / second | | Frames · Audio · Resolution: 4k | $0.30 / second | | Frames · No audio · Resolution: 720p | $0.08 / second | | Frames · No audio · Resolution: 1080p | $0.10 / second | | Frames · No audio · Resolution: 4k | $0.25 / second | --- # Veo 3.1 Fast API Model id: `veo-3-1-fast-ingredients` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "mode": "ingredients", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"mode\":\"ingredients\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","mode":"ingredients","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3-1-fast-ingredients` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3-1-fast-ingredients' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3-1-fast-ingredients", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3-1-fast-ingredients", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3-1-fast-ingredients:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3-1-fast-ingredients:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3-1-fast-ingredients:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3-1-fast-ingredients:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3-1-fast-ingredients" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3-1-fast-ingredients") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3-1-fast-ingredients"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3-1-fast-ingredients' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3-1-fast-ingredients\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3-1-fast-ingredients" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3-1-fast-ingredients/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3-1-fast-ingredients/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3-1-fast-ingredients", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3-1-fast-ingredients", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3-1-fast-ingredients", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3-1-fast-ingredients\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3-1-fast-ingredients","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-1-fast-ingredients", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-1-fast-ingredients\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-1-fast-ingredients","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 3,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 3 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"` | Aspect ratio | | `duration` | number | no | `8` | `8` | Duration | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"`, `"4k"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Audio | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3-1-fast-ingredients", "mode": "ingredients", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.08 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Ingredients · Audio · Resolution: 720p | $0.10 / second | | Ingredients · Audio · Resolution: 1080p | $0.12 / second | | Ingredients · Audio · Resolution: 4k | $0.30 / second | | Ingredients · No audio · Resolution: 720p | $0.08 / second | | Ingredients · No audio · Resolution: 1080p | $0.10 / second | | Ingredients · No audio · Resolution: 4k | $0.25 / second | --- # Veo 3 API Model id: `veo-3` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "mode": "generate", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","mode":"generate","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `image_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Start frame | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `duration` | number | no | `8` | `4`, `6`, `8` | Duration (s) | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Sound | | `negative_prompt` | string | no | - | up to 2,500 characters | Negative prompt | | `enhance_prompt` | boolean | no | `true` | `true`, `false` | Enhance the prompt | | `seed` | integer | no | `-1` | -1 to 2147483647 | Seed | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.20 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Generate · Generate audio | $0.40 / second | | Generate · No generate audio | $0.20 / second | --- # Veo 3 Fast API Model id: `veo-3-fast` · Google · Video ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "mode": "generate", "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","mode":"generate","input":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/videos/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/videos/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/videos/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/videos/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/video-generation/video-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/video-generation/video-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Bach Set the base URL to `https://platform-api.invideo.io/bach`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bach/api/vdr/video/v2` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bach/api/vdr/video/v2' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bach/api/vdr/video/v2", headers=headers, json=json.loads("{\"model_name\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bach/api/vdr/video/v2", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /bach/api/vdr/video/v2/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Beeble Set the base URL to `https://platform-api.invideo.io/beeble`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /beeble/v1/switchx/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/beeble/v1/switchx/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "generation_type": "video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/beeble/v1/switchx/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"generation_type\":\"video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/beeble/v1/switchx/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","generation_type":"video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /beeble/v1/switchx/generations/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/contents/generations/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/contents/generations/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /byteplus/api/v3/contents/generations/tasks/{id}` for the result. The completed task contains its `content.video_url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Cleanvoice Set the base URL to `https://platform-api.invideo.io/cleanvoice`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /cleanvoice/v2/edits` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/cleanvoice/v2/edits' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/cleanvoice/v2/edits", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/cleanvoice/v2/edits", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /cleanvoice/v2/edits/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/veo-3-fast` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/veo-3-fast' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/veo-3-fast", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/veo-3-fast", headers=headers, json=json.loads("{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/veo-3-fast:predictLongRunning` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/veo-3-fast:predictLongRunning' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "instances": [ { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } ] }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"x-goog-api-key\":\"$INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1beta/models/veo-3-fast:predictLongRunning", headers=headers, json=json.loads("{\"instances\":[{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}]}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/veo-3-fast:predictLongRunning", { method: "POST", headers, body: JSON.stringify({"instances":[{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}]}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` an operation `name`; read it with GET /v1beta/{name} until `done`. The completed operation contains generated video samples inside `response`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## HeyGen Set the base URL to `https://platform-api.invideo.io/heygen`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /heygen/v3/models/videos` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/heygen/v3/models/videos' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "mode": "text-to-video", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/heygen/v3/models/videos", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"mode\":\"text-to-video\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/heygen/v3/models/videos", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","mode":"text-to-video","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /heygen/v3/models/videos/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/image2video/dop` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/image2video/dop' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/image2video/dop", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/videos/text2video` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/videos/text2video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/videos/text2video", headers=headers, json=json.loads("{\"model_name\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/videos/text2video", { method: "POST", headers, body: JSON.stringify({"model_name":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/videos/text2video/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## LTX Set the base URL to `https://platform-api.invideo.io/ltx`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ltx/v2/text-to-video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ltx/v2/text-to-video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ltx/v2/text-to-video", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ltx/v2/text-to-video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /ltx/v2/text-to-video/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", "model": "veo-3-fast" }' ``` ### Luma SDK · Python ```python import os from lumaai import LumaAI client = LumaAI(auth_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/luma/dream-machine/v1") generation = client.generations.create(prompt="A blue paper pinwheel turns slowly in a gentle breeze.", model="veo-3-fast") print(generation.id) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations", { method: "POST", headers, body: JSON.stringify({"prompt":"A blue paper pinwheel turns slowly in a gentle breeze.","model":"veo-3-fast"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` a generation; read GET /luma/dream-machine/v1/generations/{id} until `completed`. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "video": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/video_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/video_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/video_generation", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/video_generation", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /minimax/v1/query/video_generation?task_id={id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## PixVerse Set the base URL to `https://platform-api.invideo.io/pixverse`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pixverse/openapi/v2/video/text/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pixverse/openapi/v2/video/text/generate", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pixverse/openapi/v2/video/result/{id}` for the result. `Resp.usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "Resp": { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: veo-3-fast' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"veo-3-fast\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "veo-3-fast" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/veo-3-fast/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/veo-3-fast/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/veo-3-fast", input={ "prompt": "A blue paper pinwheel turns slowly in a gentle breeze.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/veo-3-fast", { input: { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "videoInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "veo-3-fast", "deliveryMethod": "async", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"videoInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"veo-3-fast\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"videoInference","taskUUID":randomUUID(),"model":"veo-3-fast","deliveryMethod":"async","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `data[].usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_video` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_video' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "X-Runway-Version: 2024-11-06" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "promptText": "A blue paper pinwheel turns slowly in a gentle breeze.", "ratio": "1280:720" }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_video", cast_to=httpx.Response, body=json.loads("{\"model\":\"veo-3-fast\",\"promptText\":\"A blue paper pinwheel turns slowly in a gentle breeze.\",\"ratio\":\"1280:720\"}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "X-Runway-Version": "2024-11-06", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_video", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","promptText":"A blue paper pinwheel turns slowly in a gentle breeze.","ratio":"1280:720"}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ id }`; read GET /runway/v1/tasks/{id} until SUCCEEDED, then `output`. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Tencent Wand Set the base URL to `https://platform-api.invideo.io/tencent`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /tencent/v1/wand/vega-videos/tasks` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "extra": { "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"extra\":{\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/tencent/v1/wand/vega-videos/tasks", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","extra":{"prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /tencent/v1/wand/vega-videos/tasks/{id}` for the result. `usage.invideo_cost_usd` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/videos/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/videos/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "veo-3-fast", "prompt": "A blue paper pinwheel turns slowly in a gentle breeze." }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/videos/generations", headers=headers, json=json.loads("{\"model\":\"veo-3-fast\",\"prompt\":\"A blue paper pinwheel turns slowly in a gentle breeze.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/videos/generations", { method: "POST", headers, body: JSON.stringify({"model":"veo-3-fast","prompt":"A blue paper pinwheel turns slowly in a gentle breeze."}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `{ request_id }`; read GET /xai/v1/videos/{request_id} until `done`. The completed job contains the URL in `video.url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "second", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 5,000 characters | Prompt | | `image_url` | string (URL or data URI) | no | - | PNG, JPEG or WebP | Start frame | | `aspect_ratio` | string | no | `"16:9"` | `"16:9"`, `"9:16"` | Aspect ratio | | `duration` | number | no | `8` | `4`, `6`, `8` | Duration (s) | | `resolution` | string | no | `"720p"` | `"720p"`, `"1080p"` | Resolution | | `generate_audio` | boolean | no | `true` | `true`, `false` | Sound | | `negative_prompt` | string | no | - | up to 2,500 characters | Negative prompt | | `enhance_prompt` | boolean | no | `true` | `true`, `false` | Enhance the prompt | | `seed` | integer | no | `-1` | -1 to 2147483647 | Seed | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "veo-3-fast", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "video", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "video/mp4", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": 5 } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.13816825 / second. | Mode and options | Unit rate (USD) | | --- | --- | | Generate · Generate audio | $0.207252375 / second | | Generate · No generate audio | $0.13816825 / second | --- # Nano Banana API Model id: `nano-banana` · Google · Image ## invideo API Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/request` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/request' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "mode": "generate", "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/v1/request", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"mode\":\"generate\",\"input\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1/request", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","mode":"generate","input":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` answers at once with the request's id; read it with GET /v1/request/{id} until it has ended. The completed request contains `output.files[]` with temporary download links, or `output.transcript` for transcription. `cost_usd` on the completed request. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": { "files": [ { "url": "https://…/completed-output" } ] }, "cost_usd": "0.024", "cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } ``` ## Adobe Firefly Set the base URL to `https://platform-api.invideo.io/adobe`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /adobe/v3/images/generate-async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/adobe/v3/images/generate-async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/adobe/v3/images/generate-async", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/adobe/v3/images/generate-async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /adobe/v3/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Alibaba Model Studio Set the base URL to `https://platform-api.invideo.io/dashscope`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /dashscope/api/v1/services/aigc/text2image/image-synthesis` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'x-dashscope-async: enable' \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"x-dashscope-async\":\"enable\"}").items()} response = requests.post("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "x-dashscope-async": "enable" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/dashscope/api/v1/services/aigc/text2image/image-synthesis", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /dashscope/api/v1/tasks/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Black Forest Labs Set the base URL to `https://platform-api.invideo.io/bfl`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /bfl/v1/nano-banana` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/bfl/v1/nano-banana' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/bfl/v1/nano-banana", headers=headers, json=json.loads("{\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/bfl/v1/nano-banana", { method: "POST", headers, body: JSON.stringify({"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a polling URL for the result. When `status` is `Ready`, read `result.sample` for the image URL. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "Ready", "result": { "sample": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus ModelArk Set the base URL to `https://platform-api.invideo.io/byteplus/api/v3`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplus/api/v3/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplus/api/v3/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplus/api/v3/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplus/api/v3/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains image URLs in `data[].url`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## BytePlus Vision Set the base URL to `https://platform-api.invideo.io/byteplusvision`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/byteplusvision?Action=CVSync2AsyncSubmitTask&Version=2024-06-06", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task ID. Poll CVSync2AsyncGetResult for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## fal Set the base URL to `https://platform-api.invideo.io/fal`. Use `Authorization: Key $INVIDEO_API_KEY` for authentication. Endpoint `POST /fal/nano-banana` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/fal/nano-banana' \ -H "Authorization: Key $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### fal · JavaScript ```js const response = await fetch("https://platform-api.invideo.io/fal/nano-banana", { method: "POST", redirect: "error", headers: { Authorization: `Key ${process.env.INVIDEO_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.json()); ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Key $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/fal/nano-banana", headers=headers, json=json.loads("{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}"), timeout=120) response.raise_for_status() print(response.text) ``` a queue request: read status_url until COMPLETED, then response_url for the result. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Gemini Set the base URL to `https://platform-api.invideo.io`. Use `x-goog-api-key: $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1beta/models/nano-banana:generateContent` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1beta/models/nano-banana:generateContent' \ -H "x-goog-api-key: $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "contents": [ { "parts": [ { "text": "A blue ceramic vase on a plain cream background, soft studio light." } ] } ], "generationConfig": { "responseModalities": [ "IMAGE" ] } }' ``` ### Google GenAI SDK · Python ```python import os from google import genai from google.genai import types client = genai.Client(api_key=os.environ["INVIDEO_API_KEY"], http_options={"base_url": "https://platform-api.invideo.io", "api_version": "v1beta"}) response = client.models.generate_content( model="nano-banana", contents="A blue ceramic vase on a plain cream background, soft studio light.", config=types.GenerateContentConfig(response_modalities=["IMAGE"]), ) image = response.candidates[0].content.parts[0].inline_data.data ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "x-goog-api-key": "$INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/v1beta/models/nano-banana:generateContent", { method: "POST", headers, body: JSON.stringify({"contents":[{"parts":[{"text":"A blue ceramic vase on a plain cream background, soft studio light."}]}],"generationConfig":{"responseModalities":["IMAGE"]}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` `candidates[0].content.parts[0].inlineData`, the image as base64, when the run ends. Read media bytes and the MIME type in `candidates[0].content.parts[].inlineData`. `usageMetadata.cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usageMetadata": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Higgsfield Set the base URL to `https://platform-api.invideo.io/higgsfield`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /higgsfield/v1/text2image/soul` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/higgsfield/v1/text2image/soul' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/higgsfield/v1/text2image/soul", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /higgsfield/v1/job-sets/{id}` for the result. Read the job outputs in `jobs[].results.raw` after completion. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Ideogram Set the base URL to `https://platform-api.invideo.io/ideogram`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /ideogram/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/ideogram/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/ideogram/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/ideogram/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The response contains the generated image URLs in `data[].url`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Kling Set the base URL to `https://platform-api.invideo.io/kling`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /kling/v1/images/generations` · Model ID in `model_name`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/kling/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model_name": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/kling/v1/images/generations", headers=headers, json=json.loads("{\"model_name\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/kling/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model_name":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /kling/v1/images/generations/{id}` for the result. When `data.task_status` is `succeed`, read `data.task_result` for the media URLs. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "task_status": "succeed", "task_result": { "videos": [ { "url": "https://…/completed-output" } ] } }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Luma Set the base URL to `https://platform-api.invideo.io/luma/dream-machine/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /luma/dream-machine/v1/generations/image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/luma/dream-machine/v1/generations/image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/luma/dream-machine/v1/generations/image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /luma/dream-machine/v1/generations/{id}` for the result. The completed generation contains the file URL in `assets`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "state": "completed", "assets": { "image": "https://…/completed-output" }, "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Magnific Set the base URL to `https://platform-api.invideo.io/freepik`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /freepik/v1/ai/image-upscaler` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/freepik/v1/ai/image-upscaler' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/freepik/v1/ai/image-upscaler", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /freepik/v1/ai/image-upscaler/{id}` for the result. `data.cost_usd` on the completed task. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## MiniMax Set the base URL to `https://platform-api.invideo.io/minimax`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /minimax/v1/image_generation` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/minimax/v1/image_generation' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/minimax/v1/image_generation", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/minimax/v1/image_generation", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## OpenAI Set the base URL to `https://platform-api.invideo.io/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "prompt": "A blue ceramic vase on a plain cream background, soft studio light." }' ``` ### OpenAI SDK · Python ```python import os from openai import OpenAI client = OpenAI(api_key=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/v1") result = client.images.generate(model="nano-banana", prompt="A blue ceramic vase on a plain cream background, soft studio light.") print(result.data[0].b64_json[:60]) ``` ### OpenAI SDK · JavaScript ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: process.env.INVIDEO_API_KEY, baseURL: "https://platform-api.invideo.io/v1" }); const result = await client.images.generate({ model: "nano-banana", prompt: "A blue ceramic vase on a plain cream background, soft studio light." }); console.log(result.data[0].b64_json.slice(0, 60)); ``` the image as `b64_json` in `data[0]`, when the run ends. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Phota Labs Set the base URL to `https://platform-api.invideo.io/phota`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /phota/v2/phota/generate` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/phota/v2/phota/generate' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "async": true, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/phota/v2/phota/generate", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"async\":true,\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/phota/v2/phota/generate", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","async":true,"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a job ID for polling. The completed job contains `result.download_urls`. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Pruna AI Set the base URL to `https://platform-api.invideo.io/pruna`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /pruna/v1/predictions` · Model ID in `Model header`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/pruna/v1/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'model: nano-banana' \ --data-binary '{ "input": {}, "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\",\"model\":\"nano-banana\"}").items()} response = requests.post("https://platform-api.invideo.io/pruna/v1/predictions", headers=headers, json=json.loads("{\"input\":{},\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "model": "nano-banana" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/pruna/v1/predictions", { method: "POST", headers, body: JSON.stringify({"input":{},"extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /pruna/v1/predictions/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Recraft Set the base URL to `https://platform-api.invideo.io/recraft`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /recraft/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/recraft/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/recraft/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/recraft/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. Read the image URL in `data[].url` or the encoded bytes in `data[].b64_json`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Replicate Set the base URL to `https://platform-api.invideo.io/replicate`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /replicate/v1/models/invideo/nano-banana/predictions` · Model ID in `URL model segment`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/replicate/v1/models/invideo/nano-banana/predictions' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "input": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Replicate client · Python ```python import os, replicate client = replicate.Client(api_token=os.environ["INVIDEO_API_KEY"], base_url="https://platform-api.invideo.io/replicate") output = client.run("invideo/nano-banana", input={ "prompt": "A blue ceramic vase on a plain cream background, soft studio light.", }) print(output) ``` ### Replicate client · JavaScript ```js import Replicate from "replicate"; const replicate = new Replicate({ auth: process.env.INVIDEO_API_KEY, baseUrl: "https://platform-api.invideo.io/replicate/v1" }); const output = await replicate.run("invideo/nano-banana", { input: { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }); console.log(output); ``` a prediction: read it with GET /replicate/v1/predictions/{id} until the run ends. Read `output` from the completed prediction. It holds a download URL or a list of URLs. `metrics.cost_usd` on the completed prediction. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "succeeded", "output": [ "https://…/completed-output" ], "metrics": { "cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Reve Set the base URL to `https://platform-api.invideo.io/reve`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /reve/v1/image/create` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/reve/v1/image/create' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/reve/v1/image/create", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/reve/v1/image/create", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runware Set the base URL to `https://platform-api.invideo.io/runware/v1`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runware/v1` · Model ID in `task.model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runware/v1' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '[ { "taskType": "imageInference", "taskUUID": "'"$(uuidgen | tr '[:upper:]' '[:lower:]')"'", "model": "nano-banana", "deliveryMethod": "async", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } } ]' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/runware/v1", headers=headers, json=json.loads("[{\"taskType\":\"imageInference\",\"taskUUID\":\"" + str(uuid4()) + "\",\"model\":\"nano-banana\",\"deliveryMethod\":\"async\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}]"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runware/v1", { method: "POST", headers, body: JSON.stringify([{"taskType":"imageInference","taskUUID":randomUUID(),"model":"nano-banana","deliveryMethod":"async","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}]), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task UUID. Send getResponse using this UUID. `usage.cost` on the result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Runway Set the base URL to `https://platform-api.invideo.io/runway`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /runway/v1/text_to_image` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/runway/v1/text_to_image' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ -H 'X-Runway-Version: 2024-11-06' \ --data-binary '{ "model": "nano-banana", "ratio": "1280:720", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### Runway SDK · Python ```python import json import os import httpx from runwayml import RunwayML client = RunwayML(base_url="https://platform-api.invideo.io/runway", api_key=os.environ["INVIDEO_API_KEY"]) result = client.post( "/v1/text_to_image", cast_to=httpx.Response, body=json.loads("{\"model\":\"nano-banana\",\"ratio\":\"1280:720\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), ) print(result.json()) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json", "X-Runway-Version": "2024-11-06" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/runway/v1/text_to_image", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","ratio":"1280:720","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /runway/v1/tasks/{id}` for the result. Read the output URLs in `output[]` after the task succeeds. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "status": "SUCCEEDED", "output": [ "https://…/completed-output" ], "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## Topaz Set the base URL to `https://platform-api.invideo.io/topaz`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /topaz/image/v1/enhance-gen/async` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/topaz/image/v1/enhance-gen/async", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns a task. Read `GET /topaz/image/v1/status/{id}` for the result. `metadata.invideo_cost_usd` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "metadata": { "invideo_cost_usd": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## xAI Set the base URL to `https://platform-api.invideo.io/xai`. Use `Authorization: Bearer $INVIDEO_API_KEY` for authentication. Endpoint `POST /xai/v1/images/generations` · Model ID in `model`. ### curl ```bash curl -X POST 'https://platform-api.invideo.io/xai/v1/images/generations' \ -H "Authorization: Bearer $INVIDEO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary '{ "model": "nano-banana", "extra_body": { "prompt": "A blue ceramic vase on a plain cream background, soft studio light." } }' ``` ### HTTP · Python ```python import json import os from pathlib import Path from uuid import uuid4 import requests headers = {name: value.replace("$INVIDEO_API_KEY", os.environ["INVIDEO_API_KEY"]) for name, value in json.loads("{\"Authorization\":\"Bearer $INVIDEO_API_KEY\",\"Content-Type\":\"application/json\"}").items()} response = requests.post("https://platform-api.invideo.io/xai/v1/images/generations", headers=headers, json=json.loads("{\"model\":\"nano-banana\",\"extra_body\":{\"prompt\":\"A blue ceramic vase on a plain cream background, soft studio light.\"}}"), timeout=120) response.raise_for_status() print(response.text) ``` ### HTTP · JavaScript ```js import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; const headers = Object.fromEntries(Object.entries({ "Authorization": "Bearer $INVIDEO_API_KEY", "Content-Type": "application/json" }) .map(([name, value]) => [name, value.replace("$INVIDEO_API_KEY", process.env.INVIDEO_API_KEY)])); const response = await fetch("https://platform-api.invideo.io/xai/v1/images/generations", { method: "POST", headers, body: JSON.stringify({"model":"nano-banana","extra_body":{"prompt":"A blue ceramic vase on a plain cream background, soft studio light."}}), }); if (!response.ok) throw new Error(await response.text()); console.log(await response.text()); ``` Returns the completed images in the provider's response format. The image is returned in `data[]`. `usage.cost` on the completed result. The settled USD charge is also in `x-invideo-cost-usd` when known before headers are sent. ### Example response fields ```json { "data": [ { "url": "https://…/completed-output" } ], "usage": { "cost": "0.024", "invideo_cost": { "total_usd": "0.024", "lines": [ { "item": "image", "quantity": "1", "unit_price_usd": "0.024", "amount_usd": "0.024" } ] } } } ``` ## invideo API input The keys of `input`. An unknown key is refused. A file is an `https` URL or a data URI. Inline (data URI) up to 64 MB per request; larger files: an `https` URL or an upload, video up to 300 MB. | Key | Type | Required | Default | Allowed | Description | | --- | --- | --- | --- | --- | --- | | `prompt` | string | yes | - | up to 30,000 characters | Prompt | | `reference_image_urls` | array of strings (URLs or data URIs) | no | `[]` | up to 8 files; PNG, JPEG or WebP | Reference images | | `aspect_ratio` | string | no | `"16:9"` | `"1:1"`, `"2:3"`, `"3:2"`, `"3:4"`, `"4:3"`, `"4:5"`, `"5:4"`, `"9:16"`, `"16:9"`, `"21:9"` | Aspect ratio | ## Output ### Submit answers ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "status": "queued" } ``` ### A finished request ```json { "id": "0f8b6c1e-0000-0000-0000-000000000000", "model": "nano-banana", "mode": "generate", "status": "succeeded", "created_at": "2026-01-01T10:00:00Z", "started_at": "2026-01-01T10:00:02Z", "finished_at": "2026-01-01T10:01:00Z", "output": { "kind": "image", "files": [ { "url": "https://… (valid for 1 hour)", "content_type": "image/png", "size_bytes": 1048576, "width": 1280, "height": 720, "duration": null } ] }, "error": null, "cost_usd": "0.25" } ``` `status` is `preparing`, `queued`, `running`, `succeeded`, or `failed` (a request that did not start within 15 minutes fails with `queue_timeout`). `output` and `cost_usd` are `null` until it succeeds. Each file link is signed again on every read and works for 1 hour. A failed run is still a `200`: `error` holds `{type, code, message, retryable}`, and `type` is `content`, `model`, `input` or `server`. ## Request and response logs Request and response logs, as JSON; files are fresh 1-hour links. `GET https://platform-api.invideo.io/v1/request/{id}/logs/request` gives what was sent, `GET https://platform-api.invideo.io/v1/request/{id}/logs/response` what came back. The key reads only its own workspace's requests. A log that is no longer available answers `410 log_expired`. `GET https://platform-api.invideo.io/v1/request/{id}` gives the log links without checking them. ### Read the response log (curl) ```bash curl "https://platform-api.invideo.io/v1/request/$ID/logs/response" \ -H "Authorization: Bearer $INVIDEO_API_KEY" ``` ### A response log ```json { "id": "01a21889-e91b-7aba-a0d6-7b2cc4510be7", "model": "", "mode": "generate", "created_at": "2026-11-26T15:47:01.022556Z", "finished_at": "2026-11-26T15:47:09.350578Z", "cost_usd": "0.193248", "error": null, "output": { "files": [ { "name": "1.mp3", "url": "https://…/1.mp3?X-Amz-Expires=3600&…", "download_url": "https://…/1.mp3?response-content-disposition=attachment…", "content_type": "audio/mpeg", "size_bytes": 1440620, "duration": 60.024, "width": null, "height": null } ] } } ``` ## Errors A refused call answers with `{error}`, most with a `message` too; `invalid_input` has `detail` instead. | HTTP | error | When | | --- | --- | --- | | 400 | - | The body is not valid JSON. | | 401 | `unauthorized` | The API key is missing, invalid, disabled or expired. | | 404 | `model_not_found` | No such model or mode, or it is not on for this workspace. | | 404 | `not_found` | No request with this id (on a read). | | 413 | - | The body is over 64 MB. Send larger files as an `https` URL or an upload. | | 422 | `invalid_input` | `detail` lists each problem as `{loc, msg, type}`; `loc` ends with the field's name. | | 422 | `model_not_priced` | These options have no price yet, so they cannot run. | | 429 | `rate_limited` | Over the workspace's requests per minute (all its keys and the playground together; 300 by default, see Limits) or 3000 reads a minute. Wait `Retry-After` seconds. | | 429 | `spend_limit_exceeded` | The spend limit of the workspace is used up. | | 500 | `server_error` | Something went wrong on our end. Please try again. | ## Price From $0.0387 / image. | Mode and options | Unit rate (USD) | | --- | --- | | Generate | $0.0387 / image | | Generate · Input tokens | $0.00036 / request (typical) |