# MixMedia API — full documentation > Generated from https://docs.mixmedia.tech/en/ # Documentation > How to connect image, video and text generation to your website, bot or service. Start with the [quick start](https://docs.mixmedia.tech/en/quickstart): key, first request and result in 5 minutes. --- # Quick start > Your first image through the API in 3 steps: key → task → result. Base URL: `https://mixmedia.tech/api/v1` ## 1. Get a key Sign in at [mixmedia.tech](https://mixmedia.tech/login) and open [Dashboard → API keys](https://mixmedia.tech/cabinet/keys). Press "Create key" and copy it. ```bash export API_KEY="sk-aim-..." ``` ## 2. Create a task ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-2","input":{"prompt":"A cat astronaut in a neon city"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-2", "input": { "prompt": "A cat astronaut in a neon city" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-2", "input": { "prompt": "A cat astronaut in a neon city" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` The response is the task ID: ```json { "code": 200, "msg": "success", "data": { "taskId": "task_nano-banana-2_1790621023886ca4e4d", "task_id": "task_nano-banana-2_1790621023886ca4e4d", "status": "submitted" } } ``` ## 3. Get the result Ask for the status every 3–5 seconds until `state` becomes `success` or `fail`. It usually takes 1–2 minutes. ```bash curl "https://mixmedia.tech/api/v1/jobs/recordInfo?taskId=task_nano-banana-2_1790621023886ca4e4d" \ -H "Authorization: Bearer $API_KEY" ``` Done when `state` = `success`. Image links are in `resultJson`: ```json { "code": 200, "msg": "success", "data": { "taskId": "task_nano-banana-2_1790621023886ca4e4d", "state": "success", "resultJson": "{\"resultUrls\":[\"https://mixmedia.tech/files/7496aef5292507f51b84cb2cb258d001.png\"]}", "creditsConsumed": 0.015 } } ``` > **If the task fails** (`fail`), the money goes back to your balance automatically. ## All together: a ready script ```python import os, time, json, requests API = "https://mixmedia.tech/api/v1" HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"} # 1. create a task task = requests.post(f"{API}/jobs/createTask", headers=HEADERS, json={ "model": "nano-banana-2", "input": {"prompt": "A cat astronaut in a neon city"}, }).json() task_id = task["data"]["taskId"] # 2. wait for the result while True: info = requests.get(f"{API}/jobs/recordInfo", headers=HEADERS, params={"taskId": task_id}).json()["data"] if info["state"] in ("success", "fail"): break time.sleep(4) # 3. image links if info["state"] == "success": print(json.loads(info["resultJson"])["resultUrls"]) else: print("failed:", info["failMsg"]) ``` ```javascript const API = "https://mixmedia.tech/api/v1"; const headers = { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }; // 1. create a task const task = await fetch(`${API}/jobs/createTask`, { method: "POST", headers, body: JSON.stringify({ model: "nano-banana-2", input: { prompt: "A cat astronaut in a neon city" } }), }).then((r) => r.json()); // 2. wait for the result let info; do { await new Promise((r) => setTimeout(r, 4000)); info = (await fetch(`${API}/jobs/recordInfo?taskId=${task.data.taskId}`, { headers }).then((r) => r.json())).data; } while (!["success", "fail"].includes(info.state)); // 3. image links console.log(info.state === "success" ? JSON.parse(info.resultJson).resultUrls : info.failMsg); ``` ## Next - [Models](https://docs.mixmedia.tech/en/models) — parameters and examples for every model - [Callbacks](https://docs.mixmedia.tech/en/callbacks) — we POST the result to your server, no polling - Error codes are in the «Error handling» block on each [model page](https://docs.mixmedia.tech/en/models). --- # All models > Available models, their API IDs and prices. Pass the model ID in the `model` field of `createTask`. One model can have several modes, each with its own ID. | Model | Mode | ID | Price | |---|---|---|---| | [FLUX 3 Image](https://docs.mixmedia.tech/en/models/flux-3-image) | Image | `flux-3-image` | 1K $0.05 · 1.5K $0.073 · 2K $0.104 · 4K $0.632 | | [FLUX 3 Image Klein](https://docs.mixmedia.tech/en/models/flux-3-image-klein) | Image | `flux-3-image-klein` | 1K $0.013 · 2K $0.021 · 4K $0.051 | | [Flux Dev](https://docs.mixmedia.tech/en/models/flux-dev) | Image | `flux-dev` | $0.033 | | [GPT Image 2.6](https://docs.mixmedia.tech/en/models/gpt-image-2.6) | Image | `gpt-image-2.6-text-to-image` | $0.035–$0.265 (depends on quality and resolution) | | [GPT Image 2.5](https://docs.mixmedia.tech/en/models/gpt-image-2.5) | Image | `gpt-image-2.5-image-to-image` | $0.05–$0.23 (depends on quality and resolution) | | [Nano Banana 2.1](https://docs.mixmedia.tech/en/models/nano-banana-2) | Image | `nano-banana-2` | 0.5K $0.025 · 1K $0.025 · 2K $0.035 · 4K $0.04 | | [Nano Banana Pro](https://docs.mixmedia.tech/en/models/nano-banana-pro) | Image | `nano-banana-pro` | 1K $0.05 · 2K $0.055 · 4K $0.065 | | [Nano Banana Lite](https://docs.mixmedia.tech/en/models/nano-banana) | Image | `nano-banana-lite-edit` | 1K $0.02 · 2K $0.02 | | [Seedream Pro](https://docs.mixmedia.tech/en/models/seedream-pro) | Image | `seedream-pro` | 1K $0.05 · 1.5K $0.05 · 2K $0.095 | | [Seedream 5.5](https://docs.mixmedia.tech/en/models/seedream-5.5) | Image | `seedream-5.5` | 1K $0.04 · 1.5K $0.04 · 2K $0.045 | | [Seedream Flash](https://docs.mixmedia.tech/en/models/seedream-flash) | Image | `seedream-flash` | 1K $0.025 · 1.5K $0.025 · 2K $0.025 | | [MiniMax H3 Image](https://docs.mixmedia.tech/en/models/minimax-h3-image) | Image | `minimax-h3-image` | 1K $0.035 · 2K $0.035 · 4K $0.105 | | [MiniMax H3 Image Highspeed](https://docs.mixmedia.tech/en/models/minimax-h3-image-highspeed) | Image | `minimax-h3-image-highspeed` | 1K $0.055 · 2K $0.055 · 4K $0.195 | | [Kling V4 Image](https://docs.mixmedia.tech/en/models/kling-v4-image) | Image | `kling-v4-image` | 2K $0.075 · 4K $0.112 · 8K $0.186 | | [Kling V4 Long Image](https://docs.mixmedia.tech/en/models/kling-v4-long-image) | Image | `kling-v4-long-image` | $0.279–$1.022 (depends on quality and resolution) | | [MAI Image 2.7](https://docs.mixmedia.tech/en/models/mai-image-2.7) | Image | `mai-image-2.7` | 1K $0.037 · 2K $0.146 | | [MAI Image 2.7 Flash](https://docs.mixmedia.tech/en/models/mai-image-2.7-flash) | Image | `mai-image-2.7-flash` | 1K $0.012 · 2K $0.043 | | [Claude Fable 5.2](https://docs.mixmedia.tech/en/models/claude-fable-5.2) | Text | `claude-fable-5.2` | $10.88 / 1M input · $54.4 / 1M output | | [Claude Opus 5.5](https://docs.mixmedia.tech/en/models/claude-opus-5.5) | Text | `claude-opus-5.5` | $4.16 / 1M input · $20.8 / 1M output | | [Claude Sonnet 5.5](https://docs.mixmedia.tech/en/models/claude-sonnet-5.5) | Text | `claude-sonnet-5.5` | $2.08 / 1M input · $10.4 / 1M output | | [Claude Sonnet 4.5](https://docs.mixmedia.tech/en/models/claude-sonnet-4.5) | Text | `claude-sonnet-4.5` | $2.52 / 1M input · $12.6 / 1M output | | [Claude Haiku 5.5](https://docs.mixmedia.tech/en/models/claude-haiku-5.5) | Text | `claude-haiku-5.5` | $0.104 / 1M input · $0.52 / 1M output | | [Gemini 4 Carbon](https://docs.mixmedia.tech/en/models/gemini-4-carbon) | Text | `gemini-4-carbon` | $2.72 / 1M input · $13.6 / 1M output | | [Gemini 4 Hydrogen](https://docs.mixmedia.tech/en/models/gemini-4-hydrogen) | Text | `gemini-4-hydrogen` | $1.56 / 1M input · $7.8 / 1M output | | [Gemini 4 Argon](https://docs.mixmedia.tech/en/models/gemini-4-argon) | Text | `gemini-4-argon` | $2.72 / 1M input · $13.6 / 1M output | | [Gemini 3.8 Flash](https://docs.mixmedia.tech/en/models/gemini-3.8-flash) | Text | `gemini-3.8-flash` | $0.78 / 1M input · $3.9 / 1M output | | [Gemini 3.7 Flash](https://docs.mixmedia.tech/en/models/gemini-3.7-flash) | Text | `gemini-3.7-flash` | $0.78 / 1M input · $3.9 / 1M output | | [Gemini 3.6 Flash](https://docs.mixmedia.tech/en/models/gemini-3.6-flash) | Text | `gemini-3.6-flash` | $1.56 / 1M input · $7.8 / 1M output | | [Gemini 3.1 Pro](https://docs.mixmedia.tech/en/models/gemini-3.1-pro) | Text | `gemini-3.1-pro` | $2.08 / 1M input · $12.48 / 1M output | | [Gemini 3 Pro](https://docs.mixmedia.tech/en/models/gemini-3-pro) | Text | `gemini-3-pro` | $2.08 / 1M input · $12.48 / 1M output | | [GPT-6.2 Sol](https://docs.mixmedia.tech/en/models/gpt-6.2-sol) | Text | `gpt-6.2-sol` | $2.08 / 1M input · $10.4 / 1M output | | [GPT-6.2 Astra](https://docs.mixmedia.tech/en/models/gpt-6.2-astra) | Text | `gpt-6.2-astra` | $8.32 / 1M input · $41.6 / 1M output | | [GPT-6.1 Sol](https://docs.mixmedia.tech/en/models/gpt-6.1-sol) | Text | `gpt-6.1-sol` | $1.68 / 1M input · $8.4 / 1M output | | [GPT-6 Astra](https://docs.mixmedia.tech/en/models/gpt-6-astra) | Text | `gpt-6-astra` | $8.4 / 1M input · $42 / 1M output | | [GPT-5.6](https://docs.mixmedia.tech/en/models/gpt-5.6) | Text | `gpt-5.6` | $4.16 / 1M input · $20.8 / 1M output | | [DeepSeek V4 Pro](https://docs.mixmedia.tech/en/models/deepseek-v4-pro) | Text | `deepseek-v4-pro` | $0.8743 / 1M input · $2.6229 / 1M output | | [DeepSeek V4.1 Flash](https://docs.mixmedia.tech/en/models/deepseek-v4.1-flash) | Text | `deepseek-v4.1-flash` | $0.1943 / 1M input · $0.7771 / 1M output | | [Kimi K3.1 Pro](https://docs.mixmedia.tech/en/models/kimi-k3.1-pro) | Text | `kimi-k3.1-pro` | $1.36 / 1M input · $6.8 / 1M output | | [Suno](https://docs.mixmedia.tech/en/models/suno-v6) | Audio | `suno-v6` | $0.09 | | [Gemini Omni 1.2 Flash](https://docs.mixmedia.tech/en/models/gemini-omni-1.2-flash) | Video | `gemini-omni-1.2-flash` | from $0.026/s | | [Gemini Omni Flash](https://docs.mixmedia.tech/en/models/gemini-omni-flash) | Video | `gemini-omni-flash` | from $0.0488/s | | [Grok Imagine 1.5](https://docs.mixmedia.tech/en/models/grok-imagine-1.5) | Video | `grok-imagine-1.5` | from $0.096/s | | [Grok Imagine](https://docs.mixmedia.tech/en/models/grok-imagine) | Video | `grok-imagine` | from $0.065/s | | [Higgsfield Genjutsu](https://docs.mixmedia.tech/en/models/higgsfield-genjutsu) | Video | `higgsfield-genjutsu` | from $0.4134/s | | [Kling 4.0 Flash](https://docs.mixmedia.tech/en/models/kling-4.0-flash) | Video | `kling-4.0-flash` | from $0.1114/s | | [Kling 4.0](https://docs.mixmedia.tech/en/models/kling-4.0) | Video | `kling-4.0` | from $0.1852/s | | [MiniMax H3](https://docs.mixmedia.tech/en/models/minimax-h3-video) | Video | `minimax-h3-video` | from $0.0743/s | | [Vidu Q4](https://docs.mixmedia.tech/en/models/vidu-q4) | Video | `vidu-q4` | from $0.0582/s | | [Kling 3.0](https://docs.mixmedia.tech/en/models/kling-3.0) | Video | `kling-3.0` | from $0.091/s | | [Kling 3.0 Omni](https://docs.mixmedia.tech/en/models/kling-3.0-omni) | Video | `kling-3.0-omni` | from $0.091/s | | [Kling 3.0 Motion Control](https://docs.mixmedia.tech/en/models/kling-3.0-motion-control) | Video | `kling-3.0-motion-control` | from $0.1337/s | | [Kling 2.6](https://docs.mixmedia.tech/en/models/kling-2.6) | Video | `kling-2.6` | from $0.0715/s | | [Kling 2.6 Motion Control](https://docs.mixmedia.tech/en/models/kling-2.6-motion-control) | Video | `kling-2.6-motion-control` | from $0.0743/s | | [Kling 2.5 Turbo](https://docs.mixmedia.tech/en/models/kling-2.5-turbo) | Video | `kling-2.5-turbo` | from $0.0819/s | | [OmniHuman 2.0](https://docs.mixmedia.tech/en/models/omnihuman-2.0) | Video | `omnihuman-2.0` | from $0.091/s | | [PixVerse V6](https://docs.mixmedia.tech/en/models/pixverse-v6) | Video | `pixverse-v6` | from $0.0364/s | | [Pruna P-Video Replace](https://docs.mixmedia.tech/en/models/video-replace) | Video | `pruna-p-video-replace` | from $0.039/s | | [Runway](https://docs.mixmedia.tech/en/models/runway) | Video | `runway` | from $0.0156/s | | [Seedance 2.5](https://docs.mixmedia.tech/en/models/seedance-2.5) | Video | `seedance-2.5` | from $0.147/s | | [Seedance 2.5 Flash](https://docs.mixmedia.tech/en/models/seedance-2.5-flash) | Video | `seedance-2.5-flash` | from $0.0829/s | | [Seedance 2.0](https://docs.mixmedia.tech/en/models/seedance-2.0) | Video | `seedance-2.0` | from $0.0998/s | | [Seedance 2.0 Fast](https://docs.mixmedia.tech/en/models/seedance-2.0-fast) | Video | `seedance-2.0-fast` | from $0.0619/s | | [Seedance 2.0 Mini](https://docs.mixmedia.tech/en/models/seedance-2.0-mini) | Video | `seedance-2.0-mini` | from $0.0247/s | | [Seedance 1.0 Pro Fast](https://docs.mixmedia.tech/en/models/seedance-1.0-pro-fast) | Video | `seedance-1.0-pro-fast` | from $0.0114/s | | [Seedance 1.5 Pro](https://docs.mixmedia.tech/en/models/seedance-1.5-pro) | Video | `seedance-1.5-pro` | from $0.0296/s | | [Veo 3.1 Quality](https://docs.mixmedia.tech/en/models/veo-3.1) | Video | `veo-3.1` | from $0.2031/s | | [Veo 3.1 Fast](https://docs.mixmedia.tech/en/models/veo-3.1-fast) | Video | `veo-3.1-fast` | from $0.0488/s | | [Veo 3.1 Lite](https://docs.mixmedia.tech/en/models/veo-3.1-lite) | Video | `veo-3.1-lite` | from $0.0244/s | | [Wan 3.0](https://docs.mixmedia.tech/en/models/wan-3.0) | Video | `wan-3.0` | from $0.0536/s | | [Wan 2.7](https://docs.mixmedia.tech/en/models/wan-2.7) | Video | `wan-2.7` | from $0.104/s | | [Wan 2.5](https://docs.mixmedia.tech/en/models/wan-2.5) | Video | `wan-2.5` | from $0.0863/s | | [Wan 2.2 Fast](https://docs.mixmedia.tech/en/models/wan-2.2-i2v-fast) | Video | `wan-2.2-i2v-fast` | from $0.0169/s | | [Nano Banana](https://docs.mixmedia.tech/en/models/nano-banana-classic) | Image | `google/nano-banana-edit` | 1K $0.03 · 2K $0.03 | | [Product cards](https://docs.mixmedia.tech/en/models/product-cards) | Set of 1/3/5 | `product-cards` | 10 ₽ | Image prices are per image and depend on the resolution (0.5K costs the same as 1K); video prices are per second of the clip; text is per 1M input and 1M output tokens (tokens are estimated, see [Pricing](https://docs.mixmedia.tech/en/pricing)). Failed tasks are free. A product card is 10 ₽ per image in the set. --- # Product cards > A set of 1, 3 or 5 images for Wildberries, Ozon, Yandex Market and Avito. 10 ₽ per image. One product photo in, a slide or a set in the marketplace size out. The page for people: [product cards](https://mixmedia.tech/en/ai/kartochki-tovarov). In `createTask` the `model` field is `product-cards`. `marketplace-card` is the same call. In the task status, `model` stays `marketplace-card`, `service` is `cards`, and the name is “Product card · …”. ## Parameters | Field | Value | |---|---| | `input.image_urls` | 1–4 photos (https or an upload). Optional when title is set | | `input.marketplace` | `wb` \| `ozon` \| `ym` \| `avito` | | `input.count` | `1` \| `3` \| `5` | | `input.title`, `features` | Title and short features | | `input.lang` | `ru` \| `en` | | `input.scene` | Only when count is 1 | Five frames: main photo, infographic, close-up, in use, dimensions. Three is the first three of that list. `scene` does not override a set. ## Price 10 ₽ per image: a set of 5 is 50 ₽. A failed slide is refunded. Redoing one slide (`count: 1`, `setId`, `slot`, `redo: 1`) costs 10 ₽ and stays in the same set. ## Status Poll `recordInfo` with the `taskId` from the response. Until the set is finished, `state` is `generating`. The webhook is sent once, when every slide of the original set is done. `resultJson.resultUrls` lists the successful pictures in slot order. `set.slides` has the slot, scene, state and URLs. ```json { "code": 200, "msg": "success", "data": { "taskId": "task_card_…", "setId": "set_…", "count": 5, "status": "submitted", "tasks": [ { "taskId": "task_card_…", "slot": 1, "scene": "studio" } ] } } ``` --- # FLUX 3 Image > FLUX 3 Image by Black Forest Labs: photorealism, accurate text and photo edits, up to 10 references, up to 4K. FLUX 3 Image is the flagship Black Forest Labs image model. It draws from a description or edits your photos: up to 10 references for edits, merging and style transfer. Accurate text and fine detail. One model, `flux-3-image`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `flux-3-image` · 1K $0.05 · 1.5K $0.073 · 2K $0.104 · 4K $0.632 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `5:4` `4:5` `21:9` `9:21` `2:1` `1:2` `7:5` `5:7` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `1.5K` `2K` `4K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"flux-3-image","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "flux-3-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "flux-3-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `flux-3-image` · 1K $0.05 · 1.5K $0.073 · 2K $0.104 · 4K $0.632 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `5:4` `4:5` `21:9` `9:21` `2:1` `1:2` `7:5` `5:7` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `1.5K` `2K` `4K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"flux-3-image","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "flux-3-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "flux-3-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `flux-3-image`, `flux-3`, `flux3`, `flux-3-pro`, `black-forest-labs/flux-3`, `black-forest-labs/flux-3-image`, `bfl/flux-3-image`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # FLUX 3 Image Klein > FLUX 3 Klein: fast, low-cost Black Forest Labs model — pictures and photo edits up to 4K, up to 10 references. FLUX 3 Image Klein is the light open-weights member of the FLUX 3 family by Black Forest Labs. Fast pictures from a description and edits of your photos (up to 10 references), good text on images. One model, `flux-3-image-klein`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `flux-3-image-klein` · 1K $0.013 · 2K $0.021 · 4K $0.051 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` `9:21` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `output_format` | no | File format | **`png`** `jpeg` `webp` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"flux-3-image-klein","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "flux-3-image-klein", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "flux-3-image-klein", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `flux-3-image-klein` · 1K $0.013 · 2K $0.021 · 4K $0.051 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` `9:21` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `output_format` | no | File format | **`png`** `jpeg` `webp` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"flux-3-image-klein","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "flux-3-image-klein", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "flux-3-image-klein", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `flux-3-image-klein`, `flux-3-klein`, `flux3-klein`, `flux-3/klein-text-to-image`, `flux-3/klein-edit-image`, `black-forest-labs/flux-3-klein`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Flux Dev > Flux Dev: fast pictures from a description — photorealism and illustrations in seconds. Flux Dev is a Black Forest Labs model for pictures from a text description. Good at photorealism, portraits and illustrations; a picture is ready in a few seconds. ### Prompt only — the model creates the picture from scratch. ID: `flux-dev` · $0.033 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 2000 chars | | `aspect_ratio` | no | Image shape | **`1:1`** `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` `9:21` `4:5` `5:4` | | `output_format` | no | File format | **`webp`** `jpg` `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"flux-dev","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"1:1"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "flux-dev", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "1:1" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "flux-dev", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "1:1" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `flux-dev`, `black-forest-labs/flux-dev`, `black-forest-labs/flux:dev`, `flux.1-dev`, `flux-1-dev`, `flux`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT Image 2.6 > ChatGPT image model: realism, layouts and edits. 1K; 2K and 4K are an upscale of the finished picture. ### Prompt only — the model creates the picture from scratch. ID: `gpt-image-2.6-text-to-image` · $0.035–$0.265 (depends on quality and resolution) per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 32000 chars | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `1:3` `3:1` `3:2` `2:3` `4:3` `3:4` `5:4` `4:5` `16:9` `9:16` `2:1` `1:2` `21:9` `9:21` | | `output_format` | no | File format | **`png`** `jpeg` `webp` `gif` `svg` | | `background` | no | Background: `auto`, `opaque`, `transparent` (only with `png` or `webp`) | **`auto`** `opaque` `transparent` | | `moderation` | no | Accepted for compatibility with other APIs, does not change the result | **`low`** `auto` | | `quality` | no | Rendering effort; passed to ChatGPT. Changes the price (see the table below), `auto` = `medium` | **`auto`** `low` `medium` `high` `xhigh` `max` | | `complexity` | no | Планирование | `low` `medium` **`high`** | | `frame_count` | no | Кадров GIF | `2` `3` `4` `5` `6` `7` `8` **`9`** `10` `11` `12` `13` `14` `15` `16` | | `frame_duration_ms` | no | Длительность кадра GIF | `50` `100` `150` **`200`** `250` `300` `400` `500` | | `svg_model` | no | Модель для SVG | **`gpt-5.4-mini`** `gpt-5.6-sol` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2.6-text-to-image","input":{"prompt":"A cat astronaut in a neon city, cinematic light","resolution":"1K","aspect_ratio":"auto","moderation":"low","quality":"auto","complexity":"high","frame_count":"9","frame_duration_ms":"200","svg_model":"gpt-5.4-mini"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-image-2.6-text-to-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto", "complexity": "high", "frame_count": "9", "frame_duration_ms": "200", "svg_model": "gpt-5.4-mini" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-image-2.6-text-to-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto", "complexity": "high", "frame_count": "9", "frame_duration_ms": "200", "svg_model": "gpt-5.4-mini" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `gpt-image-2.6-image-to-image` · $0.035–$0.265 (depends on quality and resolution) per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 32000 chars | | `input_urls` | yes | Links to your photos (https), up to 16 | `["https://…"]` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `1:3` `3:1` `3:2` `2:3` `4:3` `3:4` `5:4` `4:5` `16:9` `9:16` `2:1` `1:2` `21:9` `9:21` | | `output_format` | no | File format | **`png`** `jpeg` `webp` | | `background` | no | Background: `auto`, `opaque`, `transparent` (only with `png` or `webp`) | **`auto`** `opaque` `transparent` | | `moderation` | no | Accepted for compatibility with other APIs, does not change the result | **`low`** `auto` | | `quality` | no | Rendering effort; passed to ChatGPT. Changes the price (see the table below), `auto` = `medium` | **`auto`** `low` `medium` `high` `xhigh` `max` | | `complexity` | no | Планирование | `low` `medium` **`high`** | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2.6-image-to-image","input":{"prompt":"Make the background a neon city at night","input_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"1K","aspect_ratio":"auto","moderation":"low","quality":"auto","complexity":"high"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-image-2.6-image-to-image", "input": { "prompt": "Make the background a neon city at night", "input_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto", "complexity": "high" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-image-2.6-image-to-image", "input": { "prompt": "Make the background a neon city at night", "input_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto", "complexity": "high" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price by quality and resolution Per picture. `auto` costs the same as `medium`. | `quality` | 1K | 2K | 4K | |---|---|---|---| | `auto` | $0.055 | $0.06 | $0.07 | | `low` | $0.035 | $0.04 | $0.05 | | `medium` | $0.055 | $0.06 | $0.07 | | `high` | $0.065 | $0.07 | $0.08 | | `xhigh` | $0.115 | $0.12 | $0.13 | | `max` | $0.25 | $0.255 | $0.265 | ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `gpt-image-2.6-text-to-image`, `gpt-image-2.6`, `gpt-image-2-6`, `gpt-image-2.6-flare`, `gpt-image-2.6-sunburst`, `gpt-image-2.6-image-to-image`, `gpt-image-2.6-edit`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - One name, `gpt-image-2.5`, for both modes: with photos the task runs as Photo → Photo. `resolution`: `1k`, `2k` or `4k` — ChatGPT draws about 1.5K; 2K and 4K are an upscale of the finished picture (Lanczos + light sharpening) to a 2048 / 4096 px long side. `quality` (`auto`, `low`, `medium`, `high`; `hd`, `xhigh`, `max` = `high`, `standard` = `medium`) is passed to ChatGPT: the size stays the same, detail changes a little; the price follows the table below. `model`: `gpt-image-2.5-flare` and `gpt-image-2.5-sunburst` are the same model. `moderation` and `mask_url` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT Image 2.5 > The ChatGPT image model: realistic photos, neat lettering, product shots and precise photo edits. ### With photos in `input`: describe what to change. ID: `gpt-image-2.5-image-to-image` · $0.05–$0.23 (depends on quality and resolution) per image · ~4 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `input_urls` | yes | Links to your photos (https), up to 16 | `["https://…"]` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `1:3` `3:1` `3:2` `2:3` `4:3` `3:4` `5:4` `4:5` `16:9` `9:16` `2:1` `1:2` `21:9` `9:21` | | `output_format` | no | File format | **`png`** `jpeg` `webp` | | `background` | no | Background: `auto`, `opaque`, `transparent` (only with `png` or `webp`) | **`auto`** `opaque` `transparent` | | `moderation` | no | Accepted for compatibility with other APIs, does not change the result | **`low`** `auto` | | `quality` | no | Rendering effort; passed to ChatGPT. Changes the price (see the table below), `auto` = `medium` | **`auto`** `low` `medium` `high` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2.5-image-to-image","input":{"prompt":"Make the background a neon city at night","input_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"1K","aspect_ratio":"auto","moderation":"low","quality":"auto"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-image-2.5-image-to-image", "input": { "prompt": "Make the background a neon city at night", "input_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-image-2.5-image-to-image", "input": { "prompt": "Make the background a neon city at night", "input_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Prompt only — the model creates the picture from scratch. ID: `gpt-image-2.5-text-to-image` · $0.05–$0.23 (depends on quality and resolution) per image · ~1.5 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `1:3` `3:1` `3:2` `2:3` `4:3` `3:4` `5:4` `4:5` `16:9` `9:16` `2:1` `1:2` `21:9` `9:21` | | `output_format` | no | File format | **`png`** `jpeg` `webp` | | `background` | no | Background: `auto`, `opaque`, `transparent` (only with `png` or `webp`) | **`auto`** `opaque` `transparent` | | `moderation` | no | Accepted for compatibility with other APIs, does not change the result | **`low`** `auto` | | `quality` | no | Rendering effort; passed to ChatGPT. Changes the price (see the table below), `auto` = `medium` | **`auto`** `low` `medium` `high` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-image-2.5-text-to-image","input":{"prompt":"A cat astronaut in a neon city, cinematic light","resolution":"1K","aspect_ratio":"auto","moderation":"low","quality":"auto"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-image-2.5-text-to-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-image-2.5-text-to-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "resolution": "1K", "aspect_ratio": "auto", "moderation": "low", "quality": "auto" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price by quality and resolution Per picture. `auto` costs the same as `medium`. | `quality` | 1K | 2K | 4K | |---|---|---|---| | `auto` | $0.05 | $0.05 | $0.06 | | `low` | $0.05 | $0.05 | $0.05 | | `medium` | $0.05 | $0.05 | $0.06 | | `high` | $0.07 | $0.14 | $0.23 | ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `gpt-image-2.5-image-to-image`, `gpt-image-2-image-to-image`, `gpt-image-2.5-text-to-image`, `gpt-image-2-text-to-image`, `gpt-image-2.5`, `gpt-image-2-5`, `gpt-image-2.5-flare`, `gpt-image-2.5-sunburst`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - One name, `gpt-image-2.5`, for both modes: with photos the task runs as Photo → Photo. `resolution`: `1k`, `2k` or `4k` — ChatGPT draws about 1.5K; 2K and 4K are an upscale of the finished picture (Lanczos + light sharpening) to a 2048 / 4096 px long side. `quality` (`auto`, `low`, `medium`, `high`; `hd`, `xhigh`, `max` = `high`, `standard` = `medium`) is passed to ChatGPT: the size stays the same, detail changes a little; the price follows the table below. `model`: `gpt-image-2.5-flare` and `gpt-image-2.5-sunburst` are the same model. `moderation` and `mask_url` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Nano Banana 2.1 > Google's main image model: fast pictures and photo edits, accurate text on images, up to 10 photos at once. Nano Banana 2.1 is Google's main image model. It keeps faces and characters recognisable, writes readable text on pictures, understands long detailed descriptions and can use up to 10 of your photos to edit, combine or copy a style. One model, `nano-banana-2`: no photos = generate from scratch; with photos = edit or references. ### With photos in `input`: describe what to change. ID: `nano-banana-2` · 0.5K $0.025 · 1K $0.025 · 2K $0.035 · 4K $0.04 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `image_input` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` `1:4` `4:1` `1:8` `8:1` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `0.5K` **`1K`** `2K` `4K` | | `output_format` | no | File format | **`jpg`** `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-2","input":{"prompt":"Make the background a neon city at night","image_input":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-2", "input": { "prompt": "Make the background a neon city at night", "image_input": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-2", "input": { "prompt": "Make the background a neon city at night", "image_input": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Prompt only — the model creates the picture from scratch. ID: `nano-banana-2` · 0.5K $0.025 · 1K $0.025 · 2K $0.035 · 4K $0.04 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` `1:4` `4:1` `1:8` `8:1` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `0.5K` **`1K`** `2K` `4K` | | `output_format` | no | File format | **`jpg`** `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-2","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-2", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-2", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `nano-banana-2`, `nano-banana-2.1`, `google/nano-banana-2.1`, `google/nano-banana-2`, `nano-banana-2-ext`, `gemini-3.1-flash-image-preview`, `gemini-3.1-flash-image-preview-official`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Nano Banana Pro > Google's top model: best quality, complex scenes, posters and infographics. Nano Banana Pro is Google's most capable image model for complex scenes, infographics, posters and photo-realistic pictures. You can add up to 8 of your photos. One model, `nano-banana-pro`: no photos = generate from scratch; with photos = edit or references. ### With photos in `input`: describe what to change. ID: `nano-banana-pro` · 1K $0.05 · 2K $0.055 · 4K $0.065 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 10000 chars | | `image_input` | yes | Links to your photos (https), up to 8 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `output_format` | no | File format | **`png`** `jpg` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-pro","input":{"prompt":"Make the background a neon city at night","image_input":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-pro", "input": { "prompt": "Make the background a neon city at night", "image_input": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-pro", "input": { "prompt": "Make the background a neon city at night", "image_input": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Prompt only — the model creates the picture from scratch. ID: `nano-banana-pro` · 1K $0.05 · 2K $0.055 · 4K $0.065 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 10000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` `4K` | | `output_format` | no | File format | **`png`** `jpg` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-pro","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-pro", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-pro", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `nano-banana-pro`, `google/nano-banana-pro`, `nano-banana-pro-ext`, `gemini-3-pro-image-preview`, `gemini-3-pro-image-preview-official`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Nano Banana Lite > The fastest and cheapest Nano Banana: pictures from a description and edits of your photos. ### With photos in `input`: describe what to change. ID: `nano-banana-lite-edit` · 1K $0.02 · 2K $0.02 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | | `output_format` | no | File format | **`png`** `jpeg` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-lite-edit","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-lite-edit", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-lite-edit", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Prompt only — the model creates the picture from scratch. ID: `nano-banana-lite` · 1K $0.02 · 2K $0.02 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | | `output_format` | no | File format | **`png`** `jpeg` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-lite","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-lite", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-lite", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `nano-banana-lite-edit`, `google/nano-banana-lite-edit`, `nano-banana-2-lite-edit`, `nano-banana-lite`, `google/nano-banana-lite`, `nano-banana-2-lite`, `google/nano-banana-2-lite`, `gemini-3.1-flash-lite-image`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. - Photos sent to `nano-banana-lite` route the task to `nano-banana-lite-edit`. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedream Pro > ByteDance's top image model: accurate text, up to 2K, up to 10 photos. Seedream Pro is ByteDance's flagship image model. 1K, 1.5K and 2K pictures from a description or your photos (up to 10). Strong text on images and character consistency. One model, `seedream-pro`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `seedream-pro` · 1K $0.05 · 1.5K $0.05 · 2K $0.095 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 2000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `4:3` `3:4` `16:9` `9:16` `3:2` `2:3` `2:1` `1:2` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`1.5K`** `2K` | | `output_format` | no | File format | **`jpeg`** `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-pro","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1.5K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedream-pro", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1.5K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedream-pro", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1.5K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `seedream-pro` · 1K $0.05 · 1.5K $0.05 · 2K $0.095 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 2000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `4:3` `3:4` `16:9` `9:16` `3:2` `2:3` `2:1` `1:2` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`1.5K`** `2K` | | `output_format` | no | File format | **`jpeg`** `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-pro","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1.5K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedream-pro", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1.5K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedream-pro", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1.5K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `seedream-pro`, `seedream-5-0-pro`, `seedream-5.0-pro`, `doubao-seedream-5-0-pro`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedream 5.5 > Seedream 5.5 by ByteDance: pictures up to 2K, up to 10 references, transparent PNG and layer decomposition. Seedream 5.5 is the new ByteDance image model. It draws from a description and edits your photos (up to 10 references), keeps characters consistent and writes readable text. 1K comes from the provider; 1.5K and 2K are an upscale of that picture on our side. You can get a transparent PNG or split a layout into layers (one reference). One model, `seedream-5.5`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `seedream-5.5` · 1K $0.04 · 1.5K $0.04 · 2K $0.045 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` `1.5K` **`2K`** | | `output_format` | no | File format | **`png`** `jpeg` | | `background` | no | Background: `auto`, `opaque`, `transparent` (only with `png` or `webp`) | **`auto`** `opaque` `transparent` | | `layer_decomposition` | no | Разбор на слои | `true` `false` (default `false`) | | `max_images` | no | Макс. слоёв | `2` `5` `10` `20` **`30`** `50` `100` | | `text_recognition` | no | Распознать текст на слоях | `true` `false` (default `false`) | | `watermark` | no | "AI" mark | `true` `false` (default `false`) | | `nsfw_check` | no | Проверка контента | `true` `false` (default `false`) | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-5.5","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"2K","max_images":"30"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedream-5.5", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K", "max_images": "30" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedream-5.5", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K", "max_images": "30" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `seedream-5.5` · 1K $0.04 · 1.5K $0.04 · 2K $0.045 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` `1.5K` **`2K`** | | `output_format` | no | File format | **`png`** `jpeg` | | `background` | no | Background: `auto`, `opaque`, `transparent` (only with `png` or `webp`) | **`auto`** `opaque` `transparent` | | `layer_decomposition` | no | Разбор на слои | `true` `false` (default `false`) | | `max_images` | no | Макс. слоёв | `2` `5` `10` `20` **`30`** `50` `100` | | `text_recognition` | no | Распознать текст на слоях | `true` `false` (default `false`) | | `watermark` | no | "AI" mark | `true` `false` (default `false`) | | `nsfw_check` | no | Проверка контента | `true` `false` (default `false`) | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-5.5","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"2K","max_images":"30"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedream-5.5", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K", "max_images": "30" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedream-5.5", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K", "max_images": "30" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `seedream-5.5`, `seedream-5-5`, `seedream/5-5`, `seedream/5-5-text-to-image`, `seedream/5-5-image-to-image`, `bytedance/seedream-5.5`, `csdream-5.5`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedream Flash > Fast Seedream: pictures up to 2K from a description or a photo. Seedream Flash is the fast Seedream 5.0 image model. 1K, 1.5K and 2K from a description or your photos (up to 10). Good for drafts and quick edits. One model, `seedream-flash`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `seedream-flash` · 1K $0.025 · 1.5K $0.025 · 2K $0.025 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 2000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `4:3` `3:4` `16:9` `9:16` `3:2` `2:3` `2:1` `1:2` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`1.5K`** `2K` | | `output_format` | no | File format | **`jpeg`** `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-flash","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1.5K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedream-flash", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1.5K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedream-flash", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1.5K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `seedream-flash` · 1K $0.025 · 1.5K $0.025 · 2K $0.025 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 2000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `4:3` `3:4` `16:9` `9:16` `3:2` `2:3` `2:1` `1:2` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`1.5K`** `2K` | | `output_format` | no | File format | **`jpeg`** `png` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedream-flash","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1.5K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedream-flash", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1.5K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedream-flash", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1.5K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `seedream-flash`, `seedream-5-0-flash`, `seedream-5.0-flash`, `doubao-seedream-5-0-flash`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # MiniMax H3 Image > MiniMax H3 Image: pictures up to 4K and edits from up to 16 references, accurate text on the image. MiniMax H3 Image is a MiniMax model for pictures up to 4K (about 16 megapixels). It draws from a description and edits your photos: up to 16 references, aspect ratios roughly from 1:3 to 3:1. Strong text rendering. The prompt can be expanded automatically before generation. One model, `minimax-h3-image`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `minimax-h3-image` · 1K $0.035 · 2K $0.035 · 4K $0.105 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `5:4` `4:5` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`2K`** `4K` | | `output_format` | no | File format | `png` **`jpeg`** `webp` | | `prompt_optimizer` | no | Усилить описание | `true` `false` (default `true`) | | `output_compression` | no | Сжатие JPEG/WebP | `80` `90` **`95`** `100` | | `watermark` | no | "AI" mark | `true` `false` (default `false`) | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-image","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"2K","output_compression":"95"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `minimax-h3-image` · 1K $0.035 · 2K $0.035 · 4K $0.105 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 16 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `5:4` `4:5` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`2K`** `4K` | | `output_format` | no | File format | `png` **`jpeg`** `webp` | | `prompt_optimizer` | no | Усилить описание | `true` `false` (default `true`) | | `output_compression` | no | Сжатие JPEG/WebP | `80` `90` **`95`** `100` | | `watermark` | no | "AI" mark | `true` `false` (default `false`) | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-image","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"2K","output_compression":"95"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `minimax-h3-image`, `minimax-h3`, `minimax/h3-image`, `minimax-h3/text-to-image`, `minimax-h3/image-edit`, `hailuo-h3-image`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # MiniMax H3 Image Highspeed > MiniMax H3 Image Highspeed: the same H3 Image tools, only faster. MiniMax H3 Image Highspeed is the faster H3 Image: the same 1K, 2K and 4K, up to 16 references and photo edits, with a shorter wait. Good for drafts and short iterations. One model, `minimax-h3-image-highspeed`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `minimax-h3-image-highspeed` · 1K $0.055 · 2K $0.055 · 4K $0.195 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `5:4` `4:5` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`2K`** `4K` | | `output_format` | no | File format | `png` **`jpeg`** `webp` | | `prompt_optimizer` | no | Усилить описание | `true` `false` (default `true`) | | `output_compression` | no | Сжатие JPEG/WebP | `80` `90` **`95`** `100` | | `watermark` | no | "AI" mark | `true` `false` (default `false`) | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-image-highspeed","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"2K","output_compression":"95"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-image-highspeed", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-image-highspeed", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `minimax-h3-image-highspeed` · 1K $0.055 · 2K $0.055 · 4K $0.195 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 16 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `5:4` `4:5` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | `1K` **`2K`** `4K` | | `output_format` | no | File format | `png` **`jpeg`** `webp` | | `prompt_optimizer` | no | Усилить описание | `true` `false` (default `true`) | | `output_compression` | no | Сжатие JPEG/WebP | `80` `90` **`95`** `100` | | `watermark` | no | "AI" mark | `true` `false` (default `false`) | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-image-highspeed","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"2K","output_compression":"95"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-image-highspeed", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-image-highspeed", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K", "output_compression": "95" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `minimax-h3-image-highspeed`, `minimax-h3-highspeed`, `minimax-h3-image-fast`, `h3-image-highspeed`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling V4 Image > Kling V4 Image: 2K, 4K and 8K pictures from a prompt and up to 10 reference photos. Kling V4 Image is the new Kling (Kuaishou) model for 2K, 4K and 8K pictures. It draws from a description or from your photos: up to 10 references. Aspect ratio: auto or 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9. One model, `kling-v4-image`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `kling-v4-image` · 2K $0.075 · 4K $0.112 · 8K $0.186 per image · ~1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`2K`** `4K` `8K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-v4-image","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"2K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-v4-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-v4-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "2K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `kling-v4-image` · 2K $0.075 · 4K $0.112 · 8K $0.186 per image · ~1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`2K`** `4K` `8K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-v4-image","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"2K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-v4-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-v4-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "2K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `kling-v4-image`, `kling-image-4.0`, `kling-4.0-image`, `kling-4-0/image`, `kling-v4-image-generation`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling V4 Long Image > Kling V4 Long Image: one tall picture — a marketplace product page or a webpage mockup. Kling V4 Long Image is a Kling (Kuaishou) model for tall vertical pictures. Two layouts: "Product page" — marketplace infographics from 1–3 product photos (short 2–5 sections, medium 6–10, long 11–18), and "Webpage" — a landing page design from a description, optionally with a style photo (1st) and a subject photo (2nd). Width 1024 px (1K) or 2048 px (2K); the height depends on the content. One model, `kling-v4-long-image`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `kling-v4-long-image` · $0.279–$1.022 (depends on quality and resolution) per image · ~2.5 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `quality` | no | Rendering effort; passed to ChatGPT. Changes the price (see the table below), `auto` = `medium` | **`webpage`** `ecom-short` `ecom-medium` `ecom-long` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-v4-long-image","input":{"prompt":"A cat astronaut in a neon city, cinematic light","quality":"webpage","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-v4-long-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "quality": "webpage", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-v4-long-image", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "quality": "webpage", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `kling-v4-long-image` · $0.279–$1.022 (depends on quality and resolution) per image · ~2.5 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `image_urls` | yes | Links to your photos (https), up to 3 | `["https://…"]` | | `quality` | no | Rendering effort; passed to ChatGPT. Changes the price (see the table below), `auto` = `medium` | **`webpage`** `ecom-short` `ecom-medium` `ecom-long` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-v4-long-image","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"quality":"webpage","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-v4-long-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "quality": "webpage", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-v4-long-image", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "quality": "webpage", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price by quality and resolution Per picture. `auto` costs the same as `medium`. | `quality` | 1K | 2K | |---|---|---| | `webpage` | $0.65 | $0.706 | | `ecom-short` | $0.279 | $0.335 | | `ecom-medium` | $0.558 | $0.65 | | `ecom-long` | $0.929 | $1.022 | ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `kling-v4-long-image`, `kling-image-4.0-long`, `kling-4.0-long-image`, `kling-4-0/long-image`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # MAI Image 2.7 > MAI Image 2.7: Microsoft pictures up to 2K, edits and merges of up to 5 photos, clean text. MAI Image 2.7 is the Microsoft AI model for pictures from a description and photo edits. One photo is edited, several (up to 5) are merged. Output 1K or 2K (2048×2048 at 1:1). Strong at realistic scenes and text on the image; it understands English prompts best. One model, `mai-image-2.7`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `mai-image-2.7` · 1K $0.037 · 2K $0.146 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `aspect_ratio` | no | Image shape | **`1:1`** `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `4:5` `5:4` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"mai-image-2.7","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"1:1","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "mai-image-2.7", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "1:1", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "mai-image-2.7", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "1:1", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `mai-image-2.7` · 1K $0.037 · 2K $0.146 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `image_urls` | yes | Links to your photos (https), up to 5 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`1:1`** `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `4:5` `5:4` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"mai-image-2.7","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"1:1","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "mai-image-2.7", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "1:1", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "mai-image-2.7", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "1:1", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `mai-image-2.7`, `mai-image-2-7`, `microsoft/mai-image-2.7`, `mai-image`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # MAI Image 2.7 Flash > MAI Image 2.7 Flash: the fast, low-cost MAI Image 2.7 — pictures up to 2K and photo edits. MAI Image 2.7 Flash is the fast, low-cost version of Microsoft AI's MAI Image 2.7: the same tools (pictures from a description, edits and merges of up to 5 photos, 1K and 2K) with slightly lower quality and a quicker answer. It understands English prompts best. One model, `mai-image-2.7-flash`: no photos = generate from scratch; with photos = edit or references. ### Prompt only — the model creates the picture from scratch. ID: `mai-image-2.7-flash` · 1K $0.012 · 2K $0.043 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `aspect_ratio` | no | Image shape | **`1:1`** `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `4:5` `5:4` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"mai-image-2.7-flash","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"1:1","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "mai-image-2.7-flash", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "1:1", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "mai-image-2.7-flash", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "1:1", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With photos in `input`: describe what to change. ID: `mai-image-2.7-flash` · 1K $0.012 · 2K $0.043 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 20000 chars | | `image_urls` | yes | Links to your photos (https), up to 5 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`1:1`** `16:9` `9:16` `4:3` `3:4` `3:2` `2:3` `4:5` `5:4` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"mai-image-2.7-flash","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"1:1","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "mai-image-2.7-flash", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "1:1", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "mai-image-2.7-flash", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "1:1", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `mai-image-2.7-flash`, `mai-image-2-7-flash`, `microsoft/mai-image-2.7-flash`, `mai-image-flash`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Claude Fable 5.2 > Anthropic's smartest Claude model: hard reasoning, code, deep document analysis. You can attach pictures. Claude Fable 5.2 is the Anthropic flagship for the hardest tasks: multi-step reasoning, programming, analysis of large documents and data. It always thinks before answering, so it is slower and pricier than other models. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `claude-fable-5.2` · $10.88 / 1M input · $54.4 / 1M output · ~10 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `off` `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-fable-5.2","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "claude-fable-5.2", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "claude-fable-5.2", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $10.88 | $54.4 | **An average request costs ~$0.033 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $10.88/1M + 1 000 × $54.4/1M = $0.0555. ## Claude Fable 5.2 in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $8.32 | $41.6 | $0.208 | | Regular API | $9.6 | $48 | $0.24 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Claude Opus 5.5 > Anthropic's smartest Claude model: deep analysis, code, long and lively texts. You can attach pictures. Claude Opus 5.5 is the Anthropic flagship. Strong at programming, long-document analysis, careful reasoning and lively writing. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `claude-opus-5.5` · $4.16 / 1M input · $20.8 / 1M output · ~10 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `off` `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-opus-5.5","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "claude-opus-5.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "claude-opus-5.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $4.16 | $20.8 | **An average request costs ~$0.0086 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $4.16/1M + 1 000 × $20.8/1M = $0.0213. ## Claude Opus 5.5 in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $4.16 | $20.8 | $0.208 | | Regular API | $4.8 | $24 | $0.24 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Claude Sonnet 5.5 > Anthropic's fast and smart Claude model: texts, code, documents. You can attach pictures. Claude Sonnet 5.5 is the newest Anthropic model balancing speed, quality and price: texts, code, documents and pictures. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `claude-sonnet-5.5` · $2.08 / 1M input · $10.4 / 1M output · ~26 s on average Family Claude Sonnet, version 5.5. Other versions: `claude-sonnet-4.5` (4.5). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `off` `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-sonnet-5.5","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "claude-sonnet-5.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "claude-sonnet-5.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.08 | $10.4 | **An average request costs ~$0.0045 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.08/1M + 1 000 × $10.4/1M = $0.0107. ## Claude Sonnet 5.5 in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $2.08 | $10.4 | $0.208 | | Regular API | $2.4 | $12 | $0.24 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Claude Sonnet 4.5 > Anthropic's popular Claude Sonnet 4.5: texts, code, document analysis. You can attach pictures. Claude Sonnet 4.5 is a proven Anthropic model for writing, programming and analysing documents and pictures. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `claude-sonnet-4.5` · $2.52 / 1M input · $12.6 / 1M output · ~29 s on average Family Claude Sonnet, version 4.5. Other versions: `claude-sonnet-5.5` (5.5). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `off` `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-sonnet-4.5","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "claude-sonnet-4.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "claude-sonnet-4.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.52 | $12.6 | **An average request costs ~$0.0062 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.52/1M + 1 000 × $12.6/1M = $0.0129. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Claude Haiku 5.5 > Anthropic's fastest and most affordable Claude model: quick answers, texts, translation, picture analysis. You can attach pictures. Claude Haiku 5.5 is the newest fast Anthropic model: instant answers at a very low price. Great for everyday questions, emails, translation, summaries, classification and bulk processing of texts and pictures. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `claude-haiku-5.5` · $0.104 / 1M input · $0.52 / 1M output · ~32 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `off` `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-haiku-5.5","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "claude-haiku-5.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "claude-haiku-5.5", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $0.104 | $0.52 | Google's official price for prompts over 100k tokens is $0.52 / $2.6; our prompt limit is 30,000 characters, so it is never reached. **An average request costs ~$0.0004 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $0.104/1M + 1 000 × $0.52/1M = $0.0006. ## Claude Haiku 5.5 in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $0.104 | $0.52 | $0.0104 | | Regular API | $0.12 | $0.6 | $0.012 | Cache write is 1.25× input; a 1-hour write is 2× input. Prompts over 100k tokens: coding $0.52 / $2.6, direct API $0.6 / $3. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 4 Carbon > Google's strongest Gemini 4 model for the hardest tasks: deep reasoning, code, analysis. You can attach pictures. Gemini 4 Carbon is Google's most powerful model, built on Gemini 4 Argon. It thinks longer and double-checks its work, so it is best at hard problems: multi-step coding and debugging, deep document analysis, science and engineering questions. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-4-carbon` · $2.72 / 1M input · $13.6 / 1M output · ~9 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-4-carbon","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-4-carbon", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-4-carbon", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.72 | $13.6 | **An average request costs ~$0.0022 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.72/1M + 1 000 × $13.6/1M = $0.0139. ## Gemini 4 Carbon in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $4.16 | $20.8 | $0.208 | | Regular API | $4.8 | $24 | $0.24 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 4 Hydrogen > Google's fast everyday Gemini 4 model: texts, code, answers and picture analysis. You can attach pictures. Gemini 4 Hydrogen is the fast and efficient Gemini 4 model from Google, the successor of Gemini 3.8 Flash. Quality on par with Gemini 4 Argon, faster and cheaper. Good for everyday questions, texts, code and picture analysis. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-4-hydrogen` · $1.56 / 1M input · $7.8 / 1M output · ~8 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-4-hydrogen","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-4-hydrogen", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-4-hydrogen", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $1.56 | $7.8 | **An average request costs ~$0.0069 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $1.56/1M + 1 000 × $7.8/1M = $0.008. ## Gemini 4 Hydrogen in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $1.56 | $7.8 | $0.078 | | Regular API | $1.8 | $9 | $0.09 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 4 Argon > Google's newest Gemini 4 text model for hard tasks: reasoning, code, analysis. You can attach pictures. Gemini 4 Argon is Google's newest text model (marked «Complex tasks» in Gemini), stronger than 3.1 Pro. Good for multi-step reasoning, code, document analysis and long texts. You can attach up to 10 pictures. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-4-argon` · $2.72 / 1M input · $13.6 / 1M output · ~20 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-4-argon","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-4-argon", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-4-argon", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.72 | $13.6 | **An average request costs ~$0.0048 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.72/1M + 1 000 × $13.6/1M = $0.0139. ## Gemini 4 Argon in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $4.16 | $20.8 | $0.208 | | Regular API | $4.8 | $24 | $0.24 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 3.8 Flash > Google's newest fast Gemini Flash model: instant answers and picture analysis at a low price. Gemini 3.8 Flash is the newest fast Google model: quick answers, low price, good picture understanding. Great for everyday questions, texts and bulk processing. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-3.8-flash` · $0.78 / 1M input · $3.9 / 1M output · ~19 s on average Family Gemini Flash, version 3.8 Flash. Other versions: `gemini-3.7-flash` (3.7 Flash), `gemini-3.6-flash` (3.6 Flash). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-3.8-flash","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-3.8-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-3.8-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $0.78 | $3.9 | **An average request costs ~$0.001 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $0.78/1M + 1 000 × $3.9/1M = $0.004. ## Gemini 3.8 Flash in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $0.78 | $3.9 | $0.078 | | Regular API | $0.9 | $4.5 | $0.09 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 3.7 Flash > Google's fast Gemini 3.7 Flash: quick answers and picture analysis at a low price. You can attach pictures. Google's fast Gemini 3.7 Flash: quick answers and picture analysis at a low price. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-3.7-flash` · $0.78 / 1M input · $3.9 / 1M output · ~12 s on average Family Gemini Flash, version 3.7 Flash. Other versions: `gemini-3.8-flash` (3.8 Flash), `gemini-3.6-flash` (3.6 Flash). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-3.7-flash","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-3.7-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-3.7-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $0.78 | $3.9 | **An average request costs ~$0.0012 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $0.78/1M + 1 000 × $3.9/1M = $0.004. ## Gemini 3.7 Flash in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $0.78 | $3.9 | $0.078 | | Regular API | $0.9 | $4.5 | $0.09 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 3.6 Flash > Google's fast Gemini 3.6 Flash: answers, texts and picture analysis at a low price. You can attach pictures. Google's fast Gemini 3.6 Flash: answers, texts and picture analysis at a low price. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-3.6-flash` · $1.56 / 1M input · $7.8 / 1M output · ~10 s on average Family Gemini Flash, version 3.6 Flash. Other versions: `gemini-3.8-flash` (3.8 Flash), `gemini-3.7-flash` (3.7 Flash). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-3.6-flash","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-3.6-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-3.6-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $1.56 | $7.8 | **An average request costs ~$0.0024 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $1.56/1M + 1 000 × $7.8/1M = $0.008. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 3.1 Pro > Google's text model: answers, ideas, analysis and texts. You can attach pictures. Gemini 3.1 Pro is Google's most capable text model for reasoning, analysis and writing. You can attach up to 10 pictures. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-3.1-pro` · $2.08 / 1M input · $12.48 / 1M output · ~16 s on average Family Gemini Pro, version 3.1 Pro. Other versions: `gemini-3-pro` (3 Pro). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-3.1-pro","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-3.1-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-3.1-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.08 | $12.48 | **An average request costs ~$0.0046 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.08/1M + 1 000 × $12.48/1M = $0.0127. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini 3 Pro > Google's Gemini 3 Pro: reasoning, code, analysis, long texts. You can attach pictures. Google's Gemini 3 Pro: reasoning, code, analysis, long texts. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gemini-3-pro` · $2.08 / 1M input · $12.48 / 1M output · ~18 s on average Family Gemini Pro, version 3 Pro. Other versions: `gemini-3.1-pro` (3.1 Pro). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-3-pro","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-3-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-3-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.08 | $12.48 | **An average request costs ~$0.0044 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.08/1M + 1 000 × $12.48/1M = $0.0127. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT-6.2 Sol > OpenAI's newest everyday model (ChatGPT) GPT-6.2: fast, smart answers, texts and code. You can attach pictures. GPT-6.2 Sol is the newest main OpenAI model: fast and accurate answers, texts, translations, code, agent tasks and picture analysis at an affordable price. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gpt-6.2-sol` · $2.08 / 1M input · $10.4 / 1M output · ~12 s on average Family GPT Sol, version 6.2 Sol. Other versions: `gpt-6.1-sol` (6.1 Sol). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` `xhigh` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-6.2-sol","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-6.2-sol", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-6.2-sol", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $2.08 | $10.4 | Google's official price for prompts over 272k tokens is $4.16 / $15.6; our prompt limit is 30,000 characters, so it is never reached. **An average request costs ~$0.0026 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $2.08/1M + 1 000 × $10.4/1M = $0.0107. ## GPT-6.2 Sol in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $2.08 | $10.4 | $0.104 | | Regular API | $2.4 | $12 | $0.12 | Cache write is 1.25× input; a 1-hour write is 2.5× input. Prompts over 272k tokens: coding $4.16 / $15.6, direct API $4.8 / $18. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT-6.2 Astra > OpenAI's newest flagship (ChatGPT) GPT-6.2 Astra: hard reasoning, code, analysis, long texts. You can attach pictures. GPT-6.2 Astra is the newest OpenAI flagship for the hardest tasks: multi-step reasoning, programming and frontends, document and data analysis, long texts. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gpt-6.2-astra` · $8.32 / 1M input · $41.6 / 1M output · ~10 s on average Family GPT Astra, version 6.2 Astra. Other versions: `gpt-6-astra` (6 Astra). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` `xhigh` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-6.2-astra","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-6.2-astra", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-6.2-astra", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $8.32 | $41.6 | Google's official price for prompts over 272k tokens is $16.64 / $62.4; our prompt limit is 30,000 characters, so it is never reached. **An average request costs ~$0.0115 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $8.32/1M + 1 000 × $41.6/1M = $0.0425. ## GPT-6.2 Astra in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $8.32 | $41.6 | $0.416 | | Regular API | $9.6 | $48 | $0.48 | Cache write is 1.25× input; a 1-hour write is 2.5× input. Prompts over 272k tokens: coding $16.64 / $62.4, direct API $19.2 / $72. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT-6.1 Sol > OpenAI's newest everyday model (ChatGPT): fast, smart answers, texts and code. You can attach pictures. GPT-6.1 Sol is the newest main OpenAI model: fast and accurate answers, texts, translations, code and picture analysis at an affordable price. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gpt-6.1-sol` · $1.68 / 1M input · $8.4 / 1M output · ~12 s on average Family GPT Sol, version 6.1 Sol. Other versions: `gpt-6.2-sol` (6.2 Sol). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` `xhigh` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-6.1-sol","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-6.1-sol", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-6.1-sol", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $1.68 | $8.4 | Google's official price for prompts over 272k tokens is $3.36 / $12.6; our prompt limit is 30,000 characters, so it is never reached. **An average request costs ~$0.0021 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $1.68/1M + 1 000 × $8.4/1M = $0.0086. ## GPT-6.1 Sol in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $2.08 | $10.4 | $0.104 | | Regular API | $2.4 | $12 | $0.12 | Cache write is 1.25× input; a 1-hour write is 2.5× input. Prompts over 272k tokens: coding $4.16 / $15.6, direct API $4.8 / $18. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT-6 Astra > OpenAI's most powerful model (ChatGPT): hard reasoning, code, analysis, long texts. You can attach pictures. GPT-6 Astra is the OpenAI flagship for the hardest tasks: multi-step reasoning, programming, document and data analysis, long texts. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gpt-6-astra` · $8.4 / 1M input · $42 / 1M output · ~10 s on average Family GPT Astra, version 6 Astra. Other versions: `gpt-6.2-astra` (6.2 Astra). Each version has its own model ID. **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` `xhigh` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-6-astra","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-6-astra", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-6-astra", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $8.4 | $42 | Google's official price for prompts over 272k tokens is $16.8 / $63; our prompt limit is 30,000 characters, so it is never reached. **An average request costs ~$0.0116 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $8.4/1M + 1 000 × $42/1M = $0.0429. ## GPT-6 Astra in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $10.4 | $52 | $1.04 | | Regular API | $12 | $60 | $1.2 | Cache write is 1.25× input; a 1-hour write is 2.5× input. Prompts over 272k tokens: coding $20.8 / $78, direct API $24 / $90. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # GPT-5.6 > OpenAI's GPT-5.6 flagship (ChatGPT): code, analysis, documents and hard tasks. You can attach pictures. GPT-5.6 (Sol) is the OpenAI flagship of the 5.6 generation: programming, data and document analysis, design and complex multi-step work. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `gpt-5.6` · $4.16 / 1M input · $20.8 / 1M output · ~15 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `none` `low` **`medium`** `high` `xhigh` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gpt-5.6","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gpt-5.6", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gpt-5.6", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $4.16 | $20.8 | **An average request costs ~$0.0055 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $4.16/1M + 1 000 × $20.8/1M = $0.0213. ## GPT-5.6 in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $4.16 | $20.8 | $0.416 | | Regular API | $4.8 | $24 | $0.48 | Cache write is 1.25× input; a 1-hour write is 2.5× input. Prompts over 272k tokens: coding $8.32 / $31.2, direct API $9.6 / $36. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # DeepSeek V4 Pro > The DeepSeek flagship: reasoning, math and code at a low price. Text only. DeepSeek V4 Pro is the open flagship model from DeepSeek. It thinks before answering and is strong at math, programming and logic, while costing much less than other flagships. You pay for the actual tokens. Text only (no pictures). ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `deepseek-v4-pro` · $0.8743 / 1M input · $2.6229 / 1M output · ~14 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"deepseek-v4-pro","input":{"prompt":"Explain in simple words why the sky is blue","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "deepseek-v4-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "deepseek-v4-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $0.8743 | $2.6229 | **An average request costs ~$0.0008 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $0.8743/1M + 1 000 × $2.6229/1M = $0.0028. ## DeepSeek V4 Pro in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $0.6686 | $2.0058 | $0.0669 | | Regular API | $0.7715 | $2.3144 | $0.0771 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # DeepSeek V4.1 Flash > The fastest and cheapest DeepSeek model: answers, texts, translation and code. Text only. DeepSeek V4.1 Flash is the newest fast DeepSeek model (October 2026 release): short accurate answers, texts, translation and code at a very low price. Good for everyday questions and bulk text work. You pay for the actual tokens. Text only (no pictures). ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `deepseek-v4.1-flash` · $0.1943 / 1M input · $0.7771 / 1M output · ~37 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"deepseek-v4.1-flash","input":{"prompt":"Explain in simple words why the sky is blue","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "deepseek-v4.1-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "deepseek-v4.1-flash", "input": { "prompt": "Explain in simple words why the sky is blue", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $0.1943 | $0.7771 | **An average request costs ~$0.0006 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $0.1943/1M + 1 000 × $0.7771/1M = $0.0008. ## DeepSeek V4.1 Flash in Claude Code, Codex and the API USD per 1M tokens, same MixMedia balance. These prices are for the agent API at api.mixmedia.tech, not for `createTask` / the playground above. | | Input | Output | Cache read | |---|---|---|---| | Coding agents | $0.1486 | $0.5942 | $0.0149 | | Regular API | $0.1715 | $0.6857 | $0.0171 | Cache write is 1.25× input; a 1-hour write is 2× input. Guides: https://mixmedia.tech/en/api/guides ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kimi K3.1 Pro > The newest Kimi model from Moonshot AI: code, document and finance analysis, long texts. You can attach pictures. Kimi K3.1 Pro is the strongest Moonshot AI (Kimi) model, post-trained from Kimi K3 for programming, financial analysis and factual accuracy. It thinks before answering. Good for code, reports and documents, long texts. You pay for the actual tokens. Up to 10 pictures can be attached. ### A question or task as text — the model answers with text. Pictures in `input_urls` are optional. ID: `kimi-k3.1-pro` · $1.36 / 1M input · $6.8 / 1M output · ~15 s on average **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | Your question or task | text, up to 200000 chars | | `input_urls` | no | Pictures to analyse (https links), up to 10; each is 560 input tokens | `["https://…"]` | | `reasoning` | no | Reasoning level (default `medium`): `none`/`off` answers at once, `low` fast, `medium` balanced, `high` deeper and slower, `xhigh` maximum (where offered). Same per-token price; reasoning tokens are part of the output and are billed | `low` **`medium`** `high` | | `system_prompt` | no | Instruction for the model (role, style, rules), up to 10,000 characters | | | `messages` | no | Conversation history: `[{"role":"user","content":"…"},{"role":"assistant","content":"…"}]` — alternating, starting with `user`, ending with `assistant`; the new question goes to `prompt`. Up to 40 messages, 60,000 characters, billed as input tokens | `[{role, content}]` | | `response_format` | no | `json` — the answer is one valid JSON object | **`text`** `json` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kimi-k3.1-pro","input":{"prompt":"Explain in simple words why the sky is blue","reasoning":"medium","response_format":"text"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kimi-k3.1-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kimi-k3.1-pro", "input": { "prompt": "Explain in simple words why the sky is blue", "reasoning": "medium", "response_format": "text" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price: per token | Input, per 1M tokens | Output, per 1M tokens (incl. thinking) | |---|---| | $1.36 | $6.8 | **An average request costs ~$0.0072 (a short question, a one-page answer or a question with a photo). The price depends on length: fewer words and photos cost less.** - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. Example: a 400-character question (100 tokens) and a 4,000-character answer (1,000 tokens) = 100 × $1.36/1M + 1 000 × $6.8/1M = $0.007. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). The answer is in `resultJson.text`, token usage and the charge are in `usage` (`input_tokens`, `output_tokens`, `cost`). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Suno > Songs with vocals and music from a description or your own lyrics. Two tracks per run, MP3. Suno V6 is the main Suno model: natural vocals, rich arrangements and expressive music. Describe a song and the lyrics are written for you, or turn on «Own lyrics and style» to set the words, title, genre, voice and length (up to 6 minutes). Each run gives two different tracks in MP3. Price per run. ID: `suno-v6` · $0.09 per run (2 MP3 tracks) · under 1 min **Parameters** (field `input`). Settings other than prompt, custom_mode and instrumental apply when custom_mode=true. | Field | Type | Values | Description | |---|---|---|---| | `mode` | string | generate, extend, cover, add_vocals, add_instrumental, mashup, stems, stems_all, wav, lyrics, sounds, voice_validate, voice_regenerate, voice_create, voice_check | Mode (default generate): generate, extend, cover, add_vocals, add_instrumental, mashup, stems, stems_all, wav, lyrics, sounds, voice_validate, voice_regenerate, voice_create, voice_check — see «Modes» below | | `source_task_id` | string | up to 120 chars | Track modes: id of your finished Suno task (files are kept 24 hours) | | `track` | integer | up to 16 chars | Track number in that task, from 1 (default 1) | | `audio_url` | string | up to 2000 chars | Or your own audio: an https link to MP3/WAV up to 8 min (instead of source_task_id) | | `source_task_id_2` | string | up to 120 chars | mashup: the second track (task) | | `track_2` | integer | up to 16 chars | mashup: second track number | | `audio_url_2` | string | up to 2000 chars | mashup: the second track (link) | | `continue_at` | integer | up to 480 chars | extend: the second to continue from (default: the end) | | `bpm` | integer | up to 300 chars | sounds: tempo 1–300 | | `persona_id` | string | up to 120 chars | «My voice»: the voice from voice_create (`resultJson.voice.voice_id` or that task id). Same price as a regular song | | `voice_task_id` | string | up to 120 chars | voice_regenerate / voice_create: the voice_validate task; voice_check: the voice_create task | | `vocal_start_s` | integer | up to 600 chars | voice_validate: start of the voice fragment, s | | `vocal_end_s` | integer | up to 660 chars | voice_validate: end of the fragment (10–60 s after the start) | | `language` | string | up to 10 chars | voice_validate: phrase language (ru, en, …) | | `voice_name` | string | up to 80 chars | voice_create: voice name | | `voice_description` | string | up to 500 chars | voice_create: voice description | | `singer_skill_level` | string | beginner, intermediate, advanced, professional | voice_create: singing level | | `version` | string | v6, v6-wild, v6-mini, v5.5, v5, v4.5-plus, v4.5-all, v4.5, v4 | Version: v6 (default), v6-wild, v6-mini, v5.5, v5, v4.5-plus, v4.5-all, v4.5, v4. Same price | | `prompt` | string | up to 5000 chars | custom_mode=false: what the song is about (up to 3000 characters), lyrics are written for you. custom_mode=true: your lyrics (up to 5000), [Verse]/[Chorus] tags allowed | | `custom_mode` | boolean | false | true — your own lyrics and the settings below (title required) | | `instrumental` | boolean | false | true — no vocals | | `title` | string | up to 80 chars | Title, up to 80 characters (custom_mode=true) | | `style` | string | up to 1000 chars | Genre, instruments, mood, up to 1000 characters | | `negative_tags` | string | up to 1000 chars | What to avoid in the sound | | `vocal_gender` | string | auto, female, male | Voice: female, male or auto | | `duration` | string | auto, 10…360 | Target length, 10–360 s or auto | | `variety` | string | auto, off, normal, high, extra, max | Variety of the results | | `style_weight` | string | auto, 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1 | 0–1: how strictly to follow the style | | `weirdness_constraint` | string | auto, 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1 | 0–1: boldness | | `audio_weight` | string | auto, 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1 | 0–1: sound weight (not for instrumental) | **Example: a song from a description** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"suno-v6","input":{"prompt":"A cheerful birthday song for mum Olga, pop, female vocal"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "suno-v6", "input": { "prompt": "A cheerful birthday song for mum Olga, pop, female vocal" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "suno-v6", "input": { "prompt": "A cheerful birthday song for mum Olga, pop, female vocal" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` **Example: your own lyrics** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"suno-v6","input":{"custom_mode":true,"title":"Summer evening","prompt":"[Verse]\nWarm wind, the sea is near\n[Chorus]\nSummer evening, you are here","style":"acoustic pop, guitar, warm","vocal_gender":"female","duration":"120"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "suno-v6", "input": { "custom_mode": True, "title": "Summer evening", "prompt": "[Verse]\nWarm wind, the sea is near\n[Chorus]\nSummer evening, you are here", "style": "acoustic pop, guitar, warm", "vocal_gender": "female", "duration": "120" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "suno-v6", "input": { "custom_mode": true, "title": "Summer evening", "prompt": "[Verse]\nWarm wind, the sea is near\n[Chorus]\nSummer evening, you are here", "style": "acoustic pop, guitar, warm", "vocal_gender": "female", "duration": "120" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Modes The `mode` field picks the action. The price is fixed per run and does not depend on the other fields. Track modes take `source_task_id` (+ `track`) of your finished Suno task — while its files are kept (24 hours) — or `audio_url` (your MP3/WAV up to 8 min). `wav` and `video` accept only Suno songs made on MixMedia. | mode | What it does | Result | Price | |---|---|---|---| | `generate` | A new song from a description or your lyrics | 2 MP3 tracks | $0.09 | | `extend` | Continue a track from `continue_at` | 2 MP3 tracks | $0.09 | | `cover` | Same melody in a new style / voice / lyrics | 2 MP3 tracks | $0.09 | | `add_vocals` | Singing over an instrumental (`prompt` = lyrics, `style`) | 2 MP3 tracks | $0.09 | | `add_instrumental` | Music under a vocal (`style`) | 2 MP3 tracks | $0.09 | | `mashup` | Blend two tracks (`…_2` = the second) | 2 MP3 tracks | $0.09 | | `stems` | Vocals + instrumental | 2 files, `tracks[].title` = stem | $0.075 | | `stems_all` | All stems (vocals, drums, bass, …) | up to 12 MP3 files | $0.375 | | `wav` | The track as uncompressed WAV | 1 WAV file | $0.005 | | `lyrics` | Lyrics from a theme (`prompt` up to 200 chars) | `resultJson.text` | $0.015 | | `sounds` | A sound / effect from a description (`prompt` up to 500, `bpm`) | MP3 | $0.02 | | `voice_validate` | Own voice, step 1: a voice sample (`audio_url`, fragment `vocal_start_s`…`vocal_end_s`, 10–60 s) → a phrase to read. Free | `resultJson.text` = phrase, `resultJson.voice` | $0 | | `voice_regenerate` | A new phrase for `voice_task_id` (the step 1 task). Free | `resultJson.text` = phrase | $0 | | `voice_create` | Own voice, step 2: the reading of the phrase (`audio_url`) + `voice_task_id` of step 1 → the voice. Free | `resultJson.voice.voice_id` → `persona_id` | $0 | | `voice_check` | Is the voice usable (`voice_task_id` of the voice_create task). Free | `resultJson.voice.available` | $0 | **Example: extend a track** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"suno-v6","input":{"mode":"extend","source_task_id":"task_suno-v6_…","track":1,"continue_at":60,"style":"acoustic pop"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "suno-v6", "input": { "mode": "extend", "source_task_id": "task_suno-v6_…", "track": 1, "continue_at": 60, "style": "acoustic pop" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "suno-v6", "input": { "mode": "extend", "source_task_id": "task_suno-v6_…", "track": 1, "continue_at": 60, "style": "acoustic pop" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` **Example: split into vocals and backing** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"suno-v6","input":{"mode":"stems","audio_url":"https://example.com/song.mp3"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "suno-v6", "input": { "mode": "stems", "audio_url": "https://example.com/song.mp3" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "suno-v6", "input": { "mode": "stems", "audio_url": "https://example.com/song.mp3" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` **Example: lyrics** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"suno-v6","input":{"mode":"lyrics","prompt":"a song about friendship and summer camp"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "suno-v6", "input": { "mode": "lyrics", "prompt": "a song about friendship and summer camp" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "suno-v6", "input": { "mode": "lyrics", "prompt": "a song about friendship and summer camp" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Price $0.09 per run — the answer always has two different tracks. Parameters (length, style, lyrics) do not change the price. A failure is refunded in full. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Links to the two MP3 tracks are in `resultJson.resultUrls` (kept for 24 hours — download right away). Cover art is in `resultJson.coverUrls`. `resultJson.tracks` has one object per track: `id`, `audioUrl`, `imageUrl`, `title`, `tags`, `lyrics`, `duration` (s). ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini Omni 1.2 Flash > Gemini Omni 1.2 Flash: 3–15 second clips from 360p to 4K — from text, frames, references or a video edit. Gemini Omni 1.2 Flash is a Google video model. It makes 3 to 15 second clips in 360p, 720p, 1080p or 4K, horizontal (16:9) or vertical (9:16): from a description, from the first and last frame (up to 10 seconds), from references (up to 10 images including frames), or it edits / extends a clip of up to 15 seconds. You pay per second; the rate depends on quality. One model, `gemini-omni-1.2-flash` · under 1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `video_mode`: `auto` · `reference` · `edit` · `extend` ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 360p | $0.026 | $0.026 | | 720p | $0.059 | $0.059 | | 1080p | $0.065 | $0.065 | | 4k | $0.143 | $0.143 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **8**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **1**; total ≤ **15 s** (each clip 2…15 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 8 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 1 | | `video_mode` | Task type for your video: `auto` (default) — the model works it out from the description, `reference` — reference, `edit` — edit (length and aspect ratio follow your video), `extend` — extend. Omitted = `auto` | **`auto`** · `reference` · `edit` · `extend` | | `resolution` | Video resolution | `360p` · **`720p`** · `1080p` · `4k` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` | | `duration` | Video duration in seconds | 3 to 15 (default **`5`**) | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 15 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 15 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-1.2-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-1.2-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-1.2-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-1.2-flash","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-1.2-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-1.2-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-1.2-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-1.2-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-1.2-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-1.2-flash","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-1.2-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-1.2-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 15 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-1.2-flash","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","aspect_ratio":"16:9","duration":"5","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-1.2-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-1.2-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Gemini Omni Flash > Gemini Omni Flash animates a photo: a 4–10 second clip from 360p up to 4K, horizontal or vertical. Gemini Omni Flash is a Google video model. Upload a photo and describe the motion — you get a 4, 6, 8 or 10 second clip in 360p, 720p, 1080p or 4K, horizontal (16:9) or vertical (9:16). You pay per clip; the price depends on quality and length. One model, `gemini-omni-flash` · ~1.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 360p | $0.049 | | 720p | $0.082 | | 1080p | $0.082 | | 4k | $0.244 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars (optional, default empty) | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `resolution` | Video resolution | `360p` · **`720p`** · `1080p` · `4k` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` | | `duration` | Video duration in seconds | `4` **`6`** `8` `10` | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"6"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "6" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "6" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"gemini-omni-flash","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","aspect_ratio":"16:9","duration":"6"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "gemini-omni-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "6" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "gemini-omni-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "6" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Grok Imagine 1.5 > xAI video model: clips up to 15 seconds from a description or your photos, up to 1080p. Grok Imagine 1.5 is the new xAI video model. It films 1 to 15 second clips in 480p, 720p and 1080p from a description or your photos (up to 7). Strong motion, light and character acting. You pay per second of the clip; each attached photo adds a small fee. One model, `grok-imagine-1.5` · under 1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `nsfw_check` — check before charge ## Price | Resolution | Price per second | |---|---| | 480p | $0.096 | | 720p | $0.168 | | 1080p | $0.3 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - Each attached photo adds $0.012. ## Media limits | Type | Limits | |---|---| | Images | up to **7**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | Photos — public https or upload; video and audio — files/upload only. ## How the task is shaped | Fields | Mode | |---|---| | `prompt` only | text → video | | `image_urls` | photos → video (up to 7) | Upstream rejects `aspect_ratio` «auto» — text defaults to `16:9`; with a photo the frame follows the photo. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 8000 chars | | `image_urls` | Your photos (https): a single photo becomes the first frame | `["https://…"]`, up to 7 | | `resolution` | Video resolution | **`480p`** · `720p` · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `4:3` · `3:4` · `3:2` · `2:3` | | `duration` | Video duration in seconds | 1 to 15 (default **`8`**) | | `nsfw_check` | Content check: the description and photos are checked first; if not allowed, no task is created and nothing is charged | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"grok-imagine-1.5","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"480p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "grok-imagine-1.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "480p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "grok-imagine-1.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "480p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"grok-imagine-1.5","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"480p","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "grok-imagine-1.5", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "480p", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "grok-imagine-1.5", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "480p", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Grok Imagine > xAI video up to 15 seconds from a description or a photo; it can also change your video. Grok Imagine is an xAI video model. It films 1 to 15 second clips in 480p and 720p from a description or your photos (up to 7), and changes a finished clip from a description: style, clothes, background. For editing use a clip up to 8 seconds — the result has the same length. You pay per second of the clip; when editing, per second of the source clip. One model, `grok-imagine` · ~1.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `nsfw_check` — check before charge - Clip edit via `video_urls` (up to 8 s) ## Price | Resolution | Price per second | |---|---| | 480p | $0.065 | | 720p | $0.084 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - Each attached photo adds $0.0024. - With an uploaded video: $0.096 per second of the source clip (up to 8 s); the result has the same length. `resolution`, `aspect_ratio` and `duration` are not needed — they come from the clip. ## Media limits | Type | Limits | |---|---| | Images | up to **7**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **1**; total ≤ **8 s** (each clip 2…8 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## How the task is shaped | Fields | Mode | |---|---| | `prompt` only | text → video | | `image_urls` | photos → video (up to 7) | | `video_urls` | edit clip (up to 8 s); `resolution` / `aspect_ratio` / `duration` come from the clip | Upstream rejects `aspect_ratio` «auto» — text defaults to `16:9`; with a photo the frame follows the photo. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 8000 chars | | `image_urls` | Your photos (https): a single photo becomes the first frame | `["https://…"]`, up to 7 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 1 | | `resolution` | Video resolution | **`480p`** · `720p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `4:3` · `3:4` · `3:2` · `2:3` | | `duration` | Video duration in seconds | 1 to 15 (default **`8`**) | | `nsfw_check` | Content check: the description and photos are checked first; if not allowed, no task is created and nothing is charged | `true` `false` (default `false`) | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 8 | | `auto_trim` | If your clips together are longer than 8 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"grok-imagine","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"480p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "grok-imagine", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "480p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "grok-imagine", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "480p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"grok-imagine","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"480p","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "grok-imagine", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "480p", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "grok-imagine", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "480p", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"grok-imagine","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"]}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "grok-imagine", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ] } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "grok-imagine", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ] } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clip: up to 8 s. No need to cut a long clip beforehand: `auto_trim: true` cuts it to 8 s, `trim_video_to: N` to N s (the beginning stays). Trimming is free; the price uses the trimmed seconds. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"grok-imagine","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "grok-imagine", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "grok-imagine", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Higgsfield Genjutsu > One clip, three modes: motion transfer, object swap and restyle. 4 to 30 seconds, up to 1080p. Higgsfield Genjutsu takes a finished clip and changes the reality in it without reshooting the motion. Motion transfer builds a new scene from your photos — a character, a place, a style — and keeps the original motion, camera and timing. Object swap changes a chosen person, outfit, product or object. The rest of the shot stays as filmed. Restyle applies a chosen visual style and keeps the clip’s motion and original audio. Photos are optional: without them the style is applied to whoever is already in the frame. The video is at least 4 seconds; longer than 30 seconds is trimmed to 30. Resolution is 480p, 720p or 1080p. The prompt is optional. Every mode costs the same, per second of your clip. One model, `higgsfield-genjutsu` · ~3 min. The mode is the `input.mode` field. ## Modes One ID, `higgsfield-genjutsu`. `input.mode` chooses what happens to the clip. Omitted, it is motion transfer. The official ids work too: `higgsfield/genjutsu/object-swap/v1.0` and `higgsfield/genjutsu/restyle/v1.0` select the mode, so `mode` can be left out. | `mode` | What it does | What to send | |---|---|---| | `motion-transfer` | Motion, camera and timing come from the video; the look comes from the photos | `video_url` + `image_urls` (1–8) | | `object-swap` | Replaces a person, outfit or object in the clip. The rest of the shot stays | `video_url` + `image_urls` (1–8) | | `restyle` | The same clip in a chosen style. The source motion and audio stay | `video_url` + `preset_id`. `image_urls` — optional, up to 5 | Shared by all three: the video is at least 4 seconds, longer than 30 seconds is trimmed to 30, and the result has the same length. `prompt` may be omitted. `resolution`: `480p`, `720p` (default) or `1080p`. The mode does not change the price. Object swap needs a source frame of at least 409,600 pixels (width × height). Ordinary HD is fine; a tiny preview is not. ### Styles for restyle Style list: `GET https://mixmedia.tech/api/v1/genjutsu/presets`. No key. `preset_id` is the item's `id`, not its name and not the preview image. ```json { "code": 200, "msg": "success", "data": { "items": [ { "id": "c2143317-f28d-4c3c-a0b8-39bd547e08a7", "name": "Cel-Shaded CG Anime", "preview_url": "https://…/style.webp" } ] } } ``` The list changes. If a saved `preset_id` is no longer accepted, fetch the list again and use a current id. ## Price | Resolution | Price per second of your video | |---|---| | 480p | $0.414 | | 720p | $0.886 | | 1080p | $2.122 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - You pay per second of your video (4 to 30 s). A clip longer than 30 s is trimmed to 30; the result has the same length. `prompt` may be omitted. ## Media limits | Type | Limits | |---|---| | Images | **1–8** for motion transfer and object swap; **0–5** for restyle. JPG / PNG / WebP; public https or [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Video | one clip, `video_url`; **4 s** to **30 s** (longer is trimmed to 30); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `mode` | Mode: `motion-transfer` copies motion onto your photos, `object-swap` replaces a person or object, `restyle` keeps the clip and applies a style. Omit it when calling an official model id: `…/object-swap/v1.0` and `…/restyle/v1.0` select the mode themselves | **`motion-transfer`** · `object-swap` · `restyle` | | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 10000 chars (optional, default empty) | | `video_url` | Motion video (MP4): one clip, at least 4 s. Longer than 30 s is trimmed to 30. Upload it via files/upload first | `"https://…"` | | `image_urls` | Character photos (https): look, face, clothes | `["https://…"]`, up to 8 | | `preset_id` | Style for `restyle`: a UUID from `GET /api/v1/genjutsu/presets`. Not used by the other modes | style UUID, required when `mode` is `restyle` | | `resolution` | Video resolution | `480p` · **`720p`** · `1080p` | ## Examples ### Motion transfer ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"higgsfield-genjutsu","input":{"mode":"motion-transfer","prompt":"Keep the face from the photo, take the motion from the video","video_url":"https://mixmedia.tech/files/.mp4","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "higgsfield-genjutsu", "input": { "mode": "motion-transfer", "prompt": "Keep the face from the photo, take the motion from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "higgsfield-genjutsu", "input": { "mode": "motion-transfer", "prompt": "Keep the face from the photo, take the motion from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Object swap ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"higgsfield-genjutsu","input":{"mode":"object-swap","prompt":"Replace the person with the character in the photo","video_url":"https://mixmedia.tech/files/.mp4","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "higgsfield-genjutsu", "input": { "mode": "object-swap", "prompt": "Replace the person with the character in the photo", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "higgsfield-genjutsu", "input": { "mode": "object-swap", "prompt": "Replace the person with the character in the photo", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Restyle ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"higgsfield-genjutsu","input":{"mode":"restyle","video_url":"https://mixmedia.tech/files/.mp4","preset_id":"","resolution":"720p"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "higgsfield-genjutsu", "input": { "mode": "restyle", "video_url": "https://mixmedia.tech/files/.mp4", "preset_id": "", "resolution": "720p" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "higgsfield-genjutsu", "input": { "mode": "restyle", "video_url": "https://mixmedia.tech/files/.mp4", "preset_id": "", "resolution": "720p" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 4.0 Flash > Kling 4.0 Flash: a fast Kuaishou model in 720p — 3–20 second clips from text, a first frame or references. Kling 4.0 Flash is the fast Kling 4.0 from Kuaishou. 720p only, 3 to 20 seconds: clips from text, from a first frame, from references (up to 10 photos, 5 videos and 3 audio clips), an edit of a finished clip, or an extend. Aspects 16:9, 9:16, 1:1, 21:9, or auto in reference mode. You pay per second. Full Kling 4.0 is still available when you need 1080p or clips up to 30 seconds. One model, `kling-4.0-flash` · ~2 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 720p | $0.112 | $0.112 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **10**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **5**; total ≤ **20 s** (each clip 2…20 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **3**; total ≤ **20 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 10 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 5 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `video_mode` | Task type for your video: `auto` (default) — the model works it out from the description, `reference` — reference, `edit` — edit (length and aspect ratio follow your video), `extend` — extend. Omitted = `auto` | **`auto`** · `reference` · `edit` · `extend` | | `resolution` | Video resolution | **`720p`** | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `21:9` · `auto` | | `duration` | Video duration in seconds | 3 to 20 (default **`5`**) | | `audio_setting` | Sound | **`auto`** `origin` | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 20 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 20 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0-flash","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5","audio_setting":"auto"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "audio_setting": "auto" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "audio_setting": "auto" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0-flash","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","audio_setting":"auto"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 20 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0-flash","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","audio_setting":"auto","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 4.0 > Kling 4.0 by Kuaishou: one model for text, frames (up to 10), photo/video/audio refs, edit and extend. 3–30 s, 720p or 1080p, always stereo. Kling 4.0 is Kuaishou's flagship video model. One model instead of separate modes: clips from text, from the first and last frame plus up to 8 mid keyframes (up to 10 images total), from references (up to 10 photos, 5 videos, 3 audio clips), edit of an existing video, or extend from the last frame. Duration 3 to 30 seconds, 720p or 1080p, aspects 16:9 · 9:16 · 1:1 · 21:9 or auto. Sound is always stereo: «auto» generates new audio, «origin» keeps your clip's sound. You pay per second of the clip (with a video reference or edit — at the input rate). Failed generations are refunded. One model, `kling-4.0` · ~6 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 720p | $0.186 | $0.186 | | 1080p | $0.277 | $0.277 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **10**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **5**; total ≤ **30 s** (each clip 2…30 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **3**; total ≤ **30 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 10 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 5 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `video_mode` | Task type for your video: `auto` (default) — the model works it out from the description, `reference` — reference, `edit` — edit (length and aspect ratio follow your video), `extend` — extend. Omitted = `auto` | **`auto`** · `reference` · `edit` · `extend` | | `resolution` | Video resolution | **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `21:9` · `auto` | | `duration` | Video duration in seconds | 3 to 30 (default **`5`**) | | `audio_setting` | Sound | **`auto`** `origin` | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 30 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 30 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5","audio_setting":"auto"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "audio_setting": "auto" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "audio_setting": "auto" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","audio_setting":"auto"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 30 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-4.0","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","audio_setting":"auto","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-4.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-4.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "audio_setting": "auto", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # MiniMax H3 > MiniMax H3: 4–15 second video in 768p or 2K with stereo sound — from text, frames or photo, video and audio references. MiniMax H3 is the new-generation MiniMax (Hailuo) video model. It makes 4 to 15 second clips in 768p or 2K with stereo sound built in: describe speech, music and effects in the prompt. Modes: from a description, from a first and/or last frame, or from references (up to 5 photos, up to 3 videos totalling 15 seconds and up to 3 audio clips — audio only together with a photo or video). Aspect 16:9, 9:16, 1:1, 4:3, 3:4 or 21:9. You pay per second; the rate depends on quality, and reference video seconds are billed at the same rate. One model, `minimax-h3-video` · ~1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 768p | $0.075 | $0.075 | | 2K | $0.119 | $0.119 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **5**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **3**; total ≤ **15 s** (each clip 2…15 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **3**; total ≤ **15 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 7000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 5 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 3 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `resolution` | Video resolution | **`768p`** · `2K` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `4:3` · `3:4` · `21:9` | | `duration` | Video duration in seconds | 4 to 15 (default **`5`**) | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 15 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 15 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-video","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"768p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-video", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "768p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-video", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "768p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-video","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"768p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-video", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "768p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-video", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "768p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-video","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"768p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-video", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "768p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-video", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "768p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 15 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"minimax-h3-video","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"768p","aspect_ratio":"16:9","duration":"5","video_urls":["https://mixmedia.tech/files/.mp4"],"trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "minimax-h3-video", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "768p", "aspect_ratio": "16:9", "duration": "5", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "minimax-h3-video", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "768p", "aspect_ratio": "16:9", "duration": "5", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Vidu Q4 > Vidu Q4 Preview: 3–16 second video from 540p to 4K from a frame or up to 15 references, with sound. Vidu Q4 (Preview) is a Vidu video model. This preview has no text-only mode: you need a first frame or a set of references (up to 15 photos and 3 audio clips). Duration 3 to 16 seconds, 540p, 720p, 1080p, 2K or 4K. Sound can be on or off, and a seed makes a run repeatable. You pay per second; the rate depends on quality. One model, `vidu-q4` · ~7.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `generate_audio` — audio in the clip ## Price | Resolution | Price per second | |---|---| | 540p | $0.059 | | 720p | $0.119 | | 1080p | $0.134 | | 2K | $0.212 | | 4K | $0.433 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Media limits | Type | Limits | |---|---| | Images | up to **15**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Audio | up to **3**; total ≤ **36 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 20000 chars (optional, default empty) | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, 1–15 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `resolution` | Video resolution | `540p` · **`720p`** · `1080p` · `2K` · `4K` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `4:3` · `3:4` | | `duration` | Video duration in seconds | 3 to 16 (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"vidu-q4","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "vidu-q4", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "vidu-q4", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"vidu-q4","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "vidu-q4", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "vidu-q4", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"vidu-q4","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "vidu-q4", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "vidu-q4", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 3.0 > Kling 3.0 by Kuaishou: 3 to 15 second clips in 720p, 1080p and 4K, from a description or the first and last frame, with optional sound. Kling 3.0 is a Kuaishou video model. It makes 3 to 15 second clips from a description or from a photo — the first and, optionally, the last frame. Quality: Standard (720p), Pro (1080p) or 4K. Sound is optional: effects, music and voices are made together with the picture; with sound costs more (same price in 4K). You pay per second of the clip. One model, `kling-3.0` · ~3 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `generate_audio` — audio in the clip ## Price | Resolution | No sound, per second | With sound, per second | |---|---|---| | 720p | $0.091 | $0.132 | | 1080p | $0.117 | $0.176 | | 4k | $0.558 | $0.558 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - `generate_audio` defaults to `false`. In 4K the price is the same with or without sound. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `resolution` | Quality = the Kling mode: `720p` — Standard (std), `1080p` — Pro (pro), `4k` — 4K. You can also send `mode`: `std` / `pro` / `4k` | **`720p`** · `1080p` · `4k` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` | | `duration` | Clip length in seconds | 3 to 15 (default **`5`**) | | `generate_audio` | Sound in the clip (effects, music, voices). Default `false`; with sound costs more — see the price | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 3.0 Omni > All-in-one Kling 3.0: from a description, frames, up to 7 reference photos or your video — edit it or use it as a reference. Up to 15 s, up to 4K. Kling 3.0 Omni is Kuaishou's all-in-one model. 3 to 15 second clips from a description, the first and last frame, references (up to 7 photos — refer to them as «photo 1», «photo 2» in the description) or your video. With a video (3–10 seconds, longer is trimmed) there are two modes: «Edit this video» — the result is as long as the clip; «Use as a reference» — a new clip of the chosen length in the spirit of yours (one photo allowed, as the first frame). With a video 720p and 1080p are available, no sound is generated, but the clip's own sound can be kept. Quality: Standard (720p), Pro (1080p) or 4K. Sound without a video is optional and costs more. You pay per second of the clip. One model, `kling-3.0-omni` · ~7 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `generate_audio` — audio in the clip ## Price | Resolution | No sound, per second | With sound, per second | With your video, per second | |---|---|---|---| | 720p | $0.091 | $0.117 | $0.132 | | 1080p | $0.117 | $0.15 | $0.176 | | 4k | $0.558 | $0.558 | — | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video (`video_urls`, one clip 3–10 s): `video_mode: "edit"` is billed by the clip seconds, the result has the same length; `video_mode: "reference"` by the new clip seconds (`duration`). The «With your video» rate applies; 4K is not available with a video, no sound is generated. - Reference photos in the prompt: `<<>>`, `<<>>`… You can write «photo 1» — we convert it; with no references at all, every photo is named at the start of the prompt. - `generate_audio` defaults to `false`. In 4K the price is the same with or without sound. ## Media limits | Type | Limits | |---|---| | Images | up to **7**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Video | one; **3…10 s** (longer is always trimmed to 10); the service needs ≥ 720 px on the short side — smaller clips are upscaled for you; MP4 / MOV → MP4; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 7 | | `video_urls` | One video of yours (MP4, 3–10 s; longer is trimmed): upload via files/upload first. 720p / 1080p only | `["https://…"]`, up to 1 | | `video_mode` | What to do with your video: `edit` (default) — change it, the result is as long as the clip (3–10 s), up to 4 photos; `reference` — a new clip of `duration` based on it, one photo allowed (the first frame) | **`edit`** · `reference` | | `resolution` | Quality = the Kling mode: `720p` — Standard (std), `1080p` — Pro (pro), `4k` — 4K. You can also send `mode`: `std` / `pro` / `4k` | **`720p`** · `1080p` · `4k` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` | | `duration` | Clip length in seconds (not needed with `video_mode: "edit"` — the clip sets the length) | 3 to 15 (default **`5`**) | | `generate_audio` | Sound in the clip (effects, music, voices). Default `false`; with sound costs more — see the price. Not generated with `video_urls` | `true` `false` (default `false`) | | `keep_original_sound` | Keep the sound of your video in the result | `true` `false` (default `true`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0-omni","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0-omni", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0-omni", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0-omni","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0-omni", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0-omni", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0-omni","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0-omni", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0-omni", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0-omni","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0-omni", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0-omni", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 3.0 Motion Control > The character from your photo copies the motion, gestures and expressions from a video. 3–30 second clips, 720p or 1080p. Kling 3.0 Motion Control takes one character photo and a motion video and brings the character to life: it repeats the motion, gestures and expressions from the clip. Orientation «Like the video» — pose and turns as in the clip, video 3–30 seconds. «Like the photo» — the character keeps the angle from the photo, video 3–10 seconds. Longer is trimmed. The clip's sound can be kept. Quality Standard (720p) or Pro (1080p). You pay per second of your video. One model, `kling-3.0-motion-control` · ~5 min. Send your video `video_url` and photos `image_urls`. ## Price | Resolution | Price per second of your video | |---|---| | 720p | $0.134 | | 1080p | $0.179 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - `character_orientation: "image"` — video up to 10 s (longer is trimmed to 10). - You pay per second of your video (3 to 30 s). A clip longer than 30 s is trimmed to 30; the result has the same length. `prompt` may be omitted. ## Media limits | Type | Limits | |---|---| | Images | **1** (character); JPG / PNG / WebP; public https link or [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Video | one clip, `video_url`; **3 s** to **30 s** (longer is trimmed to 30); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars (optional, default empty) | | `video_url` | Motion video (MP4): one clip, 3–30 s with `character_orientation: "video"`, 3–10 s with `"image"` (longer is trimmed). Upload it via files/upload first | `"https://…"` | | `image_urls` | Character photos (https): look, face, clothes | `["https://…"]`, 1–1 | | `character_orientation` | `video` — pose and turns follow the video (clip up to 30 s), `image` — the angle follows the photo (clip up to 10 s) | **`video`** `image` | | `resolution` | Quality = the Kling mode: `720p` — Standard (std), `1080p` — Pro (pro). You can also send `mode`: `std` / `pro` | **`720p`** · `1080p` | | `keep_original_sound` | Keep the sound of your video in the result | `true` `false` (default `true`) | ## Examples ### Video + photo ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-3.0-motion-control","input":{"prompt":"The character from the photo repeats the dance from the video","video_url":"https://mixmedia.tech/files/.mp4","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"character_orientation":"video","resolution":"720p","keep_original_sound":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-3.0-motion-control", "input": { "prompt": "The character from the photo repeats the dance from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "character_orientation": "video", "resolution": "720p", "keep_original_sound": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-3.0-motion-control", "input": { "prompt": "The character from the photo repeats the dance from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "character_orientation": "video", "resolution": "720p", "keep_original_sound": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 2.6 > Kling 2.6 by Kuaishou: affordable 5 or 10 second clips from a description or a photo. Pro (1080p) adds sound and the last frame. Kling 2.6 is a Kuaishou video model. 5 or 10 second clips from a description or a photo (the first frame). Standard (720p) is the most affordable, without sound. Pro (1080p) has higher quality and lets you turn on sound (effects, music, voices) or set the last frame; sound and the last frame do not work together. You pay per second of the clip. One model, `kling-2.6` · ~3 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `generate_audio` — audio in the clip ## Price | Resolution | No sound, per second | With sound, per second | |---|---|---| | 720p | $0.072 | — | | 1080p | $0.082 | $0.163 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - Sound (`generate_audio: true`) and the last frame need `1080p` (pro) and do not work together. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `resolution` | Quality = the Kling mode: `720p` — Standard (std), `1080p` — Pro (pro). You can also send `mode`: `std` / `pro` | **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` | | `duration` | Clip length in seconds | **`5`** `10` | | `generate_audio` | Sound in the clip (effects, music, voices). Default `false`; with sound costs more — see the price | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-2.6","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-2.6", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-2.6", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-2.6","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-2.6", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-2.6", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 2.6 Motion Control > Affordable motion transfer: the character from a photo copies the motion from a video. 3–30 second clips, 720p or 1080p. Kling 2.6 Motion Control takes one character photo and a motion video: the character repeats the motion, gestures and expressions from the clip. Orientation «Like the video» — video 3–30 seconds, «Like the photo» — 3–10 seconds. Longer is trimmed. The clip's sound can be kept. Quality Standard (720p) or Pro (1080p). You pay per second of your video. One model, `kling-2.6-motion-control` · ~5 min. Send your video `video_url` and photos `image_urls`. ## Price | Resolution | Price per second of your video | |---|---| | 720p | $0.075 | | 1080p | $0.119 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - `character_orientation: "image"` — video up to 10 s (longer is trimmed to 10). - You pay per second of your video (3 to 30 s). A clip longer than 30 s is trimmed to 30; the result has the same length. `prompt` may be omitted. ## Media limits | Type | Limits | |---|---| | Images | **1** (character); JPG / PNG / WebP; public https link or [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Video | one clip, `video_url`; **3 s** to **30 s** (longer is trimmed to 30); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars (optional, default empty) | | `video_url` | Motion video (MP4): one clip, 3–30 s with `character_orientation: "video"`, 3–10 s with `"image"` (longer is trimmed). Upload it via files/upload first | `"https://…"` | | `image_urls` | Character photos (https): look, face, clothes | `["https://…"]`, 1–1 | | `character_orientation` | `video` — pose and turns follow the video (clip up to 30 s), `image` — the angle follows the photo (clip up to 10 s) | **`video`** `image` | | `resolution` | Quality = the Kling mode: `720p` — Standard (std), `1080p` — Pro (pro). You can also send `mode`: `std` / `pro` | **`720p`** · `1080p` | | `keep_original_sound` | Keep the sound of your video in the result | `true` `false` (default `true`) | ## Examples ### Video + photo ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-2.6-motion-control","input":{"prompt":"The character from the photo repeats the dance from the video","video_url":"https://mixmedia.tech/files/.mp4","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"character_orientation":"video","resolution":"720p","keep_original_sound":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-2.6-motion-control", "input": { "prompt": "The character from the photo repeats the dance from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "character_orientation": "video", "resolution": "720p", "keep_original_sound": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-2.6-motion-control", "input": { "prompt": "The character from the photo repeats the dance from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "character_orientation": "video", "resolution": "720p", "keep_original_sound": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Kling 2.5 Turbo > Kling 2.5 Turbo Pro: fast 5 or 10 second clips in 1080p from a description or a photo. Kling 2.5 Turbo Pro is a fast Kuaishou video model. 5 or 10 second clips in 1080p from a description or a photo (the first frame), with smooth motion and close prompt following. No sound. You pay per second of the clip. One model, `kling-2.5-turbo` · ~4 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 1080p | $0.082 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2500 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `resolution` | Video resolution | **`1080p`** | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` | | `duration` | Video duration in seconds | **`5`** `10` | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-2.5-turbo","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"1080p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-2.5-turbo", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "1080p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-2.5-turbo", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "1080p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"kling-2.5-turbo","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"1080p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "kling-2.5-turbo", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "1080p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "kling-2.5-turbo", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "1080p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # OmniHuman 2.0 > Talking avatar from one photo and audio: lips and expression follow speech or a song. 4–300 s, 720p. OmniHuman 2.0 by ByteDance animates one photo to your audio — speech, a song or a track. Facial expression, lip sync and light head motion follow the sound; the clip length matches the audio. You need one character photo (face large, front-facing) and audio from 4 to 300 seconds (MP3/WAV). An optional note up to 300 characters can set pose, camera and mood. Resolution 720p. You pay per second of your audio. One model, `omnihuman-2.0` · ~3 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 720p | $0.091 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Media limits | Type | Limits | |---|---| | Images | up to **1**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Audio | up to **1**; total ≤ **300 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 300 chars (optional, default empty) | | `image_urls` | Reference photos (https) | `["https://…"]`, 1–1 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 1 | | `resolution` | Video resolution | **`720p`** | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"omnihuman-2.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "omnihuman-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "omnihuman-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"omnihuman-2.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "omnihuman-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "omnihuman-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # PixVerse V6 > PixVerse V6: 1–15 second clips with sound from a description, a photo, two frames or up to 7 reference photos. 360p to 1080p. PixVerse V6 is a PixVerse video model with cinematic camera work and realistic motion. 1 to 15 second clips: from a description, from a photo (the first frame), a transition between the first and last frame (5 or 8 seconds) or from 1–7 reference photos. 360p, 540p, 720p or 1080p. Sound is made together with the video (cheaper without it). You pay per second of the clip. One model, `pixverse-v6` · under 1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `generate_audio` — audio in the clip ## Price | Resolution | Price per second | |---|---| | 360p | $0.037 | | 540p | $0.047 | | 720p | $0.063 | | 1080p | $0.12 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - Sound is on by default; `generate_audio: false` is cheaper. First + last frame make a transition, 5 or 8 s only. `image_urls` (1–7 photos) are references; you can mention "photo 2" in the prompt. `aspect_ratio` applies to text and references; with a frame the shape follows the photo. ## Media limits | Type | Limits | |---|---| | Images | up to **7**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 5000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 7 | | `resolution` | Video resolution | `360p` · **`540p`** · `720p` · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `4:3` · `1:1` · `3:4` · `9:16` · `2:3` · `3:2` · `21:9` | | `duration` | Video duration in seconds | 1 to 15 (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"pixverse-v6","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"540p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "pixverse-v6", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "540p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "pixverse-v6", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "540p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"pixverse-v6","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"540p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "pixverse-v6", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "540p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "pixverse-v6", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "540p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"pixverse-v6","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"540p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "pixverse-v6", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "540p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "pixverse-v6", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "540p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Pruna P-Video Replace > Fast person swap in your video from 1–3 photos. Motion, camera and sound stay as filmed. Up to 30 seconds, 720p or 1080p. Pruna P-Video-Replace takes your video and 1–3 photos and puts the character from the photos in place of the person in the clip. Motion, timing, camera and scene stay as in the source; the clip audio is kept. It is fast: about 3–4 seconds of generation per second of video. The video is up to 30 seconds (longer is trimmed to 30); the result has the same length. Resolution 720p or 1080p, frame rate original, 24 or 48. The prompt is optional. You pay per second of your video. One model, `pruna-p-video-replace` · ~2 min. Send your video `video_url` and photos `image_urls`. ## Price | Resolution | Price per second of your video | |---|---| | 720p | $0.039 | | 1080p | $0.078 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - You pay per second of your video (2 to 30 s). A clip longer than 30 s is trimmed to 30; the result has the same length. `prompt` may be omitted. ## Media limits | Type | Limits | |---|---| | Images | **1–3** (character); JPG / PNG / WebP; public https link or [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Video | one clip, `video_url`; **2 s** to **30 s** (longer is trimmed to 30); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars (optional, default empty) | | `video_url` | Motion video (MP4): one clip, at least 4 s. Longer than 30 s is trimmed to 30. Upload it via files/upload first | `"https://…"` | | `image_urls` | Character photos (https): look, face, clothes | `["https://…"]`, 1–3 | | `resolution` | Video resolution | **`720p`** · `1080p` | | `target_fps` | Frame rate | **`original`** `24` `48` | | `save_audio` | Keep the clip's sound | `true` `false` (default `true`) | | `ignore_audio` | Ignore the sound when generating | `true` `false` (default `false`) | | `turbo` | Turbo (faster, slightly lower quality) | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | ## Examples ### Video + photo ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"pruna-p-video-replace","input":{"mode":"motion-transfer","prompt":"Keep the face from the photo, take the motion from the video","video_url":"https://mixmedia.tech/files/.mp4","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "pruna-p-video-replace", "input": { "mode": "motion-transfer", "prompt": "Keep the face from the photo, take the motion from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "pruna-p-video-replace", "input": { "mode": "motion-transfer", "prompt": "Keep the face from the photo, take the motion from the video", "video_url": "https://mixmedia.tech/files/.mp4", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Runway > Runway animates a photo: a 5 or 10 second clip in 720p (1080p for 5 seconds). Runway is a well-known video model for animating photos. Upload a picture and describe the motion — you get a 5 or 10 second clip in 720p; 1080p is available for 5 seconds. You pay per clip. One model, `runway` · under 1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 720p | $0.016 | | 1080p | $0.039 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 1800 chars (optional, default empty) | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `resolution` | Video resolution | **`720p`** · `1080p` | | `duration` | Video duration in seconds | **`5`** `10` | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"runway","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "runway", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "runway", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"runway","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "runway", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "runway", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 2.5 > ByteDance's newest video model: clips up to 30 seconds with sound, from a description, frames or references. Draft mode is a 480p preview. Seedance 2.5 is the newest ByteDance video model. It films 4 to 30 second clips in 480p, 720p and 1080p with sound: from a description, from the first and last frame, from references (up to 30 photos, 10 clips and 10 audio tracks), and it edits and continues your video. Pick «Auto» length and the model decides: the price of 30 seconds is held and the rest comes back right after the video is ready. Draft is a separate mode (the Draft tick, or draft: true). The clip is 480p only, so you can review the picture and the motion. A successful draft id (draft_task_id) orders a separate 1080p final and keeps the draft prompt, references, length, aspect ratio, seed and sound. A draft lasts 3 days. Each generation is charged on its own: the draft at the 480p price, the final at the 1080p price. One model, `seedance-2.5` · ~4.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters - `duration: "auto"` / `-1` — model picks length (on the site: **auto (-1)**) - `video_mode`: `auto` · `reference` · `edit` · `extend` - `watermark` — "AI generated" mark - `output_format`: `mp4` (default) or `mov` - `return_last_frame` — last-frame URL for chaining - `nsfw` — censorship, off by default (`false`). `true` can cause errors from the model - `generate_audio` — audio in the clip - `draft: true` — 480p draft only; `draft_task_id` — a separate 1080p final (3 days), priced as a normal 1080p clip ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 480p | $0.147 | $0.09 | | 720p | $0.331 | $0.2 | | 1080p | $0.83 | $0.501 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. - `draft: true` is Draft mode, `480p` only, priced as a normal 480p clip (no separate draft tariff). `draft_task_id` is a separate `1080p` final from a successful draft id no older than 3 days, priced as a normal 1080p clip. If the draft had a reference video, those seconds are added; the draft file itself is not. Each generation is charged separately. - On the site — the **auto (-1)** tick next to the duration (not a list item). In the API: `duration: "auto"` or `-1` lets the model choose the length, up to 30 s. On creation the price of 30 s is charged (plus your video seconds, if any). When the video is ready the price is recalculated from the real length and the difference goes straight back to your balance (history: «Refund for unused video seconds»). The final price is `costUsd` in recordInfo, the length is `duration` in `resultJson`. With `video_mode: "edit"` the result is as long as your clip. ## Media limits | Type | Limits | |---|---| | Images | up to **30**; JPG / PNG / WebP (also BMP / TIFF / GIF / HEIC via public https); upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **10**; total ≤ **30 s** (each clip 2…30 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **10**; total ≤ **30 s**; MP3 / WAV; upload ≤ **200 MB**; audio-only (no photo/video) is allowed | Photos — public https or upload; video and audio — files/upload only. ## Task types and constraints | `video_mode` | What you need | Notes | |---|---|---| | `auto` | prompt; media optional | default; the model picks reference / edit / extend | | `reference` | photo / video / audio references | character, place, motion, style | | `edit` | `video_urls` | length and aspect ratio follow your clip; clip ≥ 4 s | | `extend` | `video_urls` | continue the clip | Field `omni_reference_task_type` is an alias of `video_mode` (accepted by the API). **Tip:** with `video_urls` the site preselects `aspect_ratio: adaptive` and `duration: auto` / `-1` (**auto (-1)** tick) — the model is picky about tiny duration mismatches. You can still set other values manually. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 30 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 10 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 10 | | `video_mode` | Task type for your video: `auto` (default) — the model works it out from the description, `reference` — reference, `edit` — edit (length and aspect ratio follow your video), `extend` — extend. Omitted = `auto` | **`auto`** (the model works it out) · `reference` (reference) · `edit` (edit) · `extend` (extend) | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) · `1080p` (Full HD) | | `aspect_ratio` | Aspect ratio | **`adaptive`** (matches your upload) · `16:9` (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | 4 to 30 s, or `auto` / `-1` (the model picks the length) (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `draft` | Draft: `true` — 480p only, to review the picture and the motion. Omit it or `false` for a normal clip. Cannot be combined with `draft_task_id`. Priced as a normal 480p clip | `true` `false` (default `false`) | | `draft_task_id` | Id of a successful draft (our `taskId`, no older than 3 days). A separate 1080p final: do not send the prompt, references, length, aspect ratio, seed or audio | | | `return_last_frame` | Return the last-frame image URL (for continuing the clip) | `true` `false` (default `false`) | | `output_format` | Result container: `mp4` (default) or `mov` | **`mp4`** `mov` | | `nsfw` | `false` (default when the field is omitted) or `true`. Censorship is off by default. `true` can cause errors from the model | `true` `false` (default `false`) | | `watermark` | "AI generated" watermark on the video | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 30 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 30 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"adaptive","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"adaptive","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 30 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","output_format":"mp4","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 }, "lastFrameUrl": "https://…/last.jpg" } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 2.5 Flash > The fast Seedance 2.5: clips up to 30 seconds with sound in 480p and 720p, from a description, frames or references. Seedance 2.5 Flash is the faster Seedance 2.5. It films 4 to 30 second clips in 480p and 720p with sound: from a description, from the first and last frame, from references (up to 10 photos, 5 clips and 5 audio tracks), and it edits and continues your video. Cheaper and quicker than the full model. Pick «Auto» length and the model decides: the price of 30 seconds is held and the rest comes back right after the video is ready. One model, `seedance-2.5-flash` · ~2.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters - `duration: "auto"` / `-1` — model picks length (on the site: **auto (-1)**) - `video_mode`: `auto` · `reference` · `edit` · `extend` - `watermark` — "AI generated" mark - `output_format`: `mp4` (default) or `mov` - `return_last_frame` — last-frame URL for chaining - `nsfw` — censorship, off by default (`false`). `true` can cause errors from the model - `generate_audio` — audio in the clip ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 480p | $0.083 | $0.056 | | 720p | $0.186 | $0.113 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. - On the site — the **auto (-1)** tick next to the duration (not a list item). In the API: `duration: "auto"` or `-1` lets the model choose the length, up to 30 s. On creation the price of 30 s is charged (plus your video seconds, if any). When the video is ready the price is recalculated from the real length and the difference goes straight back to your balance (history: «Refund for unused video seconds»). The final price is `costUsd` in recordInfo, the length is `duration` in `resultJson`. With `video_mode: "edit"` the result is as long as your clip. ## Media limits | Type | Limits | |---|---| | Images | up to **10**; JPG / PNG / WebP (also BMP / TIFF / GIF / HEIC via public https); upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **5**; total ≤ **30 s** (each clip 2…30 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **5**; total ≤ **30 s**; MP3 / WAV; upload ≤ **200 MB**; audio-only (no photo/video) is allowed | Photos — public https or upload; video and audio — files/upload only. ## Task types and constraints | `video_mode` | What you need | Notes | |---|---|---| | `auto` | prompt; media optional | default; the model picks reference / edit / extend | | `reference` | photo / video / audio references | character, place, motion, style | | `edit` | `video_urls` | length and aspect ratio follow your clip; clip ≥ 4 s | | `extend` | `video_urls` | continue the clip | Field `omni_reference_task_type` is an alias of `video_mode` (accepted by the API). **Tip:** with `video_urls` the site preselects `aspect_ratio: adaptive` and `duration: auto` / `-1` (**auto (-1)** tick) — the model is picky about tiny duration mismatches. You can still set other values manually. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 10 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 5 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 5 | | `video_mode` | Task type for your video: `auto` (default) — the model works it out from the description, `reference` — reference, `edit` — edit (length and aspect ratio follow your video), `extend` — extend. Omitted = `auto` | **`auto`** (the model works it out) · `reference` (reference) · `edit` (edit) · `extend` (extend) | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) | | `aspect_ratio` | Aspect ratio | **`adaptive`** (matches your upload) · `16:9` (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | 4 to 30 s, or `auto` / `-1` (the model picks the length) (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `return_last_frame` | Return the last-frame image URL (for continuing the clip) | `true` `false` (default `false`) | | `output_format` | Result container: `mp4` (default) or `mov` | **`mp4`** `mov` | | `nsfw` | `false` (default when the field is omitted) or `true`. Censorship is off by default. `true` can cause errors from the model | `true` `false` (default `false`) | | `watermark` | "AI generated" watermark on the video | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 30 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 30 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"adaptive","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5-flash","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5-flash", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5-flash","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"adaptive","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5-flash", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5-flash","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 30 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.5-flash","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"video_mode":"edit","resolution":"720p","duration":"5","output_format":"mp4","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.5-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.5-flash", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "video_mode": "edit", "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 }, "lastFrameUrl": "https://…/last.jpg" } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 2.0 > ByteDance video up to 15 seconds with sound, up to 4K: from a description, frames or references. Seedance 2.0 is a ByteDance video model. 4 to 15 second clips with sound in 480p, 720p, 1080p and 4K: from a description, from the first and last frame, or from references (up to 9 photos, 3 clips and 3 audio tracks). It can also re-film your video by a description. One model, `seedance-2.0` · ~5.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters - `output_format`: `mp4` (default) or `mov` - `return_last_frame` — last-frame URL for chaining - `nsfw` — censorship, off by default (`false`). `true` can cause errors from the model - `generate_audio` — audio in the clip ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 480p | $0.1 | $0.06 | | 720p | $0.216 | $0.132 | | 1080p | $0.536 | $0.326 | | 4k | $1.092 | $0.672 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **9**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **3**; total ≤ **15 s** (each clip 2…15 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **3**; total ≤ **15 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 9 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 3 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) · `1080p` (Full HD) · `4k` (Ultra HD) | | `aspect_ratio` | Aspect ratio | `adaptive` (matches your upload) · **`16:9`** (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | 4 to 15 (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `return_last_frame` | Return the last-frame image URL (for continuing the clip) | `true` `false` (default `false`) | | `output_format` | Result container: `mp4` (default) or `mov` | **`mp4`** `mov` | | `nsfw` | `false` (default when the field is omitted) or `true`. Censorship is off by default. `true` can cause errors from the model | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 15 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 15 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 15 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","output_format":"mp4","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 }, "lastFrameUrl": "https://…/last.jpg" } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 2.0 Fast > The fast Seedance 2.0: clips up to 15 seconds with sound in 480p and 720p. Seedance 2.0 Fast is the quicker Seedance 2.0 with the same features: video from a description, frames or references, with sound, 4 to 15 seconds, 480p or 720p. Cheaper and faster than the full version. One model, `seedance-2.0-fast` · ~4 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters - `output_format`: `mp4` (default) or `mov` - `return_last_frame` — last-frame URL for chaining - `nsfw` — censorship, off by default (`false`). `true` can cause errors from the model - `generate_audio` — audio in the clip ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 480p | $0.062 | $0.036 | | 720p | $0.131 | $0.079 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **9**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **3**; total ≤ **15 s** (each clip 2…15 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **3**; total ≤ **15 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 9 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 3 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) | | `aspect_ratio` | Aspect ratio | `adaptive` (matches your upload) · **`16:9`** (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | 4 to 15 (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `return_last_frame` | Return the last-frame image URL (for continuing the clip) | `true` `false` (default `false`) | | `output_format` | Result container: `mp4` (default) or `mov` | **`mp4`** `mov` | | `nsfw` | `false` (default when the field is omitted) or `true`. Censorship is off by default. `true` can cause errors from the model | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 15 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 15 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-fast","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-fast","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-fast","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-fast","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-fast", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-fast", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 15 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-fast","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","output_format":"mp4","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-fast", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-fast", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 }, "lastFrameUrl": "https://…/last.jpg" } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 2.0 Mini > The most affordable Seedance 2.0: clips up to 15 seconds with sound, 480p and 720p. Seedance 2.0 Mini is the most affordable Seedance 2.0. Video from a description, frames or references, with sound, 4 to 15 seconds in 480p or 720p. Good for drafts and testing an idea. One model, `seedance-2.0-mini` · ~2.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters - `output_format`: `mp4` (default) or `mov` - `return_last_frame` — last-frame URL for chaining - `nsfw` — censorship, off by default (`false`). `true` can cause errors from the model - `generate_audio` — audio in the clip ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 480p | $0.025 | $0.016 | | 720p | $0.054 | $0.033 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Images | up to **9**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **3**; total ≤ **15 s** (each clip 2…15 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **3**; total ≤ **15 s**; MP3 / WAV; upload ≤ **200 MB** | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 9 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 3 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 3 | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) | | `aspect_ratio` | Aspect ratio | `adaptive` (matches your upload) · **`16:9`** (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | 4 to 15 (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `return_last_frame` | Return the last-frame image URL (for continuing the clip) | `true` `false` (default `false`) | | `output_format` | Result container: `mp4` (default) or `mov` | **`mp4`** `mov` | | `nsfw` | `false` (default when the field is omitted) or `true`. Censorship is off by default. `true` can cause errors from the model | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 15 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 15 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-mini","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-mini", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-mini", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-mini","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-mini", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-mini", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-mini","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-mini", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-mini", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-mini","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","output_format":"mp4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-mini", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-mini", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 15 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-2.0-mini","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","output_format":"mp4","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-2.0-mini", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-2.0-mini", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "output_format": "mp4", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 }, "lastFrameUrl": "https://…/last.jpg" } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 1.0 Pro Fast > Fast Seedance 1.0 Pro: a 2 to 12 second clip from a description or a photo, 480p to 1080p. Seedance 1.0 Pro Fast is the faster tier of ByteDance Seedance 1.0 Pro for previews and iterations. 2 to 12 second clips from a description, or it animates a photo (the first frame). 480p, 720p or 1080p, no sound. The camera can be kept still. You pay per second of the clip. One model, `seedance-1.0-pro-fast` · under 1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters ## Price | Resolution | Price per second | |---|---| | 480p | $0.012 | | 720p | $0.026 | | 1080p | $0.055 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) · `1080p` (Full HD) | | `aspect_ratio` | Aspect ratio | **`16:9`** (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | `2` `3` `4` **`5`** `6` `7` `8` `9` `10` `11` `12` | | `camera_fixed` | Fixed camera | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-1.0-pro-fast","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-1.0-pro-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-1.0-pro-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-1.0-pro-fast","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-1.0-pro-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-1.0-pro-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Seedance 1.5 Pro > ByteDance video up to 12 seconds with sound: from a description or the first and last frame. Seedance 1.5 Pro is a ByteDance video model for 4 to 12 second clips in 480p, 720p and 1080p, with or without sound. It films from a description or animates a photo: the first frame and, optionally, the last one. The camera can be kept still. One model, `seedance-1.5-pro` · ~2 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `prompt` — up to **30000** characters - `nsfw` — censorship, off by default (`false`). `true` can cause errors from the model - `generate_audio` — audio in the clip - First / last frame (`first_frame_url` / `last_frame_url`) ## Price | Resolution | Price per second | |---|---| | 480p | $0.03 | | 720p | $0.068 | | 1080p | $0.141 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Media limits | Type | Limits | |---|---| | Frames | `first_frame_url` required to animate; `last_frame_url` optional | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 30000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `resolution` | Video resolution | `480p` (standard) · **`720p`** (high (HD)) · `1080p` (Full HD) | | `aspect_ratio` | Aspect ratio | **`16:9`** (landscape) · `9:16` (portrait) · `1:1` (square) · `4:3` (traditional) · `3:4` (vertical traditional) · `21:9` (ultra-wide) | | `duration` | Video duration in seconds | 4 to 12 (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `camera_fixed` | Fixed camera | `true` `false` (default `false`) | | `nsfw` | `false` (default when the field is omitted) or `true`. Censorship is off by default. `true` can cause errors from the model | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-1.5-pro","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-1.5-pro", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-1.5-pro", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"seedance-1.5-pro","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "seedance-1.5-pro", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "seedance-1.5-pro", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Common refusals for this model - `duration` out of range, or `auto` / `-1` when auto length is not supported (Seedance 2.5 only) - `resolution` / `aspect_ratio` (`size`) / `video_mode` not in the list above - `video_mode` = `edit` or `extend` without `video_urls`; for `edit` — clip shorter than 4 s - Reference video/audio too long without `auto_trim` / `trim_*` → `400` - **Moderation / content policy:** the refusal text is shown **verbatim from the model** (in `failMsg` / `error.message` and on the site). Example: `Blocked by a specific content policy (e.g. public figures, minors, audio copyright).` We do not replace it with a generic “request failed the check” line. With `nsfw_check: true` the reject may be an **immediate HTTP 400** with no task and no charge. ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Veo 3.1 Quality > Veo 3.1 at top quality: cinematic 8 second clips with sound from a description or frames. Veo 3.1 Quality is Google's top video model: the best detail, light and motion. An 8 second clip with sound (speech, effects, music) from a description or the first and last frame. 16:9 or 9:16, 720p or 1080p at one price. You pay per clip. One model, `veo-3.1` · ~4 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 720p | $0.204 | | 1080p | $0.208 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - The clip is always 8 seconds with sound (`duration: "8"`), price per clip: $1.625. `aspect_ratio` is `16:9` or `9:16`. Frames: `first_frame_url` and optionally `last_frame_url`. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 5000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `resolution` | Video resolution | **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` | | `duration` | Video duration in seconds | **`8`** | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Veo 3.1 Fast > Veo 3.1 Fast by Google: 8 second clips with sound and speech from a description, frames or up to 3 reference photos. 720p and 1080p. Veo 3.1 Fast is Google's fast video model. The clip is always 8 seconds and comes with sound: voices, effects and music are made together with the picture. From a description, the first (and last) frame or 1–3 reference photos — a character, a product, a style. 16:9 or 9:16, 720p or 1080p at one price. You pay per clip. One model, `veo-3.1-fast` · ~3 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 720p | $0.049 | | 1080p | $0.053 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - The clip is always 8 seconds with sound (`duration: "8"`), price per clip: $0.39. `aspect_ratio` is `16:9` or `9:16`. Frames: `first_frame_url` and optionally `last_frame_url`. Reference photos: `image_urls`, up to 3 (no frames). ## Media limits | Type | Limits | |---|---| | Images | up to **3**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 5000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 3 | | `resolution` | Video resolution | **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` | | `duration` | Video duration in seconds | **`8`** | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1-fast","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1-fast","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1-fast","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Veo 3.1 Lite > The most affordable Veo 3.1: 8 second clips with sound from a description or the first and last frame. Veo 3.1 Lite is Google's light video model. An 8 second clip with sound from a description or a photo (the first and, optionally, the last frame). 16:9 or 9:16, 720p or 1080p. From a description it is the lowest Veo price; from frames it costs more (see the button). You pay per clip. One model, `veo-3.1-lite` · ~1.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 720p | $0.025 | | 1080p | $0.029 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - The clip is always 8 seconds with sound (`duration: "8"`), price per clip: $0.195. `aspect_ratio` is `16:9` or `9:16`. Frames: `first_frame_url` and optionally `last_frame_url`. With frames Lite costs more — see the create response and /v1/pricing/calculate. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 5000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `resolution` | Video resolution | **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` | | `duration` | Video duration in seconds | **`8`** | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1-lite","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1-lite", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1-lite", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"veo-3.1-lite","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","aspect_ratio":"16:9","duration":"8"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "veo-3.1-lite", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "veo-3.1-lite", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "aspect_ratio": "16:9", "duration": "8" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Wan 3.0 > Alibaba video up to 30 seconds: from a description, frames or references (photos, clips, audio), with sound. Wan 3.0 is an Alibaba video model. 2 to 30 second clips in 480p, 720p and 1080p: from a description, from the first and last frame, or from references (up to 10 photos, 5 clips and 5 audio tracks). You can turn the soundtrack off — the price stays the same. Pick «Auto» length and the model decides: the maximum is held and the rest comes back after the video is ready. With your own video, input + output seconds stay within 30. One model, `wan-3.0` · ~1.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `duration: "auto"` / `-1` — model picks length (on the site: **auto (-1)**) - `watermark` — "AI generated" mark - `generate_audio` — audio in the clip - `nsfw_check` — check before charge ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 480p | $0.054 | $0.054 | | 720p | $0.108 | $0.108 | | 1080p | $0.215 | $0.215 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. - On the site — the **auto (-1)** tick next to the duration (not a list item). In the API: `duration: "auto"` or `-1` lets the model choose the length, up to 30 s. On creation the price of 30 s is charged (plus your video seconds, if any). When the video is ready the price is recalculated from the real length and the difference goes straight back to your balance (history: «Refund for unused video seconds»). The final price is `costUsd` in recordInfo, the length is `duration` in `resultJson`. With `video_mode: "edit"` the result is as long as your clip. ## Media limits | Type | Limits | |---|---| | Images | up to **10**; JPG / PNG / WebP; upload via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) — up to **30 MB** per file | | Videos | up to **5**; total ≤ **15 s** (each clip 2…15 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **5**; total ≤ **15 s**; MP3 / WAV; upload ≤ **200 MB**; audio-only (no photo/video) is allowed | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 20000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `image_urls` | Reference photos (https) | `["https://…"]`, up to 10 | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 5 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 5 | | `resolution` | Video resolution | `480p` · **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`adaptive`** · `16:9` · `9:16` · `1:1` · `4:3` · `3:4` | | `duration` | Video duration in seconds | 2 to 30 s, or `auto` / `-1` (the model picks the length) (default **`5`**) | | `generate_audio` | Video with sound | `true` `false` (default `true`) | | `watermark` | "AI generated" watermark on the video | `true` `false` (default `false`) | | `nsfw_check` | Content check: the description and photos are checked first; if not allowed, no task is created and nothing is charged | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 15 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 15 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-3.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"adaptive","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-3.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-3.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-3.0","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-3.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-3.0", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With references ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-3.0","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"resolution":"720p","aspect_ratio":"adaptive","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-3.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-3.0", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "resolution": "720p", "aspect_ratio": "adaptive", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-3.0","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-3.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-3.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 15 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-3.0","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"720p","duration":"5","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-3.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-3.0", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "720p", "duration": "5", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Wan 2.7 > Alibaba video up to 15 seconds in 720p and 1080p: from a description, frames, or continuing your clip. Wan 2.7 is an Alibaba video model. 2 to 15 second clips in 720p and 1080p: from a description, from the first and last frame, or continuing your video (up to 10 seconds). You can add your own audio with a text-only clip. You pay per second of the result; with your own video its seconds are counted too. One model, `wan-2.7` · ~2.5 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Features - `watermark` — "AI generated" mark - `nsfw_check` — check before charge ## Price | Resolution | Price per second | With your video, per second | |---|---|---| | 720p | $0.104 | $0.104 | | 1080p | $0.156 | $0.156 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. - With your video, the seconds of the source clip are added to the seconds of the result. ## Media limits | Type | Limits | |---|---| | Videos | up to **1**; total ≤ **10 s** (each clip 2…10 s); MP4 / MOV → MP4 on the server; upload ≤ **200 MB** | | Audio | up to **1**; total ≤ **30 s**; MP3 / WAV; upload ≤ **200 MB**; audio-only (no photo/video) is allowed | Photos — public https or upload; video and audio — files/upload only. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 5000 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `last_frame_url` | Last frame (optional, only together with the first one) | `"https://…"` | | `video_urls` | Your videos (MP4): upload them via files/upload first and pass the returned links | `["https://…"]`, up to 1 | | `audio_urls` | Audio (MP3): upload via files/upload first | `["https://…"]`, up to 1 | | `resolution` | Video resolution | `720p` · **`1080p`** | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `4:3` · `3:4` | | `duration` | Video duration in seconds | 2 to 15 (default **`5`**) | | `watermark` | "AI generated" watermark on the video | `true` `false` (default `false`) | | `nsfw_check` | Content check: the description and photos are checked first; if not allowed, no task is created and nothing is charged | `true` `false` (default `false`) | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | | `trim_video_to` | Trim each of your clips to N seconds: the beginning stays. Shorter clips are not changed | whole number, 2 to 10 | | `trim_to_duration` | Trim each of your clips to the chosen `duration`: the beginning stays. With `duration: "auto"` or `video_mode: "edit"` — to the model limit | `true` `false` (default `false`) | | `auto_trim` | If your clips together are longer than 10 s, trim them instead of returning an error (the longest first) | `true` `false` (default `false`) | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.7","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"1080p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.7", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "1080p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.7", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "1080p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.7","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"1080p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.7", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "1080p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.7", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "1080p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With your video ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.7","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"1080p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.7", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "1080p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.7", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "1080p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Trim your video Your clips together: up to 10 s. No need to cut a long clip beforehand: - `trim_to_duration: true` — trim each clip to the chosen `duration`; - `trim_video_to: N` — keep N seconds from the start; - `auto_trim: true` — if the clips together are over the limit, cut them exactly to it instead of an error. Trimming is free, and the price uses the trimmed seconds — fewer seconds cost less. ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.7","input":{"prompt":"Make the clip anime style, keep everything else","video_urls":["https://mixmedia.tech/files/.mp4"],"resolution":"1080p","duration":"5","trim_to_duration":true,"auto_trim":true}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.7", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "1080p", "duration": "5", "trim_to_duration": True, "auto_trim": True } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.7", "input": { "prompt": "Make the clip anime style, keep everything else", "video_urls": [ "https://mixmedia.tech/files/.mp4" ], "resolution": "1080p", "duration": "5", "trim_to_duration": true, "auto_trim": true } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` One uploaded file: up to 30 s. Without these options, clips that are too long return a `400` error with a hint. ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Wan 2.5 > Wan 2.5 by Alibaba: 5 or 10 second clips with sound in 720p and 1080p from a description or a photo. Wan 2.5 is an Alibaba video model. 5 or 10 second clips from a description or a photo (the first frame), with sound. 720p or 1080p. You pay per second of the clip. One model, `wan-2.5` · ~2 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 720p | $0.087 | | 1080p | $0.143 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 800 chars | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `resolution` | Video resolution | **`720p`** · `1080p` | | `aspect_ratio` | Aspect ratio | **`16:9`** · `9:16` · `1:1` · `4:3` · `3:4` | | `duration` | Video duration in seconds | **`5`** `10` | | `seed` | Variant number: the same number with the same prompt gives a similar result; empty or -1 = random | -1…4294967295 | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.5","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"720p","aspect_ratio":"16:9","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.5", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "720p", "aspect_ratio": "16:9", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.5","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"720p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.5", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.5", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "720p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Wan 2.2 Fast > Wan 2.2 Fast quickly animates a photo: a clip of about 5 seconds in 480p or 720p. The cheapest way to bring a picture to life. Wan 2.2 Fast is a fast Alibaba model for animating photos. Upload a picture and describe the motion — in about a minute you get a smooth clip of about 5 seconds (480p or 720p, no sound). You pay per clip. One model, `wan-2.2-i2v-fast` · under 1 min. The result follows the `input` fields (prompt, frames, references, `video_mode`, duration) — there are no separate «animate / edit» endpoints. ## Price | Resolution | Price per second | |---|---| | 480p | $0.017 | | 720p | $0.038 | - Price = per-second price × clip length, rounded up to $0.001. Charged when the task is created and fully refunded if it fails. ## Parameters (field `input`) | Parameter | Description | Values (default in bold) | |---|---|---| | `prompt` | What happens in the clip: scene, motion, camera, light, style | text, up to 2000 chars (optional, default empty) | | `first_frame_url` | First frame: a photo link (https); the video starts from it | `"https://…"` | | `resolution` | Video resolution | **`480p`** · `720p` | | `duration` | Video duration in seconds | **`5`** | ## Examples ### Prompt only ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.2-i2v-fast","input":{"prompt":"A drone flies over an autumn forest at sunrise, fog, cinematic","resolution":"480p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.2-i2v-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "480p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.2-i2v-fast", "input": { "prompt": "A drone flies over an autumn forest at sunrise, fog, cinematic", "resolution": "480p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### With a first frame ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"wan-2.2-i2v-fast","input":{"prompt":"The character slowly turns to the camera, the wind moves the hair","first_frame_url":"https://mixmedia.tech/static/img/previews/gpt-t2i.jpg","resolution":"480p","duration":"5"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "wan-2.2-i2v-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "480p", "duration": "5" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "wan-2.2-i2v-fast", "input": { "prompt": "The character slowly turns to the camera, the wind moves the hair", "first_frame_url": "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg", "resolution": "480p", "duration": "5" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Create and result 1. `POST /api/v1/jobs/createTask` with `model` and `input`. 2. Poll `GET /api/v1/jobs/recordInfo?taskId=…` every 3–5 s (or a [callback](https://docs.mixmedia.tech/en/callbacks)). ### Successful createTask (HTTP 200) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "status": "submitted" } } ``` ### Completed task (recordInfo) ```json { "code": 200, "msg": "success", "data": { "taskId": "task_...", "task_id": "task_...", "state": "success", "status": "completed", "costUsd": "0.384", "refunded": false, "resultJson": { "videos": [ { "url": "https://…/out.mp4" } ], "duration": 8 } } } ``` Aliases: `task_id` = `taskId`; `status`: `pending` / `processing` / `completed` / `failed` alongside `state`. Clip URL is in `resultJson`. `size` is an alias of `aspect_ratio` in `input`. Photos can be any public https links or uploads via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload). Videos and audio — via files/upload only. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 400 | `nsfw_content_detected` | Moderation / content policy — `msg` / `failMsg` is the upstream text verbatim | Read the refusal text, change the prompt or files | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (length, mode, resolution, file) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # Nano Banana > Google's light and fast model: pictures from a description and edits of your photos. ### With photos in `input`: describe what to change. ID: `google/nano-banana-edit` · 1K $0.03 · 2K $0.03 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `image_urls` | yes | Links to your photos (https), up to 10 | `["https://…"]` | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | | `output_format` | no | File format | **`png`** `jpeg` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"google/nano-banana-edit","input":{"prompt":"Make the background a neon city at night","image_urls":["https://mixmedia.tech/static/img/previews/gpt-t2i.jpg"],"aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "google/nano-banana-edit", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "google/nano-banana-edit", "input": { "prompt": "Make the background a neon city at night", "image_urls": [ "https://mixmedia.tech/static/img/previews/gpt-t2i.jpg" ], "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ### Prompt only — the model creates the picture from scratch. ID: `google/nano-banana` · 1K $0.03 · 2K $0.03 per image · under 1 min **Parameters** (field `input`) | Parameter | Required | Description | Values (default in bold) | |---|---|---|---| | `prompt` | yes | What to draw or what to change | text, up to 5000 chars | | `aspect_ratio` | no | Image shape | **`auto`** `1:1` `2:3` `3:2` `3:4` `4:3` `4:5` `5:4` `9:16` `16:9` `21:9` | | `resolution` | no | Long side: 0.5K ≈ 512 px, 1K ≈ 1024 px, 2K ≈ 2048 px, 4K ≈ 4096 px. Sizes above native are an upscale of the finished picture (Lanczos + light sharpening): 4K on Nano Banana 2.1 and Pro from 2K, 2K on Nano Banana from 1K, 2K and 4K on GPT Image from its native ~1.5K | **`1K`** `2K` | | `output_format` | no | File format | **`png`** `jpeg` | **Example** ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"google/nano-banana","input":{"prompt":"A cat astronaut in a neon city, cinematic light","aspect_ratio":"auto","resolution":"1K"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "google/nano-banana", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "google/nano-banana", "input": { "prompt": "A cat astronaut in a neon city, cinematic light", "aspect_ratio": "auto", "resolution": "1K" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Compatibility Requests in the OpenAI format and other popular API formats work too: - `model`: `google/nano-banana-edit`, `nano-banana-edit`, `google/nano-banana`, `nano-banana`, `nano-banana-ext`, `gemini-2.5-flash-image-preview`, `gemini-2.5-flash-image-preview-official`. - `size` instead of `aspect_ratio`: a ratio (`16:9`) or exact pixels (`1600x1200`) — we use the closest supported ratio. - Photos can go in `image_urls`, `image_input` or `input_urls`. Parameters may also be sent at the top level of the body, without the `input` wrapper. - `resolution` in any case (`1k`, `2K`); `jpg` and `jpeg` are the same. `n` must be `1` (one image per request). - `nsfw_check`, `official_fallback`, `google_search` are accepted but do not change the result. - Photos sent to `google/nano-banana` route the task to `google/nano-banana-edit`. ## Result Same as any task: call [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) or receive a [callback](https://docs.mixmedia.tech/en/callbacks). Image links are in `resultJson` (kept for 24 hours — download right away). Upload your photos via [files/upload](https://docs.mixmedia.tech/en/endpoints/upload) or pass any public https links. ## Error handling API responses are JSON `{"code", "msg", "data"}`; errors also have a string `error` field (type). **On `/api/v1/*` the HTTP status matches body `code`.** ### Example response bodies **400** ```json { "code": 400, "msg": "input.duration: must be between 4 and 30, or \"auto\" / -1", "data": null, "error": "invalid_request_error" } ``` **401** ```json { "code": 401, "msg": "Authentication failed. Please check your API key", "data": null, "error": "authentication_error" } ``` **402** ```json { "code": 402, "msg": "Insufficient balance. Please top up and try again. Available: $0.01, required: $0.015. Top up at https://mixmedia.tech/cabinet/billing", "data": { "balance": "0.0100", "required": "0.0150", "currency": "USD", "topUpUrl": "https://mixmedia.tech/cabinet/billing" }, "error": "payment_required" } ``` **429** ```json { "code": 429, "msg": "Rate limit exceeded: 10 createTask/upload requests per 10 s per key. Retry after 8s", "data": null, "error": "rate_limit_error" } ``` **500** ```json { "code": 500, "msg": "Internal server error", "data": null, "error": "server_error" } ``` ### Codes on createTask / upload | code | error | Meaning | What to do | |---|---|---|---| | 400 | `invalid_request_error` | Invalid parameter or body | See `msg` | | 400 | `unsupported_model` | Unknown model | [Model list](https://docs.mixmedia.tech/en/models) | | 401 | `authentication_error` | Missing or invalid key | Check the key | | 402 | `payment_required` | Not enough balance | Top up | | 403 | `permission_error` | No access | Contact support | | 429 | `rate_limit_error` | Too many requests | Wait for `Retry-After` | | 505 | `model_disabled` | Model temporarily disabled | Pick another | | 500 | `server_error` | Our failure | Retry later | Example `msg` values: `Authentication failed. Please check your API key` (401); `Insufficient balance. Please top up and try again…` (402). ### Task errors (recordInfo) If the task was created and then failed: `state: "fail"` (alias `status: "failed"`), `failCode` / `failMsg`, and `error: { code, message, type }`. Money is refunded (`refunded: true`). | failCode | error.type | Meaning | |---|---|---| | 400 | `nsfw_content_detected` / `invalid_request_error` | Moderation — `failMsg` is upstream text verbatim | | 422 | `invalid_request_error` | The model rejected the parameters (e.g. a photo could not be downloaded) | | 501 | `server_error` | The model could not generate (`failMsg`) | | 504 | `timeout_error` | Timed out — retry | | 500 / 503 | `server_error` | Service temporarily unavailable | ### Rate limits | What | Limit | |---|---| | createTask and upload | 20 per 10 s per key | | recordInfo / list / balance | 100 per 10 s per key | Over the limit — HTTP 429 and `Retry-After`. --- # POST /api/v1/jobs/createTask > Creates a generation task and returns its ID (taskId) right away. The price is charged now and refunded on failure. ## Request ```http POST https://mixmedia.tech/api/v1/jobs/createTask Authorization: Bearer Content-Type: application/json ``` ## Parameters | Field | Required | Description | |---|---|---| | `model` | yes | Model ID, e.g. `nano-banana-2` — [list](https://docs.mixmedia.tech/en/models) | | `input` | yes | Model parameters: `prompt`, photos, etc. — see the model page | | `callBackUrl` | no | Where to POST the result when the task finishes — [callback](https://docs.mixmedia.tech/en/callbacks) | The optional `Idempotency-Key` header protects against duplicates on retries — [details](https://docs.mixmedia.tech/en/idempotency). ## Response ```json { "code": 200, "msg": "success", "data": { "taskId": "task_nano-banana-2_1790621023886ca4e4d", "task_id": "task_nano-banana-2_1790621023886ca4e4d", "status": "submitted" } } ``` ## Examples ```bash curl -X POST https://mixmedia.tech/api/v1/jobs/createTask \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"nano-banana-2","callBackUrl":"https://your-app.example/callback","input":{"prompt":"Poster \"Summer in Moscow\"","aspect_ratio":"3:4"}}' ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/jobs/createTask", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, json={ "model": "nano-banana-2", "callBackUrl": "https://your-app.example/callback", "input": { "prompt": "Poster \"Summer in Moscow\"", "aspect_ratio": "3:4" } }, ) print(r.json()) # {"code": 200, "data": {"taskId": "..."}} ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/createTask", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ "model": "nano-banana-2", "callBackUrl": "https://your-app.example/callback", "input": { "prompt": "Poster \"Summer in Moscow\"", "aspect_ratio": "3:4" } }), }); console.log(await r.json()); // { code: 200, data: { taskId: "..." } } ``` ## Errors | code | error | When | |---|---|---| | 401 | `authentication_error` | Missing or invalid key | | 402 | `payment_required` | Not enough balance | | 400 | `invalid_request_error` | Invalid parameter (see `msg`) | | 400 | `unsupported_model` | Unknown model | | 429 | `rate_limit_error` | Too many requests | See the «Error handling» block on the model page. --- # GET /api/v1/jobs/recordInfo > Task status and result. Ask every 3–5 seconds until state becomes success or fail. ## Request ```http GET https://mixmedia.tech/api/v1/jobs/recordInfo?taskId= Authorization: Bearer ``` ## Parameters | Parameter | Required | Description | |---|---|---| | `taskId` | yes | Task ID from createTask | ## Response ```json { "code": 200, "msg": "success", "data": { "taskId": "task_nano-banana-2_1790621023886ca4e4d", "task_id": "task_nano-banana-2_1790621023886ca4e4d", "model": "nano-banana-2", "state": "success", "status": "completed", "param": "{\"model\":\"nano-banana-2\",\"callBackUrl\":\"\",\"input\":{\"prompt\":\"...\"}}", "resultJson": "{\"resultUrls\":[\"https://mixmedia.tech/files/7496aef5292507f51b84cb2cb258d001.png\"]}", "failCode": "", "failMsg": "", "costTime": 104016, "completeTime": 1790621127902, "createTime": 1790621023886, "updateTime": 1790621127902, "progress": 100, "creditsConsumed": 0.015, "costRub": 1.33, "refunded": false, "filesExpired": false, "callback": null } } ``` | Field | Meaning | |---|---| | `state` | Status — see the table below | | `resultJson` | On `success` — a JSON string with `resultUrls` (file links live 24 hours — download right away) | | `filesExpired` | `true` — the files are already deleted (24 hours passed) | | `failCode`, `failMsg` | Error code and text on `fail` | | `creditsConsumed` | Charged in dollars, e.g. `0.015` (0 after a refund) | | `costRub` | Amount in rubles | | `refunded` | `true` — the money was refunded (task failed) | | `callback` | Callback delivery status if a `callBackUrl` was set | | `costTime`, `createTime`, `completeTime` | Duration and timestamps, ms | ## States | state | Meaning | |---|---| | `waiting` | Accepted, waiting in the queue | | `queuing` | Handed to the model | | `generating` | Generating | | `success` | Done ✓ | | `fail` | Failed, money refunded | A task that does not finish within 20 minutes becomes `fail`. ## Examples ```bash curl "https://mixmedia.tech/api/v1/jobs/recordInfo?taskId=task_nano-banana-2_1790621023886ca4e4d" \ -H "Authorization: Bearer $API_KEY" ``` ```python import os, requests r = requests.get( "https://mixmedia.tech/api/v1/jobs/recordInfo", params={"taskId": "task_nano-banana-2_1790621023886ca4e4d"}, headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, ) print(r.json()) # data.state, data.resultJson ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/recordInfo?taskId=task_nano-banana-2_1790621023886ca4e4d", { headers: { Authorization: `Bearer ${process.env.API_KEY}` }, }); console.log(await r.json()); // data.state, data.resultJson ``` ## Errors | code | error | When | |---|---|---| | 401 | `authentication_error` | Missing or invalid key | | 404 | `task_not_found` | No such task in your account | | 400 | `invalid_request_error` | `taskId` is missing | --- # GET /api/v1/user/balance > Current account balance in dollars. ## Request ```http GET https://mixmedia.tech/api/v1/user/balance Authorization: Bearer ``` ## Parameters None. ## Response ```json { "code": 200, "msg": "success", "data": { "balance": "4.9600", "currency": "USD" } } ``` `balance` is the balance in dollars. ## Examples ```bash curl "https://mixmedia.tech/api/v1/user/balance" \ -H "Authorization: Bearer $API_KEY" ``` ```python import os, requests r = requests.get( "https://mixmedia.tech/api/v1/user/balance", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, ) print(r.json()) # data.balance ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/user/balance", { headers: { Authorization: `Bearer ${process.env.API_KEY}` }, }); console.log(await r.json()); // data.balance ``` ## Errors | code | error | When | |---|---|---| | 401 | `authentication_error` | Missing or invalid key | --- # POST /api/v1/files/upload > Uploads your photo and returns a link you can pass to the model input. ## Request ```http POST https://mixmedia.tech/api/v1/files/upload Authorization: Bearer Content-Type: multipart/form-data ``` ## Parameters | Form field | Required | Description | |---|---|---| | `file` | yes | JPG, PNG or WebP, up to 30 MB | The file is kept for 1 hour after its last use: every generation with it extends the term; an unused file is deleted after about an hour. You can skip uploading and pass any public https link instead. ## Response ```json { "code": 200, "msg": "success", "data": { "url": "https://mixmedia.tech/files/5ee4b004b268e2d37c86c33552fe4f3e.jpg", "fileName": "5ee4b004b268e2d37c86c33552fe4f3e.jpg", "expiresInDays": 1 } } ``` ## Examples ```bash curl -X POST https://mixmedia.tech/api/v1/files/upload \ -H "Authorization: Bearer $API_KEY" \ -F "file=@photo.jpg" ``` ```python import os, requests r = requests.post( "https://mixmedia.tech/api/v1/files/upload", headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, files={"file": open("photo.jpg", "rb")}, ) print(r.json()["data"]["url"]) ``` ```javascript import fs from "node:fs"; const fd = new FormData(); fd.append("file", new Blob([fs.readFileSync("photo.jpg")], { type: "image/jpeg" }), "photo.jpg"); const r = await fetch("https://mixmedia.tech/api/v1/files/upload", { method: "POST", headers: { Authorization: `Bearer ${process.env.API_KEY}` }, body: fd, }); console.log((await r.json()).data.url); ``` ## Errors | code | error | When | |---|---|---| | 401 | `authentication_error` | Missing or invalid key | | 400 | `invalid_request_error` | Wrong format or file too large | --- # Other endpoints > Task list and the model catalog as JSON. ## GET /api/v1/jobs/list Recent account tasks. Parameters: `limit` (1–100, default 20), `state` (filter), `before` (pass `data.nextBefore` for the next page). ```bash curl "https://mixmedia.tech/api/v1/jobs/list?limit=5" \ -H "Authorization: Bearer $API_KEY" ``` ```python import os, requests r = requests.get( "https://mixmedia.tech/api/v1/jobs/list", params={"limit": "5"}, headers={"Authorization": f"Bearer {os.environ['API_KEY']}"}, ) print(r.json()) # data.items, data.nextBefore ``` ```javascript const r = await fetch("https://mixmedia.tech/api/v1/jobs/list?limit=5", { headers: { Authorization: `Bearer ${process.env.API_KEY}` }, }); console.log(await r.json()); // data.items, data.nextBefore ``` ## GET /api/v1/models Model catalog: IDs, prices and parameters. No key required. ```bash curl https://mixmedia.tech/api/v1/models ``` --- # Callbacks > We POST the result to your server when the task finishes — no recordInfo polling. ## How to enable Pass `callBackUrl` to [createTask](https://docs.mixmedia.tech/en/endpoints/create-task). When the task becomes `success` or `fail`, we POST the same JSON that [recordInfo](https://docs.mixmedia.tech/en/endpoints/record-info) returns. ```http POST Content-Type: application/json X-Signature: 3f1c9a…e07b # signature, see below X-Timestamp: 1790621128 X-Task-Id: task_nano-banana-2_1790621023886ca4e4d X-Event: task.success # or task.fail X-Delivery-Attempt: 1 ``` ## What to reply Any 2xx response within 15 seconds. Otherwise we retry after 30 s, 2 min and 10 min (4 attempts in total). An event may arrive twice — dedupe by `taskId`. ## Signature verification The secret (`whsec_…`) is in [Dashboard → API keys](https://mixmedia.tech/cabinet/keys#webhooks). The signature is the hex HMAC-SHA256 of the **raw** request body: ```python import hmac, hashlib def valid(raw_body: bytes, signature: str, secret: str) -> bool: expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, signature) # Flask: valid(request.get_data(), request.headers["X-Signature"], "whsec_...") ``` ```javascript import crypto from "node:crypto"; function valid(rawBody, signature, secret) { const expected = crypto.createHmac("sha256", secret).update(rawBody).digest("hex"); return signature.length === expected.length && crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)); } // Express: app.post("/callback", express.raw({ type: "application/json" }), (req, res) => { // if (!valid(req.body, req.get("X-Signature"), process.env.WEBHOOK_SECRET)) return res.sendStatus(401); // const task = JSON.parse(req.body).data; res.send("ok"); // }); ``` ```php # Keys & authentication > How to send the key and manage keys. Send the key with every request: ```http Authorization: Bearer sk-aim-XXXXXXXXXXXXXXXX ``` - Create keys in the [dashboard](https://mixmedia.tech/cabinet/keys), up to 20 active. All keys share one balance. - A key is shown once. Lost it? Create a new one. - "Disable" is temporary (can be enabled again). "Delete" is permanent; spend history is kept. - Never put the key in website or app code — call the API from your server. --- # Idempotency > The Idempotency-Key header: a retried request does not create a second task or charge twice. ```http Idempotency-Key: order-1001 ``` Pass a unique value (order ID or UUID, up to 128 chars) to `createTask`. | Situation | Result | |---|---| | Retry with the same key and body | Same `taskId`, `idempotentReplay: true`, no charge | | Same key, different body | `409 idempotency_conflict` | --- # Pricing & payment > Price per picture or per second of video in dollars, refunds on failure, top up by card or SBP. | Model | ID | Price per picture (video — per second, text — per 1M tokens) | |---|---|---| | [FLUX 3 Image](https://docs.mixmedia.tech/en/models/flux-3-image) | `flux-3-image` | 1K $0.05 · 1.5K $0.073 · 2K $0.104 · 4K $0.632 | | [FLUX 3 Image Klein](https://docs.mixmedia.tech/en/models/flux-3-image-klein) | `flux-3-image-klein` | 1K $0.013 · 2K $0.021 · 4K $0.051 | | [Flux Dev](https://docs.mixmedia.tech/en/models/flux-dev) | `flux-dev` | $0.033 | | [GPT Image 2.6](https://docs.mixmedia.tech/en/models/gpt-image-2.6) | `gpt-image-2.6-text-to-image` | $0.035–$0.265 (depends on quality and resolution) | | [GPT Image 2.6](https://docs.mixmedia.tech/en/models/gpt-image-2.6) | `gpt-image-2.6-image-to-image` | $0.035–$0.265 (depends on quality and resolution) | | [GPT Image 2.5](https://docs.mixmedia.tech/en/models/gpt-image-2.5) | `gpt-image-2.5-image-to-image` | $0.05–$0.23 (depends on quality and resolution) | | [GPT Image 2.5](https://docs.mixmedia.tech/en/models/gpt-image-2.5) | `gpt-image-2.5-text-to-image` | $0.05–$0.23 (depends on quality and resolution) | | [Nano Banana 2.1](https://docs.mixmedia.tech/en/models/nano-banana-2) | `nano-banana-2` | 0.5K $0.025 · 1K $0.025 · 2K $0.035 · 4K $0.04 | | [Nano Banana Pro](https://docs.mixmedia.tech/en/models/nano-banana-pro) | `nano-banana-pro` | 1K $0.05 · 2K $0.055 · 4K $0.065 | | [Nano Banana Lite](https://docs.mixmedia.tech/en/models/nano-banana) | `nano-banana-lite-edit` | 1K $0.02 · 2K $0.02 | | [Nano Banana Lite](https://docs.mixmedia.tech/en/models/nano-banana) | `nano-banana-lite` | 1K $0.02 · 2K $0.02 | | [Seedream Pro](https://docs.mixmedia.tech/en/models/seedream-pro) | `seedream-pro` | 1K $0.05 · 1.5K $0.05 · 2K $0.095 | | [Seedream 5.5](https://docs.mixmedia.tech/en/models/seedream-5.5) | `seedream-5.5` | 1K $0.04 · 1.5K $0.04 · 2K $0.045 | | [Seedream Flash](https://docs.mixmedia.tech/en/models/seedream-flash) | `seedream-flash` | 1K $0.025 · 1.5K $0.025 · 2K $0.025 | | [MiniMax H3 Image](https://docs.mixmedia.tech/en/models/minimax-h3-image) | `minimax-h3-image` | 1K $0.035 · 2K $0.035 · 4K $0.105 | | [MiniMax H3 Image Highspeed](https://docs.mixmedia.tech/en/models/minimax-h3-image-highspeed) | `minimax-h3-image-highspeed` | 1K $0.055 · 2K $0.055 · 4K $0.195 | | [Kling V4 Image](https://docs.mixmedia.tech/en/models/kling-v4-image) | `kling-v4-image` | 2K $0.075 · 4K $0.112 · 8K $0.186 | | [Kling V4 Long Image](https://docs.mixmedia.tech/en/models/kling-v4-long-image) | `kling-v4-long-image` | $0.279–$1.022 (depends on quality and resolution) | | [MAI Image 2.7](https://docs.mixmedia.tech/en/models/mai-image-2.7) | `mai-image-2.7` | 1K $0.037 · 2K $0.146 | | [MAI Image 2.7 Flash](https://docs.mixmedia.tech/en/models/mai-image-2.7-flash) | `mai-image-2.7-flash` | 1K $0.012 · 2K $0.043 | | [Claude Fable 5.2](https://docs.mixmedia.tech/en/models/claude-fable-5.2) | `claude-fable-5.2` | $10.88 / 1M input · $54.4 / 1M output | | [Claude Opus 5.5](https://docs.mixmedia.tech/en/models/claude-opus-5.5) | `claude-opus-5.5` | $4.16 / 1M input · $20.8 / 1M output | | [Claude Sonnet 5.5](https://docs.mixmedia.tech/en/models/claude-sonnet-5.5) | `claude-sonnet-5.5` | $2.08 / 1M input · $10.4 / 1M output | | [Claude Sonnet 4.5](https://docs.mixmedia.tech/en/models/claude-sonnet-4.5) | `claude-sonnet-4.5` | $2.52 / 1M input · $12.6 / 1M output | | [Claude Haiku 5.5](https://docs.mixmedia.tech/en/models/claude-haiku-5.5) | `claude-haiku-5.5` | $0.104 / 1M input · $0.52 / 1M output | | [Gemini 4 Carbon](https://docs.mixmedia.tech/en/models/gemini-4-carbon) | `gemini-4-carbon` | $2.72 / 1M input · $13.6 / 1M output | | [Gemini 4 Hydrogen](https://docs.mixmedia.tech/en/models/gemini-4-hydrogen) | `gemini-4-hydrogen` | $1.56 / 1M input · $7.8 / 1M output | | [Gemini 4 Argon](https://docs.mixmedia.tech/en/models/gemini-4-argon) | `gemini-4-argon` | $2.72 / 1M input · $13.6 / 1M output | | [Gemini 3.8 Flash](https://docs.mixmedia.tech/en/models/gemini-3.8-flash) | `gemini-3.8-flash` | $0.78 / 1M input · $3.9 / 1M output | | [Gemini 3.7 Flash](https://docs.mixmedia.tech/en/models/gemini-3.7-flash) | `gemini-3.7-flash` | $0.78 / 1M input · $3.9 / 1M output | | [Gemini 3.6 Flash](https://docs.mixmedia.tech/en/models/gemini-3.6-flash) | `gemini-3.6-flash` | $1.56 / 1M input · $7.8 / 1M output | | [Gemini 3.1 Pro](https://docs.mixmedia.tech/en/models/gemini-3.1-pro) | `gemini-3.1-pro` | $2.08 / 1M input · $12.48 / 1M output | | [Gemini 3 Pro](https://docs.mixmedia.tech/en/models/gemini-3-pro) | `gemini-3-pro` | $2.08 / 1M input · $12.48 / 1M output | | [GPT-6.2 Sol](https://docs.mixmedia.tech/en/models/gpt-6.2-sol) | `gpt-6.2-sol` | $2.08 / 1M input · $10.4 / 1M output | | [GPT-6.2 Astra](https://docs.mixmedia.tech/en/models/gpt-6.2-astra) | `gpt-6.2-astra` | $8.32 / 1M input · $41.6 / 1M output | | [GPT-6.1 Sol](https://docs.mixmedia.tech/en/models/gpt-6.1-sol) | `gpt-6.1-sol` | $1.68 / 1M input · $8.4 / 1M output | | [GPT-6 Astra](https://docs.mixmedia.tech/en/models/gpt-6-astra) | `gpt-6-astra` | $8.4 / 1M input · $42 / 1M output | | [GPT-5.6](https://docs.mixmedia.tech/en/models/gpt-5.6) | `gpt-5.6` | $4.16 / 1M input · $20.8 / 1M output | | [DeepSeek V4 Pro](https://docs.mixmedia.tech/en/models/deepseek-v4-pro) | `deepseek-v4-pro` | $0.8743 / 1M input · $2.6229 / 1M output | | [DeepSeek V4.1 Flash](https://docs.mixmedia.tech/en/models/deepseek-v4.1-flash) | `deepseek-v4.1-flash` | $0.1943 / 1M input · $0.7771 / 1M output | | [Kimi K3.1 Pro](https://docs.mixmedia.tech/en/models/kimi-k3.1-pro) | `kimi-k3.1-pro` | $1.36 / 1M input · $6.8 / 1M output | | [Suno](https://docs.mixmedia.tech/en/models/suno-v6) | `suno-v6` | $0.09 | | [Gemini Omni 1.2 Flash](https://docs.mixmedia.tech/en/models/gemini-omni-1.2-flash) | `gemini-omni-1.2-flash` | 360p $0.026 · 720p $0.059 · 1080p $0.065 · 4k $0.143 per second; with your video — 360p $0.026 · 720p $0.059 · 1080p $0.065 · 4k $0.143 per second | | [Gemini Omni Flash](https://docs.mixmedia.tech/en/models/gemini-omni-flash) | `gemini-omni-flash` | 360p $0.049 · 720p $0.082 · 1080p $0.082 · 4k $0.244 per second | | [Grok Imagine 1.5](https://docs.mixmedia.tech/en/models/grok-imagine-1.5) | `grok-imagine-1.5` | 480p $0.096 · 720p $0.168 · 1080p $0.3 per second | | [Grok Imagine](https://docs.mixmedia.tech/en/models/grok-imagine) | `grok-imagine` | 480p $0.065 · 720p $0.084 per second; with your video — $0.096 per second | | [Higgsfield Genjutsu](https://docs.mixmedia.tech/en/models/higgsfield-genjutsu) | `higgsfield-genjutsu` | 480p $0.414 · 720p $0.886 · 1080p $2.122 per second of your video | | [Kling 4.0 Flash](https://docs.mixmedia.tech/en/models/kling-4.0-flash) | `kling-4.0-flash` | 720p $0.112 per second; with your video — 720p $0.112 per second | | [Kling 4.0](https://docs.mixmedia.tech/en/models/kling-4.0) | `kling-4.0` | 720p $0.186 · 1080p $0.277 per second; with your video — 720p $0.186 · 1080p $0.277 per second | | [MiniMax H3](https://docs.mixmedia.tech/en/models/minimax-h3-video) | `minimax-h3-video` | 768p $0.075 · 2K $0.119 per second; with your video — 768p $0.075 · 2K $0.119 per second | | [Vidu Q4](https://docs.mixmedia.tech/en/models/vidu-q4) | `vidu-q4` | 540p $0.059 · 720p $0.119 · 1080p $0.134 · 2K $0.212 · 4K $0.433 per second | | [Kling 3.0](https://docs.mixmedia.tech/en/models/kling-3.0) | `kling-3.0` | 720p $0.091 · 1080p $0.117 · 4k $0.558 per second | | [Kling 3.0 Omni](https://docs.mixmedia.tech/en/models/kling-3.0-omni) | `kling-3.0-omni` | 720p $0.091 · 1080p $0.117 · 4k $0.558 per second; with your video — 720p $0.132 · 1080p $0.176 per second | | [Kling 3.0 Motion Control](https://docs.mixmedia.tech/en/models/kling-3.0-motion-control) | `kling-3.0-motion-control` | 720p $0.134 · 1080p $0.179 per second of your video | | [Kling 2.6](https://docs.mixmedia.tech/en/models/kling-2.6) | `kling-2.6` | 720p $0.072 · 1080p $0.082 per second | | [Kling 2.6 Motion Control](https://docs.mixmedia.tech/en/models/kling-2.6-motion-control) | `kling-2.6-motion-control` | 720p $0.075 · 1080p $0.119 per second of your video | | [Kling 2.5 Turbo](https://docs.mixmedia.tech/en/models/kling-2.5-turbo) | `kling-2.5-turbo` | 1080p $0.082 per second | | [OmniHuman 2.0](https://docs.mixmedia.tech/en/models/omnihuman-2.0) | `omnihuman-2.0` | 720p $0.091 per second | | [PixVerse V6](https://docs.mixmedia.tech/en/models/pixverse-v6) | `pixverse-v6` | 360p $0.037 · 540p $0.047 · 720p $0.063 · 1080p $0.12 per second | | [Pruna P-Video Replace](https://docs.mixmedia.tech/en/models/video-replace) | `pruna-p-video-replace` | 720p $0.039 · 1080p $0.078 per second of your video | | [Runway](https://docs.mixmedia.tech/en/models/runway) | `runway` | 720p $0.016 · 1080p $0.039 per second | | [Seedance 2.5](https://docs.mixmedia.tech/en/models/seedance-2.5) | `seedance-2.5` | 480p $0.147 · 720p $0.331 · 1080p $0.83 per second; with your video — 480p $0.09 · 720p $0.2 · 1080p $0.501 per second | | [Seedance 2.5 Flash](https://docs.mixmedia.tech/en/models/seedance-2.5-flash) | `seedance-2.5-flash` | 480p $0.083 · 720p $0.186 per second; with your video — 480p $0.056 · 720p $0.113 per second | | [Seedance 2.0](https://docs.mixmedia.tech/en/models/seedance-2.0) | `seedance-2.0` | 480p $0.1 · 720p $0.216 · 1080p $0.536 · 4k $1.092 per second; with your video — 480p $0.06 · 720p $0.132 · 1080p $0.326 · 4k $0.672 per second | | [Seedance 2.0 Fast](https://docs.mixmedia.tech/en/models/seedance-2.0-fast) | `seedance-2.0-fast` | 480p $0.062 · 720p $0.131 per second; with your video — 480p $0.036 · 720p $0.079 per second | | [Seedance 2.0 Mini](https://docs.mixmedia.tech/en/models/seedance-2.0-mini) | `seedance-2.0-mini` | 480p $0.025 · 720p $0.054 per second; with your video — 480p $0.016 · 720p $0.033 per second | | [Seedance 1.0 Pro Fast](https://docs.mixmedia.tech/en/models/seedance-1.0-pro-fast) | `seedance-1.0-pro-fast` | 480p $0.012 · 720p $0.026 · 1080p $0.055 per second | | [Seedance 1.5 Pro](https://docs.mixmedia.tech/en/models/seedance-1.5-pro) | `seedance-1.5-pro` | 480p $0.03 · 720p $0.068 · 1080p $0.141 per second | | [Veo 3.1 Quality](https://docs.mixmedia.tech/en/models/veo-3.1) | `veo-3.1` | 720p $0.204 · 1080p $0.208 per second | | [Veo 3.1 Fast](https://docs.mixmedia.tech/en/models/veo-3.1-fast) | `veo-3.1-fast` | 720p $0.049 · 1080p $0.053 per second | | [Veo 3.1 Lite](https://docs.mixmedia.tech/en/models/veo-3.1-lite) | `veo-3.1-lite` | 720p $0.025 · 1080p $0.029 per second | | [Wan 3.0](https://docs.mixmedia.tech/en/models/wan-3.0) | `wan-3.0` | 480p $0.054 · 720p $0.108 · 1080p $0.215 per second; with your video — 480p $0.054 · 720p $0.108 · 1080p $0.215 per second | | [Wan 2.7](https://docs.mixmedia.tech/en/models/wan-2.7) | `wan-2.7` | 720p $0.104 · 1080p $0.156 per second; with your video — 720p $0.104 · 1080p $0.156 per second | | [Wan 2.5](https://docs.mixmedia.tech/en/models/wan-2.5) | `wan-2.5` | 720p $0.087 · 1080p $0.143 per second | | [Wan 2.2 Fast](https://docs.mixmedia.tech/en/models/wan-2.2-i2v-fast) | `wan-2.2-i2v-fast` | 480p $0.017 · 720p $0.038 per second | | [Nano Banana](https://docs.mixmedia.tech/en/models/nano-banana-classic) | `google/nano-banana-edit` | 1K $0.03 · 2K $0.03 | | [Nano Banana](https://docs.mixmedia.tech/en/models/nano-banana-classic) | `google/nano-banana` | 1K $0.03 · 2K $0.03 | - The price is charged when a task is created and fully refunded if it fails. - **Text models** (`claude-fable-5.2`, `claude-opus-5.5`, `claude-sonnet-5.5`, `claude-sonnet-4.5`, `claude-haiku-5.5`, `gemini-4-carbon`, `gemini-4-hydrogen`, `gemini-4-argon`, `gemini-3.8-flash`, `gemini-3.7-flash`, `gemini-3.6-flash`, `gemini-3.1-pro`, `gemini-3-pro`, `gpt-6.2-sol`, `gpt-6.2-astra`, `gpt-6.1-sol`, `gpt-6-astra`, `gpt-5.6`, `deepseek-v4-pro`, `deepseek-v4.1-flash`, `kimi-k3.1-pro`) are billed by actual tokens: - **Tokens are actual**: counted by the model itself. Input = prompt, instruction and pictures; output = the answer including the model's reasoning. - Cost = input × input price / 1M + output × output price / 1M, rounded up to $0.0001. - On create, a reserve for your question and up to 16384 output tokens is held (an answer never costs more than that). When the answer is ready the actual amount is charged and the rest is returned at once. A failed task returns the whole reserve. - `recordInfo` and the callback return `usage`: `input_tokens`, `output_tokens`, `total_tokens`, `cost` (USD), `estimated: false`. ## Claude Code, Codex, Gemini CLI — API prices USD per 1M tokens at api.mixmedia.tech (agent API). These are not the playground / `createTask` prices in the table above. Live list: https://api.mixmedia.tech/v1/models. Guides: https://mixmedia.tech/en/api/guides | Model | ID | Coding in / out / cache read | Direct API in / out / cache read | |---|---|---|---| | Claude Opus 5.5 | `claude-opus-5-5` | $4.16 / $20.8 / $0.208 | $4.8 / $24 / $0.24 | | Claude Sonnet 5.5 | `claude-sonnet-5-5` | $2.08 / $10.4 / $0.208 | $2.4 / $12 / $0.24 | | Claude Haiku 5.5 | `claude-haiku-5-5` | $0.104 / $0.52 / $0.0104 | $0.12 / $0.6 / $0.012 | | Claude Fable 5.2 | `claude-fable-5.2` | $8.32 / $41.6 / $0.208 | $9.6 / $48 / $0.24 | | GPT-6 Astra | `gpt-6-astra` | $10.4 / $52 / $1.04 | $12 / $60 / $1.2 | | GPT-6.1 Sol | `gpt-6.1-sol` | $2.08 / $10.4 / $0.104 | $2.4 / $12 / $0.12 | | GPT-6.2 Sol | `gpt-6.2-sol` | $2.08 / $10.4 / $0.104 | $2.4 / $12 / $0.12 | | GPT-6.2 Astra | `gpt-6.2-astra` | $8.32 / $41.6 / $0.416 | $9.6 / $48 / $0.48 | | GPT-5.6 | `gpt-5.6` | $4.16 / $20.8 / $0.416 | $4.8 / $24 / $0.48 | | Gemini 4 Argon | `gemini-4-argon` | $4.16 / $20.8 / $0.208 | $4.8 / $24 / $0.24 | | Gemini 3.8 Flash | `gemini-3.8-flash` | $0.78 / $3.9 / $0.078 | $0.9 / $4.5 / $0.09 | | Gemini 3.7 Flash | `gemini-3.7-flash` | $0.78 / $3.9 / $0.078 | $0.9 / $4.5 / $0.09 | | Gemini 4 Carbon | `gemini-4-carbon` | $4.16 / $20.8 / $0.208 | $4.8 / $24 / $0.24 | | Gemini 4 Hydrogen | `gemini-4-hydrogen` | $1.56 / $7.8 / $0.078 | $1.8 / $9 / $0.09 | | DeepSeek V4 Pro | `deepseek-v4-pro` | $0.6686 / $2.0058 / $0.0669 | $0.7715 / $2.3144 / $0.0771 | | DeepSeek V4.1 Flash | `deepseek-v4.1-flash` | $0.1486 / $0.5942 / $0.0149 | $0.1715 / $0.6857 / $0.0171 | Coding prices apply to Claude Code, Codex, Gemini CLI, OpenCode, Cline and similar tools. A regular API call (curl, your own backend, an SDK) uses the Regular API column. Cache write is 1.25× the input price in the same column. A 1-hour cache write is 2× input for Claude and 2.5× input for GPT. Long context: Claude Haiku 5.5: prompts over 100k tokens — coding $0.52 / $2.6, direct API $0.6 / $3; GPT-6 Astra: prompts over 272k tokens — coding $20.8 / $78, direct API $24 / $90; GPT-6.1 Sol: prompts over 272k tokens — coding $4.16 / $15.6, direct API $4.8 / $18; GPT-6.2 Sol: prompts over 272k tokens — coding $4.16 / $15.6, direct API $4.8 / $18; GPT-6.2 Astra: prompts over 272k tokens — coding $16.64 / $62.4, direct API $19.2 / $72; GPT-5.6: prompts over 272k tokens — coding $8.32 / $31.2, direct API $9.6 / $36. - Top up in the [dashboard](https://mixmedia.tech/cabinet/billing): you choose the amount in dollars (from $5) and pay with a Russian card, SBP or SberPay (YooKassa), or with any card worldwide — $9 and $15 packages via Lava.top. - Balance from code: [GET /api/v1/user/balance](https://docs.mixmedia.tech/en/endpoints/balance) (`balance` field). --- # Support > How to contact support: tickets in the dashboard, replies on the site and in Telegram. Open [Support](https://mixmedia.tech/support) (link in the header and the dashboard) and create a ticket: - **Subject** and **message** — what you did, what you expected and what happened. Plain text only, no HTML. - **Task ID** (optional) — e.g. `task_nano-banana-2_…` from the [logs](https://mixmedia.tech/cabinet/tasks) or the API response. This helps us find the problem faster. - **Screenshot** (optional) — PNG, JPG, WebP or GIF up to 5 MB. Visible only to you and the administrators. Statuses: **Open** — waiting for a reply, **Answered** — support replied, **Closed** — solved (you can still write, it reopens). If you signed in with Telegram, the bot notifies you about the reply. Never send API keys or passwords. For payment questions include the payment time and method (YooKassa / Lava.top). --- # For AI assistants / MCP > Connect MixMedia to Claude, ChatGPT, Cursor and other AI assistants via MCP: models, exact prices and generation. MixMedia MCP server: `https://api.mixmedia.tech/mcp` (Streamable HTTP). Step-by-step setup for Claude Code, Codex, Cursor, Gemini CLI, OpenCode, VS Code and Cline, a local Agent Skill and an llms.txt prompt: [Agent tools](https://mixmedia.tech/en/agent-tools). | Tool | Key | What it does | |---|---|---| | `list_models` | not needed | Models and prices, filter by category (image, video) | | `get_model` | not needed | Model parameters and price rules | | `calculate_price` | not needed | Exact price in $ and ₽ for a model and parameters | | `create_generation` | required | Starts a generation, charged from the balance like createTask | | `get_generation` | required | Status and result links | | `get_balance` | required | Account balance | Create a key in [Dashboard → API keys](https://mixmedia.tech/cabinet/keys) and send it as the `Authorization: Bearer ` header in the client settings. Without a key you get models and prices. ## Cursor File `~/.cursor/mcp.json` (or `.cursor/mcp.json` in the project): ```json { "mcpServers": { "mixmedia": { "url": "https://api.mixmedia.tech/mcp", "headers": { "Authorization": "Bearer sk-aim-..." } } } } ``` ## Claude Desktop File `claude_desktop_config.json` (Settings → Developer → Edit Config). Needs Node.js: ```json { "mcpServers": { "mixmedia": { "command": "npx", "args": [ "-y", "mcp-remote", "https://api.mixmedia.tech/mcp", "--header", "Authorization: Bearer sk-aim-..." ] } } } ``` Models and prices only, no key: Settings → Connectors → Add custom connector → URL `https://api.mixmedia.tech/mcp`. ## Claude Code ```bash claude mcp add --transport http mixmedia https://api.mixmedia.tech/mcp \ --header "Authorization: Bearer sk-aim-..." ``` ## ChatGPT Settings → Apps & Connectors → Advanced → Developer mode → Create connector: URL `https://api.mixmedia.tech/mcp`, authentication — none. ChatGPT can then pick a model and quote the exact price. ## Other clients Any client with remote MCP (Streamable HTTP) support: URL `https://api.mixmedia.tech/mcp`, plus the `Authorization: Bearer ` header if needed. ## Files for AI and developers - [llms.txt](https://mixmedia.tech/llms.txt) and [llms-full.txt](https://mixmedia.tech/llms-full.txt) — what MixMedia is, models and prices in one text - [prices.json](https://mixmedia.tech/prices.json) — prices of all models in $ and ₽ plus the rules (same: `https://api.mixmedia.tech/v1/pricing`) - [Price calculator](https://api.mixmedia.tech/v1/pricing/calculate?model=seedance-2.0&resolution=720p&duration=5) — exact price, no key: `GET https://api.mixmedia.tech/v1/pricing/calculate?model=…&resolution=…&duration=…` - [openapi.json](https://api.mixmedia.tech/openapi.json) — the API as OpenAPI 3.1 > Keep the key in the client settings, never in the chat. `create_generation` charges like a normal API request: the assistant should show the price and get your confirmation first.