# reAPI — Full Documentation & Blog > One API for top AI image, video, chat, and audio models. This file is the complete documentation set and blog in markdown; https://reapi.ai/llms.txt is the link index. Docs pages: 73 Blog posts: 108 # ai-essay-writer (https://reapi.ai/docs/ai-essay-writer) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > The AI Essay Writer API generates a complete, structured essay from a > **topic** plus an **academic level**, **essay type**, and **length**. One > async call returns a task id; poll until the essay is ready. An optional > `humanized` pass rewrites the result to read more human. Pricing is per > essay, scaled by the length tier — see current rates on the > [model page](https://reapi.ai/models/ai-essay-writer). ## Quick example ```bash curl https://reapi.ai/api/v1/essay \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ai-essay-writer", "type": "Descriptive", "academic_level": "HighSchool", "length": "Short", "input": "Write an essay about the ketogenic diet" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/essay", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "ai-essay-writer", "type": "Descriptive", "academic_level": "HighSchool", "length": "Short", "input": "Write an essay about the ketogenic diet", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/essay", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "ai-essay-writer", type: "Descriptive", academic_level: "HighSchool", length: "Short", input: "Write an essay about the ketogenic diet", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "ai-essay-writer", "type": "Descriptive", "academic_level": "HighSchool", "length": "Short", "input": "Write an essay about the ketogenic diet", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/essay", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "ai-essay-writer", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload carries the generated essay text in the task output. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/essay GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required `string`. Must be `"ai-essay-writer"`. ### `input` — required `string`. The essay topic or instructions the model builds the essay around. ### `type` — required `string`. The rhetorical mode of the essay. | Value | Notes | | ---------------------- | -------------------------- | | `"Descriptive"` | Descriptive essay | | `"Narrative"` | Narrative essay | | `"Persuasive"` | Persuasive / argumentative | | `"Analytical"` | Analytical essay | | `"CompareAndContrast"` | Compare-and-contrast essay | ### `academic_level` — required `string`. The writing level the essay targets (vocabulary, structure, depth). | Value | | -------------- | | `"HighSchool"` | | `"University"` | | `"Doctorate"` | ### `length` — required `string`. Output length tier. **Pricing scales with this tier.** | Value | | ---------- | | `"Short"` | | `"Medium"` | | `"Long"` | ### `humanized` — boolean, default `false` Run the finished essay through a de-AI pass so it reads more human. ### `model_version` — string, default `"v2"` Generation model version. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. The completed `output` carries the generated essay text. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "ai-essay-writer", "status": "completed", "created_at": 1735000000, "output": { "text": "The ketogenic diet, commonly referred to as the keto diet, is a high-fat, low-carbohydrate eating plan…" }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | --------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.text` is the essay | | `error` | object \| null | Populated on `failed` — `{ code, message }` | *** ## Pricing Per essay, scaled by the `length` tier. Each tier is priced at a fixed estimated output-word count × the per-word rate. **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_word_usd × estimated_words(length) × 1000) ``` `length` (Short / Medium / Long) selects the estimated word count. See the current per-tier rates in the pricing table on the [model page](https://reapi.ai/models/ai-essay-writer). Failed jobs refund automatically. *** ## Validation errors All cases below return HTTP 400. Pattern-match on `code`, not `message`. | Trigger | Code | Message (illustrative) | | ---------------------------------- | ------- | ----------------------------------------------- | | `input` missing | `20002` | `input is required` | | `type` missing / invalid | `20003` | `invalid type` | | `academic_level` missing / invalid | `20003` | `invalid academic_level` | | `length` missing / invalid | `20003` | `invalid length` | | Upstream out of credits | `80003` | Upstream provider could not process the request | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors). *** ## Tips * **Length drives the bill.** A Short essay costs less than a Long one; pick the smallest tier that fits the assignment. * **Set the type and level deliberately.** `academic_level` and `type` change the vocabulary, structure, and depth more than the prompt wording does. * **Use `humanized` for a natural read.** Turn it on when the essay needs to read less like AI; leave it off for the fastest result. * **The topic can be detailed.** `input` accepts full instructions, not just a title — constraints and angles in the topic carry into the essay. *** ## Related * [AI Humanizer](/docs/humanize) * [AI Text Detector](/docs/ai-text-detector) * [Errors catalog](/docs/api/errors) * [Quickstart](/docs/api/quickstart) --- # ai-text-detector (https://reapi.ai/docs/ai-text-detector) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > `ai-text-detector` is a single async endpoint that scores text 0–100 for how likely > it is AI-generated, aggregating several third-party detection engines into one > result plus per-engine sub-scores. See current pricing on the > [model page](https://reapi.ai/models/ai-text-detector). ## Quick example ```bash curl https://reapi.ai/api/v1/detect \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "ai-text-detector", "text": "Citizen science involves the public participating in scientific research. This can take many forms, from collecting data on local wildlife populations to analyzing astronomical images." }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/detect", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "ai-text-detector", "text": "Citizen science involves the public participating in scientific research. This can take many forms, from collecting data on local wildlife populations to analyzing astronomical images.", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/detect", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "ai-text-detector", text: "Citizen science involves the public participating in scientific research. This can take many forms, from collecting data on local wildlife populations to analyzing astronomical images.", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "ai-text-detector", "text": "Citizen science involves the public participating in scientific research. This can take many forms, from collecting data on local wildlife populations to analyzing astronomical images.", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/detect", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "ai-text-detector", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` until `status === "completed"`. A check usually finishes in a few seconds. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/detect GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; polling the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required Always `"ai-text-detector"`. ### `text` — required (string) The text to check for AI authorship. * **Maximum:** under **30,000 words** per request. * **Recommended:** at least \~200 words. Short snippets carry less signal, though the detector still returns a result. * Encode line breaks inside the JSON string as `\n`. *** ## Output ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "ai-text-detector", "status": "completed", "created_at": 1735000000, "output": { "detection": { "result": 12.0, "human": 88.0, "detectors": { "scoreGptZero": 50.0, "scoreOpenAI": 0.0, "scoreWriter": 0.0, "scoreCrossPlag": 0.0, "scoreCopyLeaks": 50.0, "scoreSapling": 0.0, "scoreContentAtScale": 0.0, "scoreZeroGPT": 50.0 } } }, "error": null } ``` ### Interpreting the score `result` is the headline **AI-likelihood**, 0–100: | Range | Reading | | -------- | --------------------- | | under 50 | Likely human-written. | | 50 – 60 | Possible AI. | | over 60 | Likely AI-generated. | `human` is the complementary human-likelihood. `detectors` carries each third-party engine's sub-score so you can see whether the engines agree or split. The headline `result` is the most accurate signal; treat the sub-scores as supporting detail. *** ## Pricing Billed **per word** of the `text` you submit, with a **50-word floor**. AI detection is priced at one-tenth the per-word rate of text humanization. Polling does not add any charge. Failed requests are refunded automatically. `1 credit = $0.001 USD`. See the live banner on the [model page](https://reapi.ai/models/ai-text-detector) for the current per-1,000-words rate in credits. *** ## Errors Standard envelope: ```json { "error": { "code": 20002, "message": "text is required", "request_id": "req_..." } } ``` Common cases: | Code | When | | ------- | -------------------------------------------------------------------------- | | `20002` | `text` missing. | | `20003` | `text` empty or at/over the 30,000-word cap. | | `30001` | Insufficient credits for the submitted word count. | | `80001` | Provider rejected the submission — includes insufficient upstream credits. | | `80003` | Provider failed while processing the detection. | *** ## Related * [AI Humanizer](/docs/humanize) — rewrite AI text to read human. Pair it with `ai-text-detector` for a detect → rewrite → detect QA loop. --- # claude-fable-5 (https://reapi.ai/docs/claude-fable-5) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Claude Fable 5 is Anthropic's most capable widely released model — a tier > above Opus — built for the most demanding reasoning and long-horizon > agentic work, exposed through api.reapi.ai as a drop-in OpenAI-compatible > Chat Completions endpoint (the native Anthropic `/v1/messages` surface is > also available). 1M token context, 128K max output, always-on adaptive > thinking, vision input, prompt caching, and tool use. Current rates live > on the [model page](https://reapi.ai/models/claude-fable-5) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-fable-5", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "max_tokens": 4096 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="claude-fable-5", messages=[{"role": "user", "content": "Hello"}], stream=True, max_tokens=4096, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```python from anthropic import Anthropic client = Anthropic( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai", ) with client.messages.stream( model="claude-fable-5", max_tokens=4096, messages=[{"role": "user", "content": "Hello"}], ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "claude-fable-5", messages: [{ role: "user", content: "Hello" }], stream: true, max_tokens: 4096, // `group` is an api.reapi.ai-specific extension; pass via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "claude-fable-5", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "max_tokens": 4096, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The Claude Fable 5 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoints ```http POST https://api.reapi.ai/v1/chat/completions # OpenAI-compatible POST https://api.reapi.ai/v1/messages # Anthropic-native ``` Both surfaces accept `claude-fable-5`. Pick whichever matches your SDK of record: * **`/v1/chat/completions`** — drop-in for the OpenAI SDKs. Same request shape, same SSE wire format. Set `base_url` to `https://api.reapi.ai/v1`. * **`/v1/messages`** — native Anthropic Messages format. Set `base_url` to `https://api.reapi.ai` for the Anthropic Python / TypeScript SDKs. Required for callers that need Anthropic-specific features (`cache_control` blocks for prompt caching, the `effort` parameter, summarized thinking display, native multi-block content, the full tool-use spec). *** ## Request body — `/v1/chat/completions` ### `model` — string, required Must be `"claude-fable-5"`. The value is echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec, plus content-parts for vision: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string OR content-parts array (text + image_url parts)" } ``` Multi-turn history is sent in chronological order — the last message is the one Claude responds to. ### `max_tokens` — integer, default `4096` Upper bound on output tokens. **Anthropic's API requires `max_tokens` on every call, including streamed ones** — even though the OpenAI SDKs treat it as optional. Set it generously (`128000` is the hard cap on the synchronous API) for long-form outputs; the model still stops at the natural end of its response. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. ### `tools` / `tool_choice` — optional Standard OpenAI tool-calling parameters. Claude Fable 5 supports the full OpenAI tool-use spec via this surface. For Anthropic's native tool-use schema (with `cache_control`, server-side tools, etc.) call `/v1/messages` directly. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. Omit if default routing is fine. **No sampling parameters.** Claude Fable 5 does not accept `temperature`, `top_p`, or `top_k` — Anthropic removed them on this model generation and requests that include them are rejected upstream. Steer style and variance through prompting instead. *** ## Adaptive thinking — always on Adaptive thinking is the **only** thinking mode on Claude Fable 5. It applies on every call — there is no way to disable it — and the model decides per request how much reasoning the task needs. Two consequences for integrators: * **Raw chain-of-thought is never returned.** Thinking blocks arrive with empty content by default. On the native `/v1/messages` surface, set `thinking: type adaptive, display summarized` (see Anthropic's adaptive-thinking docs for the exact field shape) to receive readable summarized thinking. * **Depth is tuned with `effort`, not a token budget.** On the native surface, `output_config.effort` accepts `low` through `max`. Higher effort means deeper reasoning and more output tokens; lower effort means faster, cheaper calls. *** ## Vision input (multimodal) Send images alongside text via OpenAI content-parts: ```json { "model": "claude-fable-5", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What does this chart show?" }, { "type": "image_url", "image_url": { "url": "https://example.com/chart.png" } } ] } ] } ``` Supported image formats: PNG, JPEG, GIF, WebP. Each image counts toward the input token budget based on its resolution. *** ## Prompt caching Anthropic's prompt caching pays off on stable system prompts, recurring RAG context, and long multi-turn agent histories. The first call pays the cache-write rate on the cacheable region; subsequent calls within the cache window pay only the (much lower) cache-read rate on those tokens. To enable caching, call `/v1/messages` natively and add a `cache_control` block. Example: ```json { "model": "claude-fable-5", "max_tokens": 4096, "system": [ { "type": "text", "text": "", "cache_control": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": "Question for the assistant" } ] } ``` The cache key is the hash of the cacheable content. See [api.reapi.ai/pricing](https://api.reapi.ai/pricing) for cache-read and cache-write rates. *** ## Refusals and fallback Claude Fable 5 includes safety classifiers that can decline certain requests. On the native `/v1/messages` surface a refusal is returned as a **successful response** with `stop_reason: "refusal"` — not an HTTP error — and the response reports which classifier declined the request. Two things follow: * **A request refused before any output is generated is not billed.** * **A refused request can usually be served by another Claude model.** Retry it with a different `model` value on the same key — Claude Opus 4.8 covers most workloads the classifier declines on Fable 5. Handle `stop_reason: "refusal"` (native surface) or an empty completion with a refusal marker (OpenAI surface) explicitly in your integration rather than treating it as a transport failure: it is deterministic for a given prompt, so a verbatim retry on the same model will refuse again. *** ## Response shape — `/v1/chat/completions` ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1749600000, "model": "claude-fable-5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "prompt_tokens_details": { "cached_tokens": 0 } } } ``` `usage.prompt_tokens_details.cached_tokens` reports how many input tokens were served from cache — the part billed at the cache-read rate rather than the standard input rate. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta in the OpenAI chunk format; the final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). *** ## Pricing Claude Fable 5 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. It bills along several dimensions — input tokens, output tokens, cache-read tokens, and per-request web search. The full 1M context window is billed at standard per-token rates with no long-context premium, and requests refused before any output is generated are not billed. Current rates live on [api.reapi.ai/pricing](https://api.reapi.ai/pricing) and in the pricing card at the top of the [model page](https://reapi.ai/models/claude-fable-5). Per-call bill: ``` billable_input = (prompt_tokens - cached_tokens) × input_rate / 1,000,000 cache_read_bill = cached_tokens × cache_read_rate / 1,000,000 output_bill = completion_tokens × output_rate / 1,000,000 ``` Cache-write rate applies on the first call that writes a cache block; subsequent hits pay only the cache-read rate. Web search, when used, is billed per request. Failed requests are not charged. *** ## Limits | Limit | Value | | ------------------- | ----------- | | Context window | 1M tokens | | Max output per call | 128K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | ----------------------------------------------------- | --------------------------------------------------------------------------------------------- | | `400` | Missing `max_tokens`, sampling params sent, bad shape | Anthropic requires `max_tokens`; `temperature` / `top_p` / `top_k` are rejected on this model | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that's a one-for-one wire failure and a retry from your side is safe; the upstream provider may have already produced output, but the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "claude-fable-5", "max_tokens": 4096, "messages": [ { "role": "user", "content": "Summarise this in three sentences." } ] } ``` ### Tool use (function calling, OpenAI surface) ```json { "model": "claude-fable-5", "max_tokens": 4096, "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Vision ```json { "model": "claude-fable-5", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read the error in this screenshot and suggest a fix." }, { "type": "image_url", "image_url": { "url": "https://your-cdn.com/screenshot.png" } } ] } ] } ``` ### Long context with prompt caching (native Anthropic surface) ```json { "model": "claude-fable-5", "max_tokens": 4096, "system": [ { "type": "text", "text": "<800K-token reference document>", "cache_control": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": "Find every mention of the constraint X and list them with line numbers." } ] } ``` *** ## When to pick Claude Fable 5 Pick Claude Fable 5 when the task sits past what Opus-tier models handle cleanly: * **Frontier long-horizon agentic work** — week-long refactors, codebase-scale migrations, autonomous runs that must stay coherent across hundreds of steps. * **The most demanding reasoning** — deep multi-step problems, ambiguous specifications, analysis where the answer quality justifies the top capability tier. * **Large-context analysis** — full codebases, long research packs, multi-document review, audit work across the 1M window. Route everyday premium coding to Claude Opus 4.8 and lighter traffic (classification, short replies, tight loops) to cheaper Claude or GPT models on the same key. *** ## Tips * **Set `max_tokens` generously.** Anthropic enforces it strictly — the model still stops at the natural end of its response, but a low cap will truncate before the real ending. * **Stream by default for chat UX.** Streaming cuts perceived latency dramatically — especially relevant here, since always-on adaptive thinking can add a pause before the first visible token. * **Don't send sampling parameters.** `temperature`, `top_p`, and `top_k` are rejected on Claude Fable 5. Steer variance and style through prompting. * **Cache the stable parts of long prompts.** A 500K-token RAG context on top of a 1KB user question can pay the cache-read rate on every subsequent call instead of the standard input rate — a big saving on multi-turn agents replaying long histories. * **Handle refusals as a first-class outcome.** Detect the refusal stop reason and retry on another Claude model instead of retrying verbatim. * **Use the native `/v1/messages` surface for Anthropic-only features.** `cache_control`, `effort`, summarized thinking display, native multi-block content, the full tool-use spec — all of those work through `/v1/messages` without needing translation. *** ## Related * [claude-opus-4-8](/docs/claude-opus-4-8) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # claude-opus-4-7 (https://reapi.ai/docs/claude-opus-4-7) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Claude Opus 4.7 is Anthropic's flagship model, exposed through > api.reapi.ai as a drop-in OpenAI-compatible Chat Completions endpoint > (the native Anthropic `/v1/messages` surface is also available). 1M > token context, 128K max output, vision input, prompt caching, and > tool use. Current rates live on the > [model page](https://reapi.ai/models/claude-opus-4-7) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-opus-4-7", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "max_tokens": 4096, "temperature": 0.7 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="claude-opus-4-7", messages=[{"role": "user", "content": "Hello"}], stream=True, max_tokens=4096, temperature=0.7, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```python from anthropic import Anthropic client = Anthropic( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai", ) with client.messages.stream( model="claude-opus-4-7", max_tokens=4096, messages=[{"role": "user", "content": "Hello"}], ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "claude-opus-4-7", messages: [{ role: "user", content: "Hello" }], stream: true, max_tokens: 4096, temperature: 0.7, // `group` is an api.reapi.ai-specific extension; pass via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "claude-opus-4-7", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "max_tokens": 4096, "temperature": 0.7, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The Claude Opus 4.7 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoints ```http POST https://api.reapi.ai/v1/chat/completions # OpenAI-compatible POST https://api.reapi.ai/v1/messages # Anthropic-native ``` Both surfaces accept `claude-opus-4-7`. Pick whichever matches your SDK of record: * **`/v1/chat/completions`** — drop-in for the OpenAI SDKs. Same request shape, same SSE wire format. Set `base_url` to `https://api.reapi.ai/v1`. * **`/v1/messages`** — native Anthropic Messages format. Set `base_url` to `https://api.reapi.ai` for the Anthropic Python / TypeScript SDKs. Required for callers that need Anthropic-specific features (`cache_control` blocks for prompt caching, native multi-block content, the full tool-use spec). *** ## Request body — `/v1/chat/completions` ### `model` — string, required Must be `"claude-opus-4-7"`. The value is echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec, plus content-parts for vision: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string OR content-parts array (text + image_url parts)" } ``` Multi-turn history is sent in chronological order — the last message is the one Claude responds to. ### `max_tokens` — integer, default `4096` Upper bound on output tokens. **Anthropic's API requires `max_tokens` on every call, including streamed ones** — even though the OpenAI SDKs treat it as optional. Set it generously (`128000` is the hard cap) for long-form outputs; the model still stops at the natural end of its response. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. ### `temperature` — number, default `1` Range `0.0` – `1.0`. Sampling temperature. Anthropic recommends **either** `temperature` or `top_p`, not both. Lower values produce more deterministic output. ### `top_p` — number, default `1` Range `0.0` – `1.0`. Nucleus sampling cutoff. ### `tools` / `tool_choice` — optional Standard OpenAI tool-calling parameters. Claude Opus 4.7 supports the full OpenAI tool-use spec via this surface; for Anthropic's native tool-use schema (with `cache_control`, `tool_choice_type`, etc.) call `/v1/messages` directly. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. Omit if default routing is fine. *** ## Vision input (multimodal) Send images alongside text via OpenAI content-parts: ```json { "model": "claude-opus-4-7", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What does this chart show?" }, { "type": "image_url", "image_url": { "url": "https://example.com/chart.png" } } ] } ] } ``` Supported image formats: PNG, JPEG, GIF, WebP. Base64 URLs work too — prefix `data:image/png;base64,...`. Each image counts toward the input token budget based on its resolution. *** ## Prompt caching Anthropic's prompt caching pays off on stable system prompts, recurring RAG context, and long multi-turn agent histories. The first call pays the cache-write rate on the cacheable region; subsequent calls within the cache window pay only the (much lower) cache-read rate on those tokens. To enable caching, call `/v1/messages` natively and add a `cache_control` block. Example: ```json { "model": "claude-opus-4-7", "max_tokens": 4096, "system": [ { "type": "text", "text": "", "cache_control": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": "Question for the assistant" } ] } ``` The cache key is the hash of the cacheable content; the cache TTL is 5 minutes (default ephemeral) or 1 hour (extended ephemeral) depending on how the cache\_control block is configured. See [api.reapi.ai/pricing](https://api.reapi.ai/pricing) for cache-read and cache-write rates. *** ## Response shape — `/v1/chat/completions` ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "claude-opus-4-7", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "prompt_tokens_details": { "cached_tokens": 0 } } } ``` `usage.prompt_tokens_details.cached_tokens` reports how many input tokens were served from cache — the part billed at the cache-read rate rather than the standard input rate. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta in the OpenAI chunk format; the final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). *** ## Pricing Claude Opus 4.7 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. Current rates (input, output, cache-read, cache-write) live on [api.reapi.ai/pricing](https://api.reapi.ai/pricing) and in the pricing card at the top of the [model page](https://reapi.ai/models/claude-opus-4-7). Per-call bill: ``` billable_input = (prompt_tokens - cached_tokens) × input_rate / 1,000,000 cache_read_bill = cached_tokens × cache_read_rate / 1,000,000 output_bill = completion_tokens × output_rate / 1,000,000 ``` Cache-write rate applies on the first call that writes a cache block; subsequent hits within the cache TTL pay only the cache-read rate. Failed requests are not charged. *** ## Limits | Limit | Value | | --------------------- | ----------- | | Context window | 1M tokens | | Max output per call | 128K tokens | | Cache TTL (ephemeral) | 5 minutes | | Cache TTL (extended) | 1 hour | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | ------------------------------------- | ----------------------------------------------------------------------- | | `400` | Missing `max_tokens`, bad shape, etc. | Anthropic requires `max_tokens`; OpenAI SDKs that omit it will 400 here | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that's a one-for-one wire failure and a retry from your side is safe; the upstream provider may have already produced output, but the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "claude-opus-4-7", "max_tokens": 4096, "messages": [ { "role": "user", "content": "Summarise this in three sentences." } ] } ``` ### Tool use (function calling, OpenAI surface) ```json { "model": "claude-opus-4-7", "max_tokens": 4096, "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Vision ```json { "model": "claude-opus-4-7", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read the error in this screenshot and suggest a fix." }, { "type": "image_url", "image_url": { "url": "https://your-cdn.com/screenshot.png" } } ] } ] } ``` ### Long context with prompt caching (native Anthropic surface) ```json { "model": "claude-opus-4-7", "max_tokens": 4096, "system": [ { "type": "text", "text": "<800K-token reference document>", "cache_control": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": "Find every mention of the constraint X and list them with line numbers." } ] } ``` *** ## When to pick Claude Opus 4.7 Pick Claude Opus 4.7 when **output quality** dominates the decision: * **High-stakes coding and refactors** — architecture, multi-file refactor, migration planning, long-form engineering deliverables. * **Agent workflows that must hold state** — multi-step planning, reliable tool use, long agent runs where context drift kills the workflow. * **Large-context analysis** — full codebases, long research packs, multi-document review, audit work. Route lighter traffic (classification, short replies, tight loops) to cheaper Claude or GPT models on the same key. *** ## Tips * **Set `max_tokens` generously.** Anthropic enforces it strictly — the model still stops at the natural end of its response, but a low cap will truncate before the real ending. * **Stream by default for chat UX.** Streaming cuts perceived latency dramatically. * **Cache the stable parts of long prompts.** A 500K-token RAG context on top of a 1KB user question can pay the cache-read rate on every subsequent call instead of the standard input rate. Big savings on multi-turn agents. * **Tune `temperature` *or* `top_p`, not both.** Mixing them produces results that are hard to reason about. * **Use the native `/v1/messages` surface for Anthropic-only features.** `cache_control`, native multi-block content, full tool-use spec — all of those work through `/v1/messages` without needing translation. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # claude-opus-4-8 (https://reapi.ai/docs/claude-opus-4-8) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Claude Opus 4.8 is Anthropic's most capable model for complex reasoning > and long-horizon agentic coding, exposed through api.reapi.ai as a > drop-in OpenAI-compatible Chat Completions endpoint (the native > Anthropic `/v1/messages` surface is also available). 1M token context, > 128K max output, vision input, prompt caching, and tool use. Current > rates live on the > [model page](https://reapi.ai/models/claude-opus-4-8) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-opus-4-8", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "max_tokens": 4096, "temperature": 0.7 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Hello"}], stream=True, max_tokens=4096, temperature=0.7, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```python from anthropic import Anthropic client = Anthropic( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai", ) with client.messages.stream( model="claude-opus-4-8", max_tokens=4096, messages=[{"role": "user", "content": "Hello"}], ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "claude-opus-4-8", messages: [{ role: "user", content: "Hello" }], stream: true, max_tokens: 4096, temperature: 0.7, // `group` is an api.reapi.ai-specific extension; pass via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "claude-opus-4-8", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "max_tokens": 4096, "temperature": 0.7, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The Claude Opus 4.8 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoints ```http POST https://api.reapi.ai/v1/chat/completions # OpenAI-compatible POST https://api.reapi.ai/v1/messages # Anthropic-native ``` Both surfaces accept `claude-opus-4-8`. Pick whichever matches your SDK of record: * **`/v1/chat/completions`** — drop-in for the OpenAI SDKs. Same request shape, same SSE wire format. Set `base_url` to `https://api.reapi.ai/v1`. * **`/v1/messages`** — native Anthropic Messages format. Set `base_url` to `https://api.reapi.ai` for the Anthropic Python / TypeScript SDKs. Required for callers that need Anthropic-specific features (`cache_control` blocks for prompt caching, native multi-block content, the full tool-use spec). *** ## Request body — `/v1/chat/completions` ### `model` — string, required Must be `"claude-opus-4-8"`. The value is echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec, plus content-parts for vision: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string OR content-parts array (text + image_url parts)" } ``` Multi-turn history is sent in chronological order — the last message is the one Claude responds to. ### `max_tokens` — integer, default `4096` Upper bound on output tokens. **Anthropic's API requires `max_tokens` on every call, including streamed ones** — even though the OpenAI SDKs treat it as optional. Set it generously (`128000` is the hard cap on the synchronous API) for long-form outputs; the model still stops at the natural end of its response. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. ### `temperature` — number, default `1` Range `0.0` – `1.0`. Sampling temperature. Anthropic recommends **either** `temperature` or `top_p`, not both. Lower values produce more deterministic output. ### `top_p` — number, default `1` Range `0.0` – `1.0`. Nucleus sampling cutoff. ### `tools` / `tool_choice` — optional Standard OpenAI tool-calling parameters. Claude Opus 4.8 supports the full OpenAI tool-use spec via this surface and uses tools more efficiently than prior Opus models — fewer steps for the same result. For Anthropic's native tool-use schema (with `cache_control`, `tool_choice_type`, etc.) call `/v1/messages` directly. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. Omit if default routing is fine. *** ## Vision input (multimodal) Send images alongside text via OpenAI content-parts: ```json { "model": "claude-opus-4-8", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What does this chart show?" }, { "type": "image_url", "image_url": { "url": "https://example.com/chart.png" } } ] } ] } ``` Supported image formats: PNG, JPEG, GIF, WebP. Base64 URLs work too — prefix `data:image/png;base64,...`. Each image counts toward the input token budget based on its resolution. *** ## Prompt caching Anthropic's prompt caching pays off on stable system prompts, recurring RAG context, and long multi-turn agent histories. The first call pays the cache-write rate on the cacheable region; subsequent calls within the cache window pay only the (much lower) cache-read rate on those tokens. To enable caching, call `/v1/messages` natively and add a `cache_control` block. Example: ```json { "model": "claude-opus-4-8", "max_tokens": 4096, "system": [ { "type": "text", "text": "", "cache_control": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": "Question for the assistant" } ] } ``` The cache key is the hash of the cacheable content. See [api.reapi.ai/pricing](https://api.reapi.ai/pricing) for cache-read and cache-write rates. *** ## Response shape — `/v1/chat/completions` ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "claude-opus-4-8", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "prompt_tokens_details": { "cached_tokens": 0 } } } ``` `usage.prompt_tokens_details.cached_tokens` reports how many input tokens were served from cache — the part billed at the cache-read rate rather than the standard input rate. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta in the OpenAI chunk format; the final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). *** ## Pricing Claude Opus 4.8 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. It bills along several dimensions — input tokens, output tokens, cache-read tokens, and per-request web search. Current rates live on [api.reapi.ai/pricing](https://api.reapi.ai/pricing) and in the pricing card at the top of the [model page](https://reapi.ai/models/claude-opus-4-8). Per-call bill: ``` billable_input = (prompt_tokens - cached_tokens) × input_rate / 1,000,000 cache_read_bill = cached_tokens × cache_read_rate / 1,000,000 output_bill = completion_tokens × output_rate / 1,000,000 ``` Cache-write rate applies on the first call that writes a cache block; subsequent hits pay only the cache-read rate. Web search, when used, is billed per request. Failed requests are not charged. *** ## Limits | Limit | Value | | ------------------- | ----------- | | Context window | 1M tokens | | Max output per call | 128K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | ------------------------------------- | ----------------------------------------------------------------------- | | `400` | Missing `max_tokens`, bad shape, etc. | Anthropic requires `max_tokens`; OpenAI SDKs that omit it will 400 here | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that's a one-for-one wire failure and a retry from your side is safe; the upstream provider may have already produced output, but the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "claude-opus-4-8", "max_tokens": 4096, "messages": [ { "role": "user", "content": "Summarise this in three sentences." } ] } ``` ### Tool use (function calling, OpenAI surface) ```json { "model": "claude-opus-4-8", "max_tokens": 4096, "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Vision ```json { "model": "claude-opus-4-8", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read the error in this screenshot and suggest a fix." }, { "type": "image_url", "image_url": { "url": "https://your-cdn.com/screenshot.png" } } ] } ] } ``` ### Long context with prompt caching (native Anthropic surface) ```json { "model": "claude-opus-4-8", "max_tokens": 4096, "system": [ { "type": "text", "text": "<800K-token reference document>", "cache_control": { "type": "ephemeral" } } ], "messages": [ { "role": "user", "content": "Find every mention of the constraint X and list them with line numbers." } ] } ``` *** ## When to pick Claude Opus 4.8 Pick Claude Opus 4.8 when **output quality and reliability** dominate the decision: * **Long-horizon agentic coding** — multi-service refactors, codebase-scale migrations, and agent runs that must stay on-task across many steps. * **High-stakes reasoning** — work where a confident-but-wrong answer has real downstream cost. Opus 4.8 is more likely to flag uncertainty than to overclaim. * **Large-context analysis** — full codebases, long research packs, multi-document review, audit work. Route lighter traffic (classification, short replies, tight loops) to cheaper Claude or GPT models on the same key. *** ## Tips * **Set `max_tokens` generously.** Anthropic enforces it strictly — the model still stops at the natural end of its response, but a low cap will truncate before the real ending. * **Stream by default for chat UX.** Streaming cuts perceived latency dramatically. * **Cache the stable parts of long prompts.** A 500K-token RAG context on top of a 1KB user question can pay the cache-read rate on every subsequent call instead of the standard input rate — a big saving on multi-turn agents replaying long histories. * **Tune `temperature` *or* `top_p`, not both.** Mixing them produces results that are hard to reason about. * **Use the native `/v1/messages` surface for Anthropic-only features.** `cache_control`, native multi-block content, full tool-use spec — all of those work through `/v1/messages` without needing translation. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # claude-opus-5 (https://reapi.ai/docs/claude-opus-5) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Anthropic's Claude Opus 5 — "for complex agentic coding and enterprise work" — > exposed through api.reapi.ai as a drop-in OpenAI-compatible Chat Completions > endpoint. A **1M-token** context window, **128k** max output, **adaptive > thinking on by default**, an effort dial from `low` through `max`, plus tool > use, structured outputs, code execution, vision and PDF input. The wire `model` > id is `claude-opus-5` — Anthropic's alias carries no date suffix. Current rates > live on the [model page](https://reapi.ai/models/claude-opus-5) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-opus-5", "messages": [ { "role": "user", "content": "Refactor this module and add tests." } ], "stream": true, "max_tokens": 16000 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="claude-opus-5", messages=[{"role": "user", "content": "Refactor this module and add tests."}], max_tokens=16000, stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "claude-opus-5", messages: [{ role: "user", content: "Refactor this module and add tests." }], max_tokens: 16000, stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "claude-opus-5", "messages": []map[string]string{ {"role": "user", "content": "Refactor this module and add tests."}, }, "max_tokens": 16000, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs (`openai-python`, `openai-node`, `openai-go`, …) work once you swap the base URL, the key and the model string. *** ## Request body ### `model` — string, required Must be `claude-opus-5` exactly. Anthropic's alias carries no date suffix, so there is nothing to append. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Roles are `system`, `user` and `assistant`. Text, image and PDF parts are supported — see [Multimodal input](#multimodal-input). ### `max_tokens` — integer Upper bound on output tokens for this response, **thinking tokens included**. Anthropic documents a **128k**-token output ceiling for this model. **Thinking is on by default on this model**, and `max_tokens` caps thinking plus response text together. A budget carried over from a model that ran without thinking can truncate mid-answer. Raise it, or turn thinking off — subject to the effort cap below. ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events terminated by `data: [DONE]`. Recommended for anything a person watches, and effectively required for large `max_tokens` values — a non-streamed request with a big budget can hit an HTTP timeout. ### `thinking` — object, optional Omit it and the model runs **adaptive thinking**. See [Thinking](#thinking) for the two rules that differ from the previous Opus generation. ### `output_config` — object, optional Carries `effort` and the structured-output format. See [Effort](#effort). ### `tools` / `tool_choice` — optional Tool definitions and the strategy for picking among them. ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Thinking Two things differ from the previous Opus generation, and both bite code that was carried straight over. **1. Thinking runs when you omit the parameter.** On the previous generation, omitting `thinking` meant no thinking. Here it runs adaptive. That is a silent cost and truncation change on any route that never set the field. **2. Turning thinking off is capped at `high` effort.** `thinking` disabled is accepted only at effort `high` or lower; pairing it with `xhigh` or `max` is rejected. The check runs **per request**, so a later call that raises effort while thinking is still disabled fails even though earlier calls in the same conversation succeeded. **The raw chain of thought is never returned on this model.** The default is omitted; ask for a summary if you surface reasoning to users. Fixed thinking-token budgets are not accepted. Given how well this model performs at `low` and `medium` effort, a latency-sensitive route is usually better served by lowering effort than by disabling thinking. *** ## Effort `output_config.effort` takes five levels — `low`, `medium`, `high`, `xhigh`, `max` — and **defaults to `high`** on the Claude API. | Level | Use it for | | -------- | ------------------------------------------------------------------------------------ | | `max` | The hardest reasoning, where correctness outweighs cost. Can overthink routine work. | | `xhigh` | Coding and agentic workloads — the recommended starting point for those. | | `high` | The default; intelligence-sensitive work generally. | | `medium` | A cost step-down that holds up unusually well on this model. | | `low` | Short, scoped, latency-sensitive tasks. | Effort is the primary cost and latency lever here — start at `xhigh` for coding/agentic work and `high` elsewhere, then sweep downward against your own evals. Defaults carried over from an older model rarely transfer. At `xhigh` or `max`, set a large `max_tokens` so there is room to think and act across tool calls. *** ## Parameters that are no longer accepted These are rejected on this generation. Remove them rather than working around them: | Parameter | Do this instead | | ------------------------------- | ------------------------------------------------------ | | `temperature`, `top_p`, `top_k` | Steer with prompting and the `effort` level | | Fixed thinking-token budget | Use `effort` | | Last-assistant-turn prefill | Use structured outputs, or a system-prompt instruction | *** ## Multimodal input | Modality | Supported | | -------- | :-------: | | Text | ✅ | | Image | ✅ | | PDF | ✅ | Output is **text only**. Vision is strong on charts, diagrams and dense documents — and on this model, giving it tools to crop and re-examine an image is a more cost-effective lever than raising thinking depth alone. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Thinking tokens bill as output.** Since thinking is on by default here, that is the usual reason a bill exceeds an estimate built from visible response length alone. * **Output dominates.** For most generative workloads the output rate decides the invoice. * **Effort moves the bill.** It changes how much the model thinks and how many tool calls it makes, so it is the lever to tune before anything else. Both token rates sit at **less than half Anthropic's published per-token rate**. Current numbers are on the [model page](https://reapi.ai/models/claude-opus-5) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "claude-opus-5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1204, "completion_tokens": 860, "total_tokens": 2064 } } ``` `usage.completion_tokens` includes thinking tokens, so it is the number to reconcile a bill against. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk` with the incremental text in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | ------------------------------------------- | ----------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `claude-opus-5` exactly — no date suffix | | `temperature` / `top_p` / `top_k` present | Remove them; they are not accepted on this generation | | Thinking disabled at `xhigh` / `max` effort | Lower effort to `high`, or leave thinking on | | `max_tokens` above the model ceiling | Lower it; the documented ceiling is 128k | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another model | Anthropic runs elevated safety classifiers on this generation. A declined request can come back as a **successful response whose stop reason is a refusal**, with an empty or partial body rather than an error. Check the stop reason before reading the content — code that indexes the first content block unconditionally will break on a refusal. *** ## Tips * **Give the whole task up front.** This model is built for long-horizon autonomous work; a complete specification in one turn outperforms revealing the task across many short interactive turns. * **Stream anything interactive**, and stream anything with a large `max_tokens`. * **Budget for thinking.** If responses truncate mid-sentence on hard prompts, the reasoning pass consumed the allowance — raise `max_tokens`. * **Sweep effort, don't inherit it.** `low` and `medium` are unusually strong here; the right level is workload-specific. * **Delete "double-check your work" instructions.** This model verifies its own output without being told, and telling it to verify causes redundant work. * **Ask for coverage in code review, then filter.** Instructions like "only report high-severity issues" are followed literally, which depresses measured recall. Have it report everything with confidence and severity, and filter in a separate pass. * **Short prompts cache now.** The minimum cacheable prefix is 512 tokens, half the previous generation's floor — prompts you had written off as uncacheable may qualify. *** ## Related * [Claude Opus 5 model page](https://reapi.ai/models/claude-opus-5) — current rates * [Claude Opus 4.8](/docs/claude-opus-4-8) — the previous generation * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # claude-sonnet-4-6 (https://reapi.ai/docs/claude-sonnet-4-6) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Claude Sonnet 4.6 is Anthropic's balanced everyday chat model, exposed > through api.reapi.ai as a drop-in OpenAI-compatible Chat Completions > endpoint (native Anthropic `/v1/messages` also available). 1M token > context, 128K max output, vision input, tool use, and fast production > latency. Current rates live on the > [model page](https://reapi.ai/models/claude-sonnet-4-6) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-6", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "max_tokens": 4096, "temperature": 0.7 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Hello"}], stream=True, max_tokens=4096, temperature=0.7, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```python from anthropic import Anthropic client = Anthropic( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai", ) with client.messages.stream( model="claude-sonnet-4-6", max_tokens=4096, messages=[{"role": "user", "content": "Hello"}], ) as stream: for text in stream.text_stream: print(text, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "claude-sonnet-4-6", messages: [{ role: "user", content: "Hello" }], stream: true, max_tokens: 4096, temperature: 0.7, // @ts-expect-error — `group` is an api.reapi.ai-specific extension group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "claude-sonnet-4-6", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "max_tokens": 4096, "temperature": 0.7, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The Claude Sonnet 4.6 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoints ```http POST https://api.reapi.ai/v1/chat/completions # OpenAI-compatible POST https://api.reapi.ai/v1/messages # Anthropic-native ``` Both surfaces accept `claude-sonnet-4-6`. Pick whichever matches your SDK of record: * **`/v1/chat/completions`** — drop-in for the OpenAI SDKs. Same request shape, same SSE wire format. Set `base_url` to `https://api.reapi.ai/v1`. * **`/v1/messages`** — native Anthropic Messages format. Set `base_url` to `https://api.reapi.ai` for the Anthropic Python / TypeScript SDKs. Use this when you want the full Anthropic tool-use spec or native content blocks. *** ## Request body — `/v1/chat/completions` ### `model` — string, required Must be `"claude-sonnet-4-6"`. The value is echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec, plus content-parts for vision: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string OR content-parts array (text + image_url parts)" } ``` ### `max_tokens` — integer, default `4096` Upper bound on output tokens. **Anthropic's API requires `max_tokens` on every call, including streamed ones** — even though the OpenAI SDKs treat it as optional. Set it generously (`128000` is the hard cap); the model still stops at the natural end of its response. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. ### `temperature` — number, default `1` Range `0.0` – `1.0`. Sampling temperature. Anthropic recommends tuning **either** `temperature` or `top_p`, not both. ### `top_p` — number, default `1` Range `0.0` – `1.0`. Nucleus sampling cutoff. ### `tools` / `tool_choice` — optional Standard OpenAI tool-calling parameters. For Anthropic's native tool-use schema, call `/v1/messages` directly. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway. Omit if default routing is fine. *** ## Vision input Send images alongside text via OpenAI content-parts: ```json { "model": "claude-sonnet-4-6", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Summarise the error in this screenshot." }, { "type": "image_url", "image_url": { "url": "https://example.com/screenshot.png" } } ] } ] } ``` Supported formats: PNG, JPEG, GIF, WebP. Base64 URLs work too (`data:image/png;base64,...`). Each image counts toward the input token budget based on its resolution. *** ## Response shape — `/v1/chat/completions` ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "claude-sonnet-4-6", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21 } } ``` ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta in the OpenAI chunk format; the final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). *** ## Pricing Claude Sonnet 4.6 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. Current rates live on [api.reapi.ai/pricing](https://api.reapi.ai/pricing) and in the pricing card at the top of the [model page](https://reapi.ai/models/claude-sonnet-4-6). Per-call bill: ``` input_cost = prompt_tokens × input_rate / 1,000,000 output_cost = completion_tokens × output_rate / 1,000,000 ``` Failed requests are not charged. *** ## Limits | Limit | Value | | ------------------- | ----------- | | Context window | 1M tokens | | Max output per call | 128K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` | Status | When | Notes | | ------ | ------------------------------------- | ----------------------------------------------------------------------- | | `400` | Missing `max_tokens`, bad shape, etc. | Anthropic requires `max_tokens`; OpenAI SDKs that omit it will 400 here | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that's a one-for-one wire failure and a retry from your side is safe; the upstream provider may have already produced output, but the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "claude-sonnet-4-6", "max_tokens": 4096, "messages": [ { "role": "user", "content": "Summarise this in three sentences." } ] } ``` ### Tool use (function calling) ```json { "model": "claude-sonnet-4-6", "max_tokens": 4096, "messages": [ { "role": "user", "content": "What's the weather in Tokyo?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Vision ```json { "model": "claude-sonnet-4-6", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read the error in this screenshot and suggest a fix." }, { "type": "image_url", "image_url": { "url": "https://your-cdn.com/screenshot.png" } } ] } ] } ``` *** ## When to pick Claude Sonnet 4.6 over Claude Opus 4.7 Both share the same endpoint, the same context window, and the same OpenAI-compatible wire format — switching is a one-line change in the `model` field. Pick Claude Sonnet 4.6 when: * **Production chat traffic** where time-to-first-token shows up in user-experience metrics. * **Code review and PR triage** that runs across high volume. * **Mid-complexity agents** where Claude-grade reasoning is enough and Opus-tier reasoning would be overkill. * **Default routing** — use Sonnet as the everyday model and escalate to Opus for the genuinely hard turns. Pick Claude Opus 4.7 for high-stakes coding, large refactors, complex multi-step agents, and long-context analysis where output quality dominates the decision. *** ## Tips * **Set `max_tokens` generously.** Anthropic enforces it strictly; the model still stops at the natural end of its response, but a low cap will truncate before the real ending. * **Stream by default for chat UX.** Sonnet's lower time-to-first-token makes the perceived latency advantage especially visible in streamed responses. * **Tune `temperature` *or* `top_p`, not both.** Mixing them produces results that are hard to reason about. * **Use Sonnet as the default and escalate to Opus.** The cleanest production pattern: route everything to Sonnet, switch to Opus on the calls where quality matters most. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # deepseek-v4 (https://reapi.ai/docs/deepseek-v4) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > The DeepSeek V4 API ships two open-weight models — **`deepseek-v4-flash`** > (fast, low-cost) and **`deepseek-v4-pro`** (frontier reasoning and agentic > coding) — exposed through api.reapi.ai as a drop-in OpenAI-compatible Chat > Completions endpoint. Both bring a 1M-token context window, 384K max output, > thinking mode on by default, vision input, tool use, and context caching. > Current rates live on the > [model page](https://reapi.ai/models/deepseek-v4) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4-flash", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "max_tokens": 4096, "temperature": 0.7 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="deepseek-v4-flash", # or "deepseek-v4-pro" messages=[{"role": "user", "content": "Hello"}], stream=True, max_tokens=4096, temperature=0.7, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "deepseek-v4-flash", // or "deepseek-v4-pro" messages: [{ role: "user", content: "Hello" }], stream: true, max_tokens: 4096, temperature: 0.7, // `group` is an api.reapi.ai-specific extension; pass via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "deepseek-v4-flash", // or "deepseek-v4-pro" "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "max_tokens": 4096, "temperature": 0.7, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The DeepSeek V4 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Models The DeepSeek V4 family ships two variants. Both share the same endpoint, request shape, 1M context window, and 384K max output — pick the variant with the `model` field. | `model` | Best for | Architecture | | ------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------- | | `deepseek-v4-flash` | Fast, low-cost everyday work — autocomplete, batch analysis, chat backends. Reasoning closely approaches Pro. | 284B total / 13B active (MoE) | | `deepseek-v4-pro` | Frontier reasoning, complex debugging, and agentic coding. Rivals top closed-source models. | 1.6T total / 49B active (MoE) | The legacy ids `deepseek-chat` and `deepseek-reasoner` map to `deepseek-v4-flash` in non-thinking and thinking mode respectively. New integrations should use the explicit `deepseek-v4-flash` / `deepseek-v4-pro` ids. *** ## Endpoint ```http POST https://api.reapi.ai/v1/chat/completions ``` Drop-in for the OpenAI SDKs — same request shape, same SSE wire format. Set `base_url` to `https://api.reapi.ai/v1`. DeepSeek V4 also supports the Anthropic API format natively; this guide documents the OpenAI-compatible Chat Completions surface. *** ## Request body ### `model` — string, required `"deepseek-v4-flash"` or `"deepseek-v4-pro"`. Echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec, plus content-parts for vision: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string OR content-parts array (text + image_url parts)" } ``` Multi-turn history is sent in chronological order — the last message is the one the model responds to. Do **not** echo a prior turn's `reasoning_content` back into `messages`; strip it before the next request. ### `max_tokens` — integer, default `4096` Upper bound on output tokens for this response, **including the chain-of-thought when thinking mode is on**. The synchronous API supports up to 384K output tokens — set it generously for long-form or reasoning-heavy outputs. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. ### `temperature` — number, default `1` Sampling temperature. Lower values produce more deterministic output. **Ignored while the model is in thinking mode.** ### `top_p` — number, default `1` Nucleus sampling cutoff. Ignored in thinking mode. ### `frequency_penalty` / `presence_penalty` — number, default `0` Standard OpenAI repetition controls. Ignored in thinking mode. ### `tools` / `tool_choice` — optional Standard OpenAI tool-calling parameters. DeepSeek V4 ships dedicated agentic optimizations with reliable function calling and JSON output. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. Omit if default routing is fine. *** ## Thinking mode DeepSeek V4 runs in **thinking mode by default**: before the final answer it produces a chain of thought, returned in a `reasoning_content` field at the same level as `content`. ```json { "choices": [ { "index": 0, "message": { "role": "assistant", "reasoning_content": "Let me work through this step by step...", "content": "The final answer." }, "finish_reason": "stop" } ] } ``` For latency-sensitive or simple calls, switch to **non-thinking mode** for faster, cheaper responses. When thinking is on, the sampling parameters (`temperature`, `top_p`, `frequency_penalty`, `presence_penalty`) have no effect. Strip `reasoning_content` from assistant messages before sending them back in a follow-up request — the chain-of-thought from a previous turn is not meant to be re-fed as input. *** ## Vision input (beta) Send images alongside text via OpenAI content-parts: ```json { "model": "deepseek-v4-pro", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What does this chart show?" }, { "type": "image_url", "image_url": { "url": "https://example.com/chart.png" } } ] } ] } ``` Each image counts toward the input token budget based on its resolution. *** ## Context caching DeepSeek V4 caches stable prompt prefixes automatically. When a request hits the cache, the cached input tokens bill at a small fraction of the standard input rate — a big saving for agent loops and chatbots that replay long system prompts and tool schemas. No configuration is required; reuse the same prefix across calls and the discount applies. The `usage.prompt_tokens_details.cached_tokens` field reports how many input tokens were served from cache. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "deepseek-v4-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "prompt_tokens_details": { "cached_tokens": 0 } } } ``` When thinking mode is on, `message.reasoning_content` carries the chain-of-thought alongside `content`. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta in the OpenAI chunk format; the final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). *** ## Pricing DeepSeek V4 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. It bills along three dimensions — input tokens (cache miss), input tokens (cache hit), and output tokens — and `deepseek-v4-pro` costs more per token than `deepseek-v4-flash`. Current rates live on [api.reapi.ai/pricing](https://api.reapi.ai/pricing) and in the pricing card at the top of the [model page](https://reapi.ai/models/deepseek-v4). Per-call bill: ``` billable_input = (prompt_tokens - cached_tokens) × input_rate / 1,000,000 cache_read_bill = cached_tokens × cache_hit_rate / 1,000,000 output_bill = completion_tokens × output_rate / 1,000,000 ``` Output tokens include the chain-of-thought when thinking mode is on. Failed requests are not charged. *** ## Limits | Limit | Value | | ------------------- | ----------- | | Context window | 1M tokens | | Max output per call | 384K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | ------------------------------------------ | -------------------------------------------- | | `400` | Bad request shape, unsupported param combo | Check the `messages` array and `model` id | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that is a one-for-one wire failure and a retry from your side is safe; the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "deepseek-v4-flash", "max_tokens": 4096, "messages": [ { "role": "user", "content": "Summarise this in three sentences." } ] } ``` ### Tool use (function calling) ```json { "model": "deepseek-v4-pro", "max_tokens": 4096, "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Long-context analysis ```json { "model": "deepseek-v4-pro", "max_tokens": 8192, "messages": [ { "role": "system", "content": "" }, { "role": "user", "content": "List every mention of constraint X with line numbers." } ] } ``` Keep the long reference block stable across calls so the cache-hit rate applies on subsequent requests. *** ## When to pick Flash vs Pro * **`deepseek-v4-flash`** — latency-sensitive, high-throughput, cost-sensitive work: in-IDE autocomplete, inline suggestions, CI code review, bulk summarization, chat backends. Reasoning closely approaches Pro at a fraction of the price. * **`deepseek-v4-pro`** — work where reasoning depth dominates: complex debugging, architecture planning, math/STEM, and long-horizon agentic coding. Both share one key — route per request. *** ## Tips * **Set `max_tokens` generously when thinking is on.** The chain-of-thought counts toward the output budget; a low cap can truncate before the final answer. * **Strip `reasoning_content` before the next turn.** Re-feeding a prior turn's chain-of-thought as input is not supported. * **Stream by default for chat UX.** Streaming cuts perceived latency. * **Cache stable prefixes.** Reuse the same system prompt and tool schemas across calls to bill repeated input at the low cache-hit rate. * **Route by difficulty.** Send simple, high-volume calls to Flash and reserve Pro for the hardest reasoning, all on one key. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # enhance-video-1.0 (https://reapi.ai/docs/enhance-video-1-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > `enhance-video-1.0` is a single async endpoint that takes a source video URL and > returns a higher-quality MP4 — upscaled, denoised, smart-interpolated, with > optional scene-aware restoration. Two quality tiers (**standard** / > **professional**) and five scene presets cover everything from AI-generated > footage to old-film restoration. See current pricing on the > [model page](https://reapi.ai/models/enhance-video-1-0). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "enhance-video-1.0", "video_url": "https://cdn.example.com/source_720p.mp4", "tool_version": "standard", "scene": "aigc", "resolution": "1080p" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "enhance-video-1.0", "video_url": "https://cdn.example.com/source_720p.mp4", "tool_version": "standard", "scene": "aigc", "resolution": "1080p", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "enhance-video-1.0", video_url: "https://cdn.example.com/source_720p.mp4", tool_version: "standard", scene: "aigc", resolution: "1080p", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "enhance-video-1.0", "video_url": "https://cdn.example.com/source_720p.mp4", "tool_version": "standard", "scene": "aigc", "resolution": "1080p", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "enhance-video-1.0", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` until `status === "completed"`. The completed payload's `output.video_urls` holds the enhanced MP4 URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; polling the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required Always `"enhance-video-1.0"`. ### `video_url` — required (string) Public HTTP/HTTPS URL of the source video. * **Allowed schemes:** `http://`, `https://` only. Base64 / `data:` URIs are rejected. * **Formats:** mp4, flv, ts, avi, mov, wmv, mkv (and most other mainstream containers). * **Size:** up to **10 GB** per file. * **Duration:** up to **2 hours**. * **Input resolution:** up to **2K** (short side ≤ 1440 px). Use `resolution: "4k"` to upscale beyond the source. ### `tool_version` — optional (`"standard"` | `"professional"`) Default: `"standard"`. * **`standard`** — balanced quality / speed. Internally runs \~10 frequently used algorithms; covers what most distribution platforms expect. Roughly 6 – 10× the source duration to process. * **`professional`** — maximum quality. Runs 30+ deep AI algorithms for shot-level enhancement. Roughly 30+× the source duration to process and \~10× the credits of `standard`. ### `scene` — optional (string) Selects a scene-tuned preset. Default: `"common"`. | Value | Recommended for | | -------------- | -------------------------------------------------------------------------------- | | `common` | General-purpose enhancement (no scene-specific tuning). | | `ugc` | Compressed UGC clips — fixes blocking, color banding, blur. | | `short_series` | Short-drama footage — face / detail enhancement, stylized contrast. | | `aigc` | Low-res AI-generated video — super-resolution + detail repaint. | | `old_film` | Aged film — temporal denoise, scratch removal, deflicker, color cast correction. | ### `resolution` — optional (string) Target output resolution. Mutually exclusive with `resolution_limit`. Allowed values: `240p`, `360p`, `480p`, `540p`, `720p`, `1080p`, `2k`, `4k`. If unset, the output keeps the source resolution. ### `resolution_limit` — optional (integer) Lock the output **short-side** to this exact pixel count, then scale the long side to preserve the source ratio. Range `[64, 2160]`. Mutually exclusive with `resolution`. Use this when you need precise output dimensions (e.g. `resolution_limit: 720` with a 640×480 source produces 960×720). ### `fps` — optional (number) Target output frame rate, max 120. If unset, the output matches the source frame rate. Setting a value higher than the source triggers AI frame interpolation; staying within 4× the source is recommended for natural-looking motion. ### `client_token` — optional (string) Client-supplied idempotency token. Up to 64 ASCII printable characters. The same token within a short window returns the same `task_id`. ### `callback_args` — optional (string) Opaque blob (≤ 512 bytes) you supply at submit time and receive back when the task completes (via the standard task envelope). Useful for stitching results back to your business records without storing the `task_id`. *** ## Output ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "enhance-video-1.0", "status": "completed", "created_at": 1735000000, "output": { "video_urls": [ "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4" ] }, "error": null } ``` The MP4 lives on our CDN — copy it to your own storage if you need long-term retention. *** ## Pricing Billed by **output duration × tier × resolution × fps tier**. The output duration always matches the source video duration (`enhance-video-1.0` does not change clip length). When you submit, the gateway probes your `video_url` server-side to determine the exact billable seconds and resolution bucket. If the URL is unreachable or returns no metadata, you receive a `400 Could not determine source video metadata for billing` and **no credits are charged**. The bill scales with three knobs: * **`tool_version`** — `professional` is roughly 10× the cost of `standard`. * **Output resolution bucket** — `720p` \< `1080p` \< `2k` \< `4k`. Each step doubles the cost. * **Output fps tier** — `> 30 fps` doubles the cost vs `≤ 30 fps`. If you don't pass `fps`, the output keeps the source frame rate; billing assumes the **`≤ 30 fps`** tier, which matches the vast majority of user-uploaded video. To opt into the `> 30 fps` tier, set `fps` explicitly. See the live banner on the [model page](https://reapi.ai/models/enhance-video-1-0) for the current rate range in credits. *** ## Errors Standard envelope: ```json { "error": { "code": 20003, "message": "resolution and resolution_limit are mutually exclusive", "request_id": "req_..." } } ``` Common cases: | Code | When | | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `20002` | `video_url` missing. | | `20003` | Invalid enum (`tool_version`, `scene`, `resolution`), `resolution` + `resolution_limit` both set, `resolution_limit` outside `[64, 2160]`, or `video_url` not a public http(s) URL. | | `30002` | Source video metadata couldn't be probed (used for billing). | | `30001` | Insufficient credits for the probed source duration. | | `80003` | Provider rejected or failed the task (e.g. unsupported codec). | --- # flux-2-pro (https://reapi.ai/docs/flux-2-pro) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Black Forest Labs' FLUX.2 on reAPI — photoreal **text-to-image** and > **multi-reference generation** (up to 8 images), output up to **4MP**, with > exact pixel dimensions when a preset will not do. Three tiers: > `flux-2-pro`, `flux-2-max` and `flux-2-flex-std`. Submit returns a task > `id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/flux-2-pro). Billing has **two terms**: the output resolution *and* every reference image you attach. See [Pricing](#pricing) before you budget for an image-to-image workload. ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "flux-2-pro", "prompt": "a cinematic product photograph of an espresso machine", "resolution": "2MP", "size": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "flux-2-pro", "prompt": "a cinematic product photograph of an espresso machine", "resolution": "2MP", "size": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const resp = await fetch('https://reapi.ai/api/v1/images/generations', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'flux-2-pro', prompt: 'a cinematic product photograph of an espresso machine', resolution: '2MP', size: '16:9', }), }); console.log(await resp.json()); ``` ```go package main import ( "bytes" "fmt" "io" "net/http" ) func main() { body := []byte(`{ "model": "flux-2-pro", "prompt": "a cinematic product photograph of an espresso machine", "resolution": "2MP", "size": "16:9" }`) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "flux-2-pro", "status": "processing", "created_at": 1785323949 } ``` Poll `GET /api/v1/tasks/{task_id}` until `status` is `completed` or `failed`. *** ## Authentication ``` Authorization: Bearer YOUR_API_KEY ``` Create a key from your [dashboard](https://reapi.ai/settings/apikeys). *** ## Endpoint ``` POST https://reapi.ai/api/v1/images/generations ``` Submission is asynchronous — the call returns a task `id` immediately and the image is retrieved by polling the [Tasks API](/docs/api/tasks). *** ## Tiers | Model id | Positioning | | ----------------- | ------------------------------------------------------------- | | `flux-2-pro` | Balanced quality and speed. The production default. | | `flux-2-max` | Highest quality and detail, for work that gets scrutinised. | | `flux-2-flex-std` | Adds `steps` and `guidance` for direct control over sampling. | All three share one parameter set, except that `steps` and `guidance` are accepted **only** by `flux-2-flex-std`. reAPI also serves FLUX.2 through a second, independent surface under the `flux-2` and `flux-2-flex` model ids. That surface has a different parameter set and different tiers, and bills separately — see [flux-2](/docs/flux-2). The `-std` suffix here exists because the bare `flux-2-flex` id belongs to that other surface. *** ## Modes Mode is implicit in whether you send reference images: | Input | Mode | | ----------------------------- | -------------------------- | | `prompt` only | Text-to-image | | `prompt` + `image_urls` (1–8) | Reference-image generation | *** ## Request body ### `model` — string, required One of `flux-2-pro`, `flux-2-max`, `flux-2-flex-std`. ### `prompt` — string, required Description of the image to generate, or the edit to apply to the reference images. ### `resolution` — string, default `2MP` Output resolution tier: `1MP`, `2MP`, `3MP`, `4MP`. Applies when `size` is an aspect ratio. Legacy aliases are accepted and map onto the four tiers: `512` / `512P` / `1M` → `1MP`, `1K` / `1024` → `2MP`, `2K` / `2048` → `3MP`, `4K` → `4MP`. ### `size` — string, default `1:1` Output aspect ratio: `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`, `21:9`, `9:21`. A pixel string such as `1024x1536` is also accepted and takes priority over `resolution`. ### `width` / `height` — integer, optional Exact output dimensions. **Must be sent as a pair** — one without the other is a `400`. Each side is at least 64 pixels, and `width × height` must not exceed 4 MP (4,194,304 pixels). A complete pair has the highest priority and overrides both `resolution` and `size`. ### `image_urls` — array, optional Up to 8 public `http(s)` image URLs. Base64 and `data:` URIs are rejected across the reAPI platform. Host input images at a publicly reachable URL first. The output plus all reference images must not exceed 9 MP combined. ### `output_format` — string, default `jpeg` `jpeg`, `png`, or `webp`. ### `n` — integer, default `1` `1` is the only supported value; submit concurrent requests for more. ### `seed` — integer, optional Fix the seed to make a generation reproducible. ### `prompt_upsampling` — boolean, default `false` When `true`, the model rewrites and expands your prompt before generating. ### `safety_tolerance` — integer, default `2` Moderation strictness from `0` (strictest) to `5` (most permissive). FLUX.2 caps this at `5`. The FLUX Kontext models allow `6` — the ranges are not interchangeable. ### `steps` — integer, optional — **`flux-2-flex-std` only** Sampling steps, `1`–`50`. Sending this to `flux-2-pro` or `flux-2-max` returns a `400`. ### `guidance` — number, optional — **`flux-2-flex-std` only** Prompt guidance, `1.5`–`10`. Higher values follow the prompt more closely. Sending this to `flux-2-pro` or `flux-2-max` returns a `400`. ### `fallback` — object, optional reAPI may serve a request on either of two upstreams and automatically retries on the second one if the first fails to deliver. Send `{"enabled": false}` to disable that retry and fail fast instead: ```json { "model": "flux-2-pro", "prompt": "A cinematic city at night", "fallback": { "enabled": false } } ``` Your price is unaffected either way — both upstreams bill the same rate for the same request. Turning the retry off trades availability for a faster failure. Some requests are served by a single upstream regardless, because only one of the two can honour them exactly and reAPI never relaxes a parameter to make a request routable: `steps`, `guidance`, `seed`, `width` / `height`, a pixel-string `size`, a `3MP` / `4MP` resolution, `prompt_upsampling: true`, an explicit `output_format`, or a `safety_tolerance` above `2`. *** ## Pricing FLUX.2 bills **two terms per request**: ``` credits = ceil((output_usd(tier, resolution) + n_refs × reference_usd(tier)) × 1000) ``` where `1 credit = $0.001 USD`. In words: 1. **Output** — priced by tier (`pro` / `max` / `flex`) × resolution (`1MP` … `4MP`). Aspect ratio does not change it. 2. **Reference images** — each *distinct* image in `image_urls` adds a per-image charge at the same tier. A request with three references costs meaningfully more than the same prompt with none. Repeating the same URL does not add a charge and does not add a second reference: duplicates collapse before the request is sent, so `[a, a, b]` is billed and generated as two references. Each request produces one image. Failed and rejected requests are not charged. Exact per-tier credit costs surface on the [model page](https://reapi.ai/models/flux-2-pro) and through the playground estimator before submit. *** ## Response ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "flux-2-pro", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...jpg" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (empty prompt, more than 8 `image_urls`, a non-http(s) URL, `width` without `height`, output over 4 MP, `safety_tolerance` outside 0–5, or `steps` / `guidance` on a non-Flex tier) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * Reference images are billed per image. If you are iterating on composition, drop to one reference while you explore and add the rest for the final pass. * Batch jobs that do not need detail should run at `1MP` — the resolution tier is the single biggest lever on cost. * Use `width` + `height` when a layout has fixed dimensions; it saves a downstream crop and guarantees the aspect the design expects. * Put text you want rendered in the image in quotes inside the prompt. * On the Flex tier, raise `guidance` when the render drifts from the prompt and raise `steps` when it looks under-detailed. Change one at a time. *** ## Related * [FLUX Kontext](/docs/flux-kontext) * [FLUX.2 (alternate surface)](/docs/flux-2) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # flux-2 (https://reapi.ai/docs/flux-2) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Black Forest Labs' FLUX.2 on reAPI — photoreal **text-to-image** and > **multi-reference editing** (up to 8 images), with accurate in-image text. > Two tiers: `flux-2` (Pro) and `flux-2-flex` (Flex). Submit returns a > `task_id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/flux-2). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "flux-2", "prompt": "an infographic poster titled OPENING SOON, clean layout", "aspect_ratio": "3:4", "resolution": "2K" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "flux-2", "prompt": "an infographic poster titled OPENING SOON, clean layout", "aspect_ratio": "3:4", "resolution": "2K", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "flux-2", prompt: "an infographic poster titled OPENING SOON, clean layout", aspect_ratio: "3:4", resolution: "2K", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "flux-2", "prompt": "an infographic poster titled OPENING SOON, clean layout", "aspect_ratio": "3:4", "resolution": "2K", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "flux-2", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Tiers Two customer model ids share one parameter shape: | Model id | Tier | Notes | | ------------- | ---- | ------------------------------------------------------ | | `flux-2` | Pro | Production-ready, fast, lower price. The default tier. | | `flux-2-flex` | Flex | Maximum quality / detail, higher price. | ## Modes There is no `mode` field — the modality is implicit in the request shape: * **Text-to-image** — no `input_urls`. * **Image-to-image / multi-reference editing** — pass `input_urls` (1–8 reference images). FLUX.2 keeps characters, products, and styles consistent across the result. *** ## Request body ### `model` — string, required One of `flux-2` (Pro) or `flux-2-flex` (Flex). ### `prompt` — string, required **3–5,000 characters.** Put any text you want rendered in the image in quotes. ### `input_urls` — array, optional 1–8 reference images for image-to-image / multi-reference editing. **Public HTTPS URLs only** — base64 / `data:` URIs are rejected at the gateway. Passing any image switches the request to editing mode. ### `aspect_ratio` — string, default `1:1` One of `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`. The value `auto` (match the first reference image) is available **only for image-to-image**. `aspect_ratio: "auto"` requires `input_urls`. Using it without reference images (text-to-image) is rejected with `400`. ### `resolution` — string, default `1K` `1K` or `2K`. The `2K` tier renders up to 4MP. ### `nsfw_checker` — boolean, optional, default `false` Enables upstream content moderation. Off by default. *** ## Pricing FLUX.2 bills a flat rate **per generated image**, by tier (`flux-2` / `flux-2-flex`) and resolution (`1K` / `2K`). Text-to-image and image-to-image cost the same within a tier: ``` credits = ceil(per_image_usd × 1000) ``` where `1 credit = $0.001 USD`. Each request produces one image. Failed and rejected requests are not charged. The exact per-image credit cost for each tier/resolution surfaces on the [model page](https://reapi.ai/models/flux-2) and through the playground estimator before submit. *** ## Response The poll envelope returns the image URL in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "flux-2", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...jpg" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (prompt outside 3–5000 chars, more than 8 `input_urls`, `auto` aspect without reference images, a non-HTTPS URL) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * Put the literal text you want rendered **in the prompt, in quotes** — FLUX.2 is tuned for legible typography, ad headlines, and infographics. * For consistency across a campaign, pass the same reference image(s) in `input_urls` and let FLUX.2 keep the character/style on-model. * Use `flux-2` (Pro) for fast, cost-efficient production and `flux-2-flex` (Flex) when a hero shot needs maximum quality. * Reach for `resolution: "2K"` (up to 4MP) only when the asset needs the detail. *** ## Related * [Image generation models](/docs/gpt-image-2) * [Qwen Image 2](/docs/qwen-image-2) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # FLUX 3 (https://reapi.ai/docs/flux-3) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; **Video is live; the rest of the family is not.** FLUX 3 video generation is callable now with `model: "flux-3-video"`. Black Forest Labs is still rolling out the other modalities in phases — image synthesis, action prediction and the open-weight backbone are separate releases and are not part of this endpoint. > FLUX 3 is Black Forest Labs' multimodal foundation model: images, video and > audio learned jointly inside one architecture built on Self-Flow. It > generates video with native audio — up to 20 seconds in a single generation — > follows keyframes, reference images, reference clips and existing > video-audio, speaks multilingual dialogue, and synthesizes and edits images > from the same backbone. ## Status Black Forest Labs' published rollout order, and what reAPI exposes today: | Stage | Capability | Access | | ----- | --------------------------------------------------- | ---------------------------------------------- | | 1 | FLUX 3 Video — video + audio generation and editing | **Live on reAPI** as `flux-3-video` | | 2 | FLUX 3 Action / FLUX-mimic — action prediction | Selected research + commercial partners | | 3 | FLUX 3 Image — image synthesis and editing | Early Access announced for the following weeks | | 4 | FLUX 3 Dev — open-weight multimodal backbone | After the phases above | Only stage 1 is callable here. Everything documented below is the video endpoint; the other stages will get their own model ids when they ship. ## Capabilities Published by Black Forest Labs for FLUX 3 Video. All outputs carry native audio generation. * **Text-to-video** — prompt in, video with sound out. * **Image-to-video** — continue from a starting frame ("animation"), or use images as visual references. * **Video continuation** — pick a source clip up where it stopped, carrying its audio forward with it. * **Video-audio continuation** — extend an existing video *and* its audio. * **Keyframe-to-video** — controlled transitions between defined moments. * **Multilingual dialogue** — spoken dialogue across languages. * **Typography** — strong text rendering and animated designs inside the frame. * **Draft then finalize** — render a cheap low-quality preview, then re-render that exact draft at full quality. Duration is an integer **5-20 seconds**. There is no multi-shot sequencing parameter on this endpoint — 20 seconds is a hard per-request ceiling. FLUX 3 Image adds synthesis and editing across styles, aspect ratios and resolutions, with high-accuracy text in multiple languages. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "flux-3-video", "prompt": "A rain-soaked cafe terrace at dusk, a tram rolls past", "duration": 10 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "flux-3-video", "prompt": "A rain-soaked cafe terrace at dusk, a tram rolls past", "duration": 10, }, timeout=30, ) task = resp.json() print(task["id"]) ``` ```js const resp = await fetch('https://reapi.ai/api/v1/videos/generations', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'flux-3-video', prompt: 'A rain-soaked cafe terrace at dusk, a tram rolls past', duration: 10, }), }); const task = await resp.json(); console.log(task.id); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "flux-3-video", "prompt": "A rain-soaked cafe terrace at dusk, a tram rolls past", "duration": 10, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var task map[string]any json.NewDecoder(resp.Body).Decode(&task) fmt.Println(task["id"]) } ``` ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. ## Request body Mode is inferred from the media fields you set — prompt only is text-to-video, `image_urls` is keyframes, a video field is continuation — or you can state it with `mode`. An explicit `mode` wins over inference. | Field | Type | Default | Notes | | -------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | — | `flux-3-video`. **Required.** | | `prompt` | string | — | **Required**, except when finalizing a draft, where sending one is an error. | | `duration` | integer | `5` | Integer seconds, `5`-`20`. `"auto"` is not supported. | | `resolution` | string | `hd` | `hd` or `fhd`; `720p` / `1080p` are accepted aliases. Draft renders at `hd` only. | | `aspect_ratio` | string | `auto` | `21:9`, `2:1`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, or `auto`. | | `image_urls` | string\[] | — | 1-10 keyframes. **Order is semantic**: one image is the start frame, two are start and end, three or more add evenly-spaced middles. Not sorted or deduped. | | `video_url` | string | — | Public MP4 URL to continue. | | `video_urls` | string\[] | — | Accepted alias for `video_url`; the first item is used. | | `audio` | boolean | `true` | Generated audio. `false` yields a silent clip and is **not** cheaper. | | `draft` | boolean | `false` | Cheap low-quality preview. `hd` only; mutually exclusive with `draft_from_task_id`. | | `draft_from_task_id` | string | — | Your reAPI task id for a **completed draft**. Only `resolution` may differ from that draft — prompt, duration and media are rejected. | | `safety_tolerance` | integer | `2` | `0`-`4`; higher is more permissive. The playground caps its control at `2`; `3` and `4` are API-only. | | `mode` | string | inferred | `t2v`, `i2v`, `v2v`, `draft_enhance`, or the long forms `text-to-video`, `image-continuation`, `video-continuation`. Note `image-continuation` means image-to-video. | **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "flux-3-video", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/.../0.mp4"] }, "error": null } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. `output.video_urls` holds the generated MP4 URL — audio is muxed into that file, not returned separately. ## Pricing FLUX 3 bills per second, and the per-second rate depends on three things together — the mode, the resolution, and whether it is a draft: | Tier | What triggers it | | ------------------ | ----------------------------------- | | Base | Text-to-video or keyframes at `hd` | | Base, fhd | Text-to-video or keyframes at `fhd` | | Draft | `draft: true` (always `hd`) | | Continuation | A video field is set, at `hd` | | Continuation, fhd | A video field is set, at `fhd` | | Continuation draft | `draft: true` with a video field | Continuation costs materially more than text-to-video at the same resolution, because the model has to process your source footage. Current rates for every tier are on the [model page](https://reapi.ai/models/flux-3) — that table is dynamic and always reflects the live price. The bill is: ``` credits = ceil(per_second_usd × billable_seconds × 1000) ``` where `1 credit = $0.001`. Failed jobs are refunded automatically. ## Errors FLUX 3 returns the platform's standard envelope: ```json { "error": { "code": "INVALID_REQUEST", "message": "duration must be at most 20", "request_id": "req_01hq2k..." } } ``` See the [errors catalog](/docs/api/errors) for the full code list and retry guidance. ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [FLUX.2 — available now](/docs/flux-2) * [Seedance 2.0 — available now](/docs/seedance-2-0) --- # flux-kontext (https://reapi.ai/docs/flux-kontext) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Black Forest Labs' FLUX Kontext on reAPI — **prompt-only image editing** > (no masks) and **text-to-image** generation from one endpoint, with strong > character consistency across iterative edits. Two tiers: > `flux-kontext-pro` and `flux-kontext-max`. Submit returns a task id in `id`; > poll until ready. See current pricing on the > [model page](https://reapi.ai/models/flux-kontext). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "flux-kontext-pro", "prompt": "Replace the background with a rainy Tokyo street at night", "image_urls": ["https://example.com/portrait.jpg"], "size": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "flux-kontext-pro", "prompt": "Replace the background with a rainy Tokyo street at night", "image_urls": ["https://example.com/portrait.jpg"], "size": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const resp = await fetch('https://reapi.ai/api/v1/images/generations', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'flux-kontext-pro', prompt: 'Replace the background with a rainy Tokyo street at night', image_urls: ['https://example.com/portrait.jpg'], size: '16:9', }), }); console.log(await resp.json()); ``` ```go package main import ( "bytes" "fmt" "io" "net/http" ) func main() { body := []byte(`{ "model": "flux-kontext-pro", "prompt": "Replace the background with a rainy Tokyo street at night", "image_urls": ["https://example.com/portrait.jpg"], "size": "16:9" }`) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "flux-kontext-pro", "status": "processing", "created_at": 1785323949 } ``` Poll `GET /api/v1/tasks/{task_id}` until `status` is `completed` or `failed`. *** ## Authentication Every request needs a bearer token: ``` Authorization: Bearer YOUR_API_KEY ``` Create a key from your [dashboard](https://reapi.ai/settings/apikeys). *** ## Endpoint ``` POST https://reapi.ai/api/v1/images/generations ``` Submission is asynchronous — the call returns a task `id` immediately and the image is retrieved by polling the [Tasks API](/docs/api/tasks). *** ## Tiers | Model id | Positioning | | ------------------ | ----------------------------------------------------------------------------------------------------------- | | `flux-kontext-pro` | Fast and production-ready. Best balance of speed and quality; the sensible default for high-volume editing. | | `flux-kontext-max` | Highest output quality, with stronger typography and prompt adherence. | Both tiers accept an identical parameter set — switching is a one-field change. *** ## Modes The mode is implicit in whether you send reference images. There is no mode field and no second endpoint: | Input | Mode | | ----------------------------- | ------------- | | `prompt` only | Text-to-image | | `prompt` + `image_urls` (1–4) | Image editing | *** ## Request body ### `model` — string, required One of `flux-kontext-pro`, `flux-kontext-max`. ### `prompt` — string, required Description of the image to create, or the edit to apply to the reference images. ### `image_urls` — array, optional Up to 4 public `http(s)` image URLs. Presence switches the request into editing mode. Base64 and `data:` URIs are rejected across the reAPI platform. Host input images at a publicly reachable URL first. ### `size` — string, default `1:1` Output aspect ratio. Supported: `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`, `21:9`, `9:21`. A pixel string such as `1300x800` is also accepted, but Kontext snaps it to the nearest supported ratio instead of producing those exact dimensions — so it gives you nothing the ratio list does not. Prefer the ratio. Every ratio renders at approximately 1 MP, so `size` changes shape but never resolution or price. `width` and `height` are **not** accepted by this model and are rejected with a `400`. `resolution` is accepted but has no effect — Kontext always renders at approximately 1 MP — so it is safe to leave in a request ported over from FLUX.2, but it will not change the output. ### `output_format` — string, default `png` Encoding of the returned image: `png`, `jpeg`, or `webp`. Omit it to take the model's own default, which is also `png`. ### `response_format` — string, optional OpenAI-compatibility field, accepting `url` or `b64_json`. It does not change the image encoding — `output_format` controls that and wins when both are sent. reAPI always returns the image as a URL in `output.image_urls`. ### `n` — integer, default `1` Images per request. `1` is the only supported value; submit concurrent requests when you need more. ### `seed` — integer, optional Fix the seed to make a generation reproducible. Omit for a random seed. ### `prompt_upsampling` — boolean, default `false` When `true`, the model rewrites and expands your prompt before generating. Leave it off when your wording is deliberate. ### `safety_tolerance` — integer, default `2` Moderation strictness from `0` (strictest) to `6` (most permissive), applied to both the input and the generated output. ### `fallback` — object, optional reAPI may serve a request on either of two upstreams and automatically retries on the second one if the first fails to deliver. Send `{"enabled": false}` to disable that retry and fail fast instead: ```json { "model": "flux-kontext-pro", "prompt": "Change the hair color to blue", "fallback": { "enabled": false } } ``` Your price is unaffected either way — both upstreams bill the same rate for the same request. Turning the retry off trades availability for a faster failure. *** ## Pricing FLUX Kontext bills a flat rate **per generated image**, by tier (`flux-kontext-pro` / `flux-kontext-max`). Aspect ratio is not a billing dimension — every ratio renders at \~1 MP — and editing costs the same as generating: ``` credits = ceil(per_image_usd × 1000) ``` where `1 credit = $0.001 USD`. Each request produces one image. Failed and rejected requests are not charged. The exact per-image credit cost for each tier surfaces on the [model page](https://reapi.ai/models/flux-kontext) and through the playground estimator before submit. *** ## Response The poll envelope returns the image URL in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "flux-kontext-pro", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...png" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (empty prompt, more than 4 `image_urls`, a non-http(s) URL, `safety_tolerance` outside 0–6, or sending `width` / `height`) → `400`. `resolution` is *not* in this list — it is accepted and ignored, as described under [`size`](#size--string-default-11). * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * For text replacement, use the explicit grammar the model is tuned for: `Replace 'old text' with 'new text'`. Capitalisation carries through, so write the replacement exactly as it should appear. * State what must **not** change ("keep the person and their lighting unchanged"). Naming the invariant is the most reliable way to keep an edit surgical. * Editing runs iteratively — feed a result back in as `image_urls` for the next change. Character identity is designed to survive that chain. * Pick `flux-kontext-pro` for volume and latency; reach for `flux-kontext-max` when in-image typography has to be exactly right. * Output is always \~1 MP. If you need larger assets, upscale downstream or use a model that renders at higher resolution natively. *** ## Related * [FLUX.2](/docs/flux-2) * [Image generation models](/docs/gpt-image-2) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # gemini-2.5-flash-image-preview (https://reapi.ai/docs/gemini-2-5-flash-image-preview) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Async image generation tuned for speed. One endpoint covers > text-to-image and image-to-image with up to 14 reference images. > Two channels share the same parameter shape: > > * `gemini-2.5-flash-image-preview` — default channel. > * `gemini-2.5-flash-image-preview-official` — Google's official endpoint. * Async processing — `POST` returns a `task_id`, poll `GET /api/v1/tasks/{id}` for the result. * standard `/api/v1/images/generations` envelope (text-to-image / image-to-image). * 10 ratios via `size`; only **1K** resolution on this model. * Up to **14** reference images via `image_urls` — public HTTP(S) URLs only. * Up to **4** images per request via `n`. * Failed / moderated requests are not charged. *** ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-2.5-flash-image-preview", "prompt": "moonlight on a bamboo path, ink wash painting", "size": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "gemini-2.5-flash-image-preview", "prompt": "moonlight on a bamboo path, ink wash painting", "size": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gemini-2.5-flash-image-preview", prompt: "moonlight on a bamboo path, ink wash painting", size: "16:9", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gemini-2.5-flash-image-preview", "prompt": "moonlight on a bamboo path, ink wash painting", "size": "16:9", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-2.5-flash-image-preview", "status": "processing", "created_at": 1735000000 } ``` Hold onto `id` and poll `GET /api/v1/tasks/{id}` until completion. *** ## Endpoint ```http POST /api/v1/images/generations # submit a job GET /api/v1/tasks/{id} # poll for the result ``` Async — submit returns a `task_id` immediately; the actual image arrives via the polling endpoint. Polling is free. *** ## Authentication Bearer token, minted at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer rk_live_xxx ``` *** ## Body ### `model` `string` · **required** One of: * `"gemini-2.5-flash-image-preview"` — default channel. * `"gemini-2.5-flash-image-preview-official"` — Google's official endpoint. ### `prompt` `string` · **required** 1 – 2000 characters. English and Chinese both supported. Don't restate the ratio in the prompt — pass it via `size`. Image-to-image is no exception — the prompt describes what to do with the reference. Sending `image_urls` without a `prompt` returns `400`. ### `size` `string` · default `"1:1"` (text-to-image) / inherited (image-to-image) Output ratio. One of these 10 values: ``` 1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9 ``` Anything outside the list is rejected with `400`. When `image_urls` is provided **without** `size`, the output inherits the first reference image's resolution (image-to-image mode). Pass `size` to force a specific ratio. ### `resolution` `string` · default `"1K"` Only `1K` is supported on this model. Sending `2K` / `4K` returns `400`. Switch to [`gemini-3-pro-image-preview`](/docs/gemini-3-pro-image-preview) or [`gemini-3.1-flash-image-preview`](/docs/gemini-3-1-flash-image-preview) when you need higher resolutions. ### `n` `integer` · default `1` 1 – 4 images per request. Must be a number, not a string. ### `image_urls` `string[]` · optional Reference images for image-to-image. Up to **14** entries. Each entry must be a public HTTP(S) URL — `data:` / base64 payloads are rejected at the gateway. Upload to your own object storage (S3 / R2 / OSS) and pass the URL. *** ## Use cases ### 1. Text-to-image (minimal) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-2.5-flash-image-preview", "prompt": "moonlight on a bamboo path, ink wash painting" }' ``` ### 2. Text-to-image, widescreen ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-2.5-flash-image-preview", "prompt": "a corgi astronaut on the moon, cinematic", "size": "16:9" }' ``` ### 3. Multiple variations in one call ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-2.5-flash-image-preview", "prompt": "vintage botanical illustration, hibiscus", "size": "4:5", "n": 4 }' ``` ### 4. Image-to-image (single reference) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-2.5-flash-image-preview", "prompt": "turn this photo into a watercolor painting", "image_urls": ["https://your-cdn.com/photo.jpg"] }' ``` ### 5. Multi-reference fusion ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-2.5-flash-image-preview", "prompt": "blend these two photos into a poster", "size": "4:3", "image_urls": [ "https://your-cdn.com/photo-a.jpg", "https://your-cdn.com/photo-b.jpg" ] }' ``` ### 6. Force the official channel ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-2.5-flash-image-preview-official", "prompt": "studio portrait of a tabby cat, soft light", "size": "1:1" }' ``` *** ## Response `POST` returns immediately with `status: "processing"`; poll `GET /api/v1/tasks/{id}` until `status` is `completed` or `failed`. Both responses share the same envelope — the `output` field is `null` until the task finishes. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-2.5-flash-image-preview", "status": "processing", "created_at": 1735000000 } ``` ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-2.5-flash-image-preview", "status": "completed", "created_at": 1735000000, "output": { "image_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png"] }, "error": null } ``` URLs are stable for **7 days**. Download to your own storage if you need them longer. ```json { "error": { "code": 20003, "message": "gemini-2.5-flash-image-preview: only resolution=1K is supported", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 10003, "message": "API key invalid", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 30001, "message": "Insufficient credits", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 50001, "message": "Rate limit exceeded", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 60099, "message": "Internal error — please retry", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ### Upstream errors (502 / 503) reAPI does not surface raw upstream `5xx` codes to the caller. When the upstream provider returns `502 Bad Gateway`, `503 Service Unavailable`, or a connection failure, the worker retries up to 5 attempts with exponential backoff (\~30s total budget). If all retries fail, the task ends with one of these reapi-specific error codes (returned via `GET /api/v1/tasks/{id}` as `error.code`): | reapi code | Meaning | Origin | | ---------- | -------------------------- | ------------------------------------ | | `80001` | `provider_submit_failed` | Upstream `5xx` / network on submit | | `80002` | `provider_polling_timeout` | Wall-clock cap reached while polling | | `80003` | `provider_failed` | Upstream returned a terminal failure | See [Errors catalog](/docs/api/errors) for the full code list. *** ## Polling | `status` | Meaning | | ------------ | ----------------------------- | | `processing` | Submitted, still generating | | `completed` | `output.image_urls` is ready | | `failed` | See `error.code`; not charged | Recommended cadence: ``` 0–10s: wait before the first poll 10s–60s: poll every 2–3s 60s+: back off to 5s; cap at 15s ``` A 1K image typically completes in 5 – 20 seconds. *** ## Related * [`gemini-3-pro-image-preview`](/docs/gemini-3-pro-image-preview) — higher-quality variant with 1K / 2K / 4K resolutions. * [`gemini-3.1-flash-image-preview`](/docs/gemini-3-1-flash-image-preview) — newer variant with extreme ratios and Google search grounding. * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Pricing — gemini-2.5-flash-image-preview](https://reapi.ai/models/gemini-2-5-flash-image-preview#pricing) --- # gemini-3.1-flash-image-preview (https://reapi.ai/docs/gemini-3-1-flash-image-preview) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Async image generation with a wide ratio surface (down to > 1:8 / 8:1) and optional Google search grounding. One endpoint covers > text-to-image and image-to-image with up to 14 reference images. Two > channels share the same parameter shape: > > * `gemini-3.1-flash-image-preview` — default channel. > * `gemini-3.1-flash-image-preview-official` — Google's official endpoint. * Async processing — `POST` returns a `task_id`, poll `GET /api/v1/tasks/{id}` for the result. * standard `/api/v1/images/generations` envelope (text-to-image / image-to-image). * 14 ratios via `size`, including extreme `1:4` / `4:1` / `1:8` / `8:1`. * Four resolution tiers via `resolution`: `0.5K` / `1K` / `2K` / `4K`. * Up to **14** reference images via `image_urls` — public HTTP(S) URLs only. * Up to **4** images per request via `n`. * Optional Google search grounding via `google_search` and `google_image_search`. *** ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "neon-lit cyberpunk skyline at midnight", "size": "16:9", "resolution": "2K" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "gemini-3.1-flash-image-preview", "prompt": "neon-lit cyberpunk skyline at midnight", "size": "16:9", "resolution": "2K", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gemini-3.1-flash-image-preview", prompt: "neon-lit cyberpunk skyline at midnight", size: "16:9", resolution: "2K", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gemini-3.1-flash-image-preview", "prompt": "neon-lit cyberpunk skyline at midnight", "size": "16:9", "resolution": "2K", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-3.1-flash-image-preview", "status": "processing", "created_at": 1735000000 } ``` Hold onto `id` and poll `GET /api/v1/tasks/{id}` until completion. *** ## Endpoint ```http POST /api/v1/images/generations # submit a job GET /api/v1/tasks/{id} # poll for the result ``` Async — submit returns a `task_id` immediately; the actual image arrives via the polling endpoint. Polling is free. *** ## Authentication Bearer token, minted at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer rk_live_xxx ``` *** ## Body ### `model` `string` · **required** One of: * `"gemini-3.1-flash-image-preview"` — default channel. * `"gemini-3.1-flash-image-preview-official"` — Google's official endpoint. ### `prompt` `string` · **required** Detailed prompts produce better results. English and Chinese both supported. Don't restate the ratio in the prompt — pass it via `size`. Image-to-image is no exception — the prompt describes what to do with the reference. Sending `image_urls` without a `prompt` returns `400`. ### `size` `string` · default `"1:1"` (text-to-image) / inherited (image-to-image) Output ratio. One of these 14 values: ``` 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 ``` `1:4` / `4:1` / `1:8` / `8:1` are useful for tall posters, banner ads, and long-strip social formats. Anything outside the list is rejected with `400`. ### `resolution` `string` · default `"1K"` `0.5K` / `1K` / `2K` / `4K`. Case-insensitive — `"2K"` and `"2k"` are equivalent. ### `n` `integer` · default `1` 1 – 4 images per request. Must be a number, not a string. ### `image_urls` `string[]` · optional Reference images for image-to-image. Up to **14** entries. Each entry must be a public HTTP(S) URL — `data:` / base64 payloads are rejected at the gateway. Recommended split: ≤ 10 object references + ≤ 4 character references for best consistency. ### `google_search` `boolean` · default `false` When `true`, the model first searches the web for textual context to ground the generated image in real-world facts. Useful for prompts that reference recent events, named entities, or specific places. Adds an extra search round-trip — budget extra polling time. ### `google_image_search` `boolean` · default `false` When `true`, the model also searches the web for **image** references in addition to text. **Requires `google_search: true`** — sending `google_image_search: true` with `google_search: false` (or omitted) returns `400`. *** ## Use cases ### 1. Text-to-image (minimal) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "neon-lit cyberpunk skyline at midnight" }' ``` ### 2. Long-banner poster (extreme ratio) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "long horizontal banner of a serene lakeside at sunrise", "size": "8:1", "resolution": "2K" }' ``` ### 3. Tall mobile-first poster ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "vertical movie poster, lone astronaut on a frozen moon", "size": "1:4", "resolution": "2K" }' ``` ### 4. Search-grounded generation ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "the Eiffel Tower lit up for Bastille Day fireworks", "size": "16:9", "resolution": "2K", "google_search": true, "google_image_search": true }' ``` ### 5. Image-to-image with reference ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "stylize this product photo as a vintage magazine cover", "image_urls": ["https://your-cdn.com/product.jpg"], "size": "4:5", "resolution": "2K" }' ``` ### 6. Multi-reference fusion ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "place subject from reference 1 into the scene of reference 2", "size": "16:9", "resolution": "4K", "image_urls": [ "https://your-cdn.com/subject.jpg", "https://your-cdn.com/scene.jpg" ] }' ``` ### 7. Low-cost preview at 0.5K ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3.1-flash-image-preview", "prompt": "concept thumbnail of a forest temple", "size": "1:1", "resolution": "0.5K", "n": 4 }' ``` *** ## Response `POST` returns immediately with `status: "processing"`; poll `GET /api/v1/tasks/{id}` until `status` is `completed` or `failed`. Both responses share the same envelope — the `output` field is `null` until the task finishes. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-3.1-flash-image-preview", "status": "processing", "created_at": 1735000000 } ``` ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-3.1-flash-image-preview", "status": "completed", "created_at": 1735000000, "output": { "image_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png"] }, "error": null } ``` URLs are stable for **7 days**. Download to your own storage if you need them longer. ```json { "error": { "code": 20003, "message": "gemini-3.1-flash-image-preview: google_image_search requires google_search:true", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 10003, "message": "API key invalid", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 30001, "message": "Insufficient credits", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 50001, "message": "Rate limit exceeded", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 60099, "message": "Internal error — please retry", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ### Upstream errors (502 / 503) reAPI does not surface raw upstream `5xx` codes to the caller. When the upstream provider returns `502 Bad Gateway`, `503 Service Unavailable`, or a connection failure, the worker retries up to 5 attempts with exponential backoff (\~30s total budget). If all retries fail, the task ends with one of these reapi-specific error codes (returned via `GET /api/v1/tasks/{id}` as `error.code`): | reapi code | Meaning | Origin | | ---------- | -------------------------- | ------------------------------------ | | `80001` | `provider_submit_failed` | Upstream `5xx` / network on submit | | `80002` | `provider_polling_timeout` | Wall-clock cap reached while polling | | `80003` | `provider_failed` | Upstream returned a terminal failure | See [Errors catalog](/docs/api/errors) for the full code list. *** ## Polling | `status` | Meaning | | ------------ | ----------------------------- | | `processing` | Submitted, still generating | | `completed` | `output.image_urls` is ready | | `failed` | See `error.code`; not charged | Recommended cadence: ``` 0–15s: wait before the first poll 15s–2m: poll every 3–5s 2m+: back off to 10s; cap at 30s ``` A 1K image typically completes in 10 – 30 seconds; 4K and Google search grounding both add latency. *** ## Related * [`gemini-2.5-flash-image-preview`](/docs/gemini-2-5-flash-image-preview) — earlier variant (1K only). * [`gemini-3-pro-image-preview`](/docs/gemini-3-pro-image-preview) — higher-fidelity variant without search grounding. * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Pricing — gemini-3.1-flash-image-preview](https://reapi.ai/models/gemini-3-1-flash-image-preview#pricing) --- # gemini-3-6-flash (https://reapi.ai/docs/gemini-3-6-flash) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Google's Gemini 3.6 Flash, exposed through api.reapi.ai as a drop-in > OpenAI-compatible Chat Completions endpoint. A **1,048,576-token** input window, > **65,536-token** max output, inputs across **text, image, video, audio and > PDF** with text output, plus **thinking**, **function calling**, **code > execution**, **structured outputs**, **context caching**, **file search**, > **URL context** and **Search / Maps grounding**. The wire `model` id is > `gemini-3.6-flash`. Current rates live on the > [model page](https://reapi.ai/models/gemini-3-6-flash) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3.6-flash", "messages": [ { "role": "user", "content": "Summarise the attached contract in five bullets." } ], "stream": true, "max_tokens": 8192 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="gemini-3.6-flash", messages=[{"role": "user", "content": "Summarise the attached contract in five bullets."}], max_tokens=8192, stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "gemini-3.6-flash", messages: [ { role: "user", content: "Summarise the attached contract in five bullets." }, ], max_tokens: 8192, stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gemini-3.6-flash", "messages": []map[string]string{ {"role": "user", "content": "Summarise the attached contract in five bullets."}, }, "max_tokens": 8192, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs (`openai-python`, `openai-node`, `openai-go`, …) work once you swap the base URL, the key and the model string. The gateway also lists a native Gemini endpoint type for this model if you prefer Google's own request format. *** ## Request body ### `model` — string, required Must be `gemini-3.6-flash` exactly. The dotted form is the wire id; the `/models/gemini-3-6-flash` landing page uses a hyphenated slug for the URL. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Roles are `system`, `user` and `assistant`. Multimodal parts are supported — see [Multimodal input](#multimodal-input). ### `max_tokens` — integer Upper bound on output tokens for this response, **thinking tokens included**. Google documents a **65,536**-token output ceiling for this model, so higher values are clamped to it. ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events terminated by `data: [DONE]`. Recommended for anything a person watches. ### `temperature` — number, default `1` Sampling temperature. Lower is more deterministic. ### `top_p` — number, default `0.95` Nucleus sampling cutoff. Tune either `temperature` or `top_p`, not both. ### `tools` / `tool_choice` — optional Function declarations for tool calling, and the strategy for picking among them. See [Tools and grounding](#tools-and-grounding). ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Multimodal input Google documents the following supported inputs for this model: | Modality | Supported | | -------- | :-------: | | Text | ✅ | | Image | ✅ | | Video | ✅ | | Audio | ✅ | | PDF | ✅ | Output is **text only**. Audio generation, image generation and the Live API are **not** supported on this model — use a dedicated model for those. PDF being a first-class input matters for document workloads: a contract set or a research bundle goes in whole, without a chunking layer of your own. *** ## Thinking Thinking is a supported capability. The reasoning pass is what carries a multi-step plan across tool calls instead of restarting on each turn. **Thinking tokens are billed as output tokens** and count toward `max_tokens`. A long reasoning pass therefore competes with the visible answer for the same budget — raise `max_tokens` when you ask for both deep reasoning and long output. *** ## Tools and grounding | Capability | Status | | -------------------------- | ------------------- | | Function calling | Supported | | Code execution | Supported | | File search | Supported | | Structured outputs | Supported | | Context caching | Supported | | URL context | Supported | | Search grounding | Supported | | Grounding with Google Maps | Supported | | Computer use | Supported (preview) | Google meters grounded search queries separately from tokens, and a single request may fan out into more than one search query. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Thinking tokens bill as output.** They are the usual reason a bill exceeds an estimate built from visible response length alone. * **Output dominates.** For most generative workloads the output rate, not the input rate, decides the invoice. * **Grounded search is metered by Google separately** from tokens. Both token rates sit **20% below Google's published Standard rate**. Current numbers are on the [model page](https://reapi.ai/models/gemini-3-6-flash) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "gemini-3.6-flash", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 812, "completion_tokens": 240, "total_tokens": 1052 } } ``` `usage.completion_tokens` includes thinking tokens, so it is the number to reconcile a bill against. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk` with the incremental text in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | ------------------------------------ | -------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `gemini-3.6-flash` exactly, dots included | | `max_tokens` above the model ceiling | Lower it; the documented ceiling is 65,536 | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another model | *** ## Tips * **Stream anything interactive.** Time-to-first-token is what users perceive; a non-streamed long answer reads as a hang. * **Budget for thinking.** If responses truncate mid-sentence on hard prompts, the reasoning pass consumed the `max_tokens` allowance — raise it. * **Put the whole document in.** With a 1,048,576-token window, a retrieval layer whose only purpose was working around a small context is usually worth deleting. * **Use structured outputs for tool arguments.** Schema-constrained output removes a whole class of parse-and-retry logic. * **Reach for grounding rather than a stale answer.** Search grounding and URL context exist precisely for facts newer than the training data. * **Pin the Stable string.** `gemini-3.6-flash` is Google's Stable channel id; `latest`-style aliases can be hot-swapped underneath you. *** ## Related * [Gemini 3.6 Flash model page](https://reapi.ai/models/gemini-3-6-flash) — current rates * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # gemini-3-pro-image-preview (https://reapi.ai/docs/gemini-3-pro-image-preview) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Async high-quality image generation. One endpoint covers > text-to-image and image-to-image with up to 14 reference images. > Two channels share the same parameter shape: > > * `gemini-3-pro-image-preview` — default channel. > * `gemini-3-pro-image-preview-official` — Google's official endpoint. * Async processing — `POST` returns a `task_id`, poll `GET /api/v1/tasks/{id}` for the result. * standard `/api/v1/images/generations` envelope (text-to-image / image-to-image). * 10 ratios via `size`; three resolution tiers (`1K` / `2K` / `4K`) via `resolution`. * Up to **14** reference images via `image_urls` — public HTTP(S) URLs only. * Up to **4** images per request via `n`. * Failed / moderated requests are not charged. *** ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-3-pro-image-preview", "prompt": "ancient castle beneath a starry sky, cinematic", "size": "16:9", "resolution": "2K" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "gemini-3-pro-image-preview", "prompt": "ancient castle beneath a starry sky, cinematic", "size": "16:9", "resolution": "2K", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gemini-3-pro-image-preview", prompt: "ancient castle beneath a starry sky, cinematic", size: "16:9", resolution: "2K", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gemini-3-pro-image-preview", "prompt": "ancient castle beneath a starry sky, cinematic", "size": "16:9", "resolution": "2K", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-3-pro-image-preview", "status": "processing", "created_at": 1735000000 } ``` Hold onto `id` and poll `GET /api/v1/tasks/{id}` until completion. *** ## Endpoint ```http POST /api/v1/images/generations # submit a job GET /api/v1/tasks/{id} # poll for the result ``` Async — submit returns a `task_id` immediately; the actual image arrives via the polling endpoint. Polling is free. *** ## Authentication Bearer token, minted at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer rk_live_xxx ``` *** ## Body ### `model` `string` · **required** One of: * `"gemini-3-pro-image-preview"` — default channel. * `"gemini-3-pro-image-preview-official"` — Google's official endpoint. ### `prompt` `string` · **required** Detailed prompts produce better results. English and Chinese both supported. Don't restate the ratio in the prompt — pass it via `size`. Image-to-image is no exception — the prompt describes what to do with the reference. Sending `image_urls` without a `prompt` returns `400`. ### `size` `string` · default `"1:1"` (text-to-image) / inherited (image-to-image) Output ratio. One of these 10 values: ``` 1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9 ``` Anything outside the list is rejected with `400`. When `image_urls` is provided **without** `size`, the output inherits the first reference image's resolution (image-to-image mode). Pass `size` to force a specific ratio. ### `resolution` `string` · default `"1K"` `1K` / `2K` / `4K`. Case-insensitive — `"2K"` and `"2k"` are equivalent. ### `n` `integer` · default `1` 1 – 4 images per request. Must be a number, not a string. ### `image_urls` `string[]` · optional Reference images for image-to-image. Up to **14** entries. Each entry must be a public HTTP(S) URL — `data:` / base64 payloads are rejected at the gateway. Upload to your own object storage (S3 / R2 / OSS) and pass the URL. *** ## Use cases ### 1. Text-to-image (minimal) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3-pro-image-preview", "prompt": "ancient castle beneath a starry sky, cinematic" }' ``` ### 2. Text-to-image at 2K ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3-pro-image-preview", "prompt": "neon-lit Tokyo street in the rain, cyberpunk", "size": "16:9", "resolution": "2K" }' ``` ### 3. Text-to-image at 4K ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3-pro-image-preview", "prompt": "cinematic mountain valley at golden hour", "size": "21:9", "resolution": "4K" }' ``` ### 4. Image-to-image (single reference) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3-pro-image-preview", "prompt": "convert this snapshot into a film-grain editorial shot", "image_urls": ["https://your-cdn.com/photo.jpg"], "resolution": "2K" }' ``` ### 5. Multi-reference fusion ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3-pro-image-preview", "prompt": "blend the subject from photo A with the lighting of photo B", "size": "4:3", "resolution": "2K", "image_urls": [ "https://your-cdn.com/photo-a.jpg", "https://your-cdn.com/photo-b.jpg" ] }' ``` ### 6. Force the official channel ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gemini-3-pro-image-preview-official", "prompt": "marble bust of a philosopher, dramatic side lighting", "size": "1:1", "resolution": "2K" }' ``` *** ## Response `POST` returns immediately with `status: "processing"`; poll `GET /api/v1/tasks/{id}` until `status` is `completed` or `failed`. Both responses share the same envelope — the `output` field is `null` until the task finishes. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-3-pro-image-preview", "status": "processing", "created_at": 1735000000 } ``` ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-3-pro-image-preview", "status": "completed", "created_at": 1735000000, "output": { "image_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png"] }, "error": null } ``` URLs are stable for **7 days**. Download to your own storage if you need them longer. ```json { "error": { "code": 20003, "message": "gemini-3-pro-image-preview: invalid resolution \"8K\"", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 10003, "message": "API key invalid", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 30001, "message": "Insufficient credits", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 50001, "message": "Rate limit exceeded", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 60099, "message": "Internal error — please retry", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ### Upstream errors (502 / 503) reAPI does not surface raw upstream `5xx` codes to the caller. When the upstream provider returns `502 Bad Gateway`, `503 Service Unavailable`, or a connection failure, the worker retries up to 5 attempts with exponential backoff (\~30s total budget). If all retries fail, the task ends with one of these reapi-specific error codes (returned via `GET /api/v1/tasks/{id}` as `error.code`): | reapi code | Meaning | Origin | | ---------- | -------------------------- | ------------------------------------ | | `80001` | `provider_submit_failed` | Upstream `5xx` / network on submit | | `80002` | `provider_polling_timeout` | Wall-clock cap reached while polling | | `80003` | `provider_failed` | Upstream returned a terminal failure | See [Errors catalog](/docs/api/errors) for the full code list. *** ## Polling | `status` | Meaning | | ------------ | ----------------------------- | | `processing` | Submitted, still generating | | `completed` | `output.image_urls` is ready | | `failed` | See `error.code`; not charged | Recommended cadence: ``` 0–30s: wait before the first poll 30s–3m: poll every 3–5s 3m+: back off to 10s; cap at 30s ``` A 1K image typically completes in 30 – 60 seconds; 2K adds \~30s; 4K can take 90 – 120 seconds. *** ## Related * [`gemini-2.5-flash-image-preview`](/docs/gemini-2-5-flash-image-preview) — faster, cheaper variant (1K only). * [`gemini-3.1-flash-image-preview`](/docs/gemini-3-1-flash-image-preview) — newer variant with extreme ratios and Google search grounding. * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Pricing — gemini-3-pro-image-preview](https://reapi.ai/models/gemini-3-pro-image-preview#pricing) --- # gemini-omni (https://reapi.ai/docs/gemini-omni) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Gemini Omni — Google's any-to-any video model, exposed through reapi as > a single async endpoint. Mode is implicit: the counts of `image_urls` / > `video_urls` pick **text-to-video**, **image-to-video**, > **three-image fusion**, or **reference-to-video**. 4 to 10 second outputs > at 720p, 1080p, or 4K. Flat per-generation pricing across every mode — see > the [model page](https://reapi.ai/models/gemini-omni). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-omni", "prompt": "A kitten playing piano, slow camera push-in", "duration": 6, "resolution": "1080p", "aspect_ratio": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "gemini-omni", "prompt": "A kitten playing piano, slow camera push-in", "duration": 6, "resolution": "1080p", "aspect_ratio": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gemini-omni", prompt: "A kitten playing piano, slow camera push-in", duration: 6, resolution: "1080p", aspect_ratio: "16:9", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gemini-omni", "prompt": "A kitten playing piano, slow camera push-in", "duration": 6, "resolution": "1080p", "aspect_ratio": "16:9", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-omni", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL, valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Mode routing `gemini-omni` picks its mode from the **counts of `image_urls` and `video_urls`** you send — there is no `mode` parameter: | `image_urls` | `video_urls` | Mode | What it does | | ------------ | ------------ | ---------------------- | ------------------------------------------------------------------------ | | `0` | `0` | **Text-to-video** | Generate from a prompt. | | `1` | `0` | **Image-to-video** | Animate from a single starting frame. | | `3` | `0` | **Three-image fusion** | Combine three references into one motion shot. | | `0` / `1` | `1` | **Reference-to-video** | Reference a source clip (≤ 30s) for motion / style. Flat per generation. | **Unsupported counts.** * `image_urls = 2` is **rejected** with `400 image_urls cardinality 2 is not supported`. Submit 0, 1, or 3 — there is no first/last-frame mode on `gemini-omni`. * `image_urls = 4` or more is also rejected. * `video_urls = 2` or more is **rejected** with `400 video_urls accepts at most 1 entry`. * `duration` and `video_urls` cannot both be set. Reference-to-video mode reads the source clip's length; passing `duration` alongside is rejected with `400 duration and video_urls cannot both be set`. *** ## Request body ### `model` — required `string`. Must be `"gemini-omni"`. ### `prompt` — string, required Up to **2,000 characters**. Required in every mode (text-to-video, image-to-video, three-image fusion, reference-to-video). Empty / whitespace-only prompts are treated as missing. **Failure modes.** * Empty / missing → `400 prompt is required` (code `20002`). * Longer than 2,000 chars → `400 prompt exceeds 2000 characters (got N)` (code `20007`). ### `duration` — integer, default `6` One of `4`, `6`, `8`, `10` seconds. Other values are rejected with `400 duration must be 4, 6, 8, or 10 seconds, got N`. **Reference-to-video mode ignores `duration`.** When `video_urls` is set, the vendor reads the source clip's length to drive the output, and `duration` must be omitted. Passing both is rejected with `400 duration and video_urls cannot both be set`. ### `resolution` — string, default `"720p"` `720p` / `1080p` / `4k`. Lowercase is canonical; uppercase forms (`"4K"`) are accepted and normalized. Drives the per-generation rate — 720p and 1080p share the same price; only 4K is uplifted. ### `aspect_ratio` — string, default `"16:9"` Output framing. One of: | Value | Shape | | ------ | --------- | | `16:9` | Landscape | | `9:16` | Portrait | Unknown ratios are rejected with `400 invalid aspect_ratio`. ### `size` — string, alias for `aspect_ratio` The same value the supplier doc lists as a separate field. If both are sent, they must match; otherwise `400 aspect_ratio and size disagree`. The reapi playground does not surface `size`; the JSON body still accepts it for parity. ### `image_urls` — string\[] Array of public HTTP(S) URLs. **Allowed counts: 0, 1, or 3**. * **0 entries** — text-to-video. * **1 entry** — image-to-video; the image is treated as the starting frame. * **3 entries** — three-image fusion. The model combines all three references into one motion shot. ### `video_urls` — string\[] Array of public HTTP(S) URLs. **Allowed counts: 0 or 1**. * **0 entries** — non-reference modes (text / image / fusion). * **1 entry** — reference-to-video. The source clip drives the output; it must be **≤ 30 seconds** (longer is rejected with `400`), and the first ≤ 10 seconds are used as the reference. Billed at a **flat per-generation rate** (not per second). `duration` MUST be omitted in this mode. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field on this endpoint must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gemini-omni", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Always `"gemini-omni"` (echo of the submitted `model`) | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | `output.video_urls` URLs are valid for **7 days**. Re-host to your own storage if you need them longer. *** ## Validation errors All cases below return HTTP 400 with code `20003` unless noted. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values, etc.) and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------------------- | ------- | -------------------------------------------------------------------------------- | | `prompt` missing or blank | `20002` | `gemini-omni: prompt is required` | | `prompt` longer than 2,000 chars | `20007` | `gemini-omni: prompt exceeds 2000 characters (got N)` | | `image_urls` length `2` | `20003` | `gemini-omni: image_urls cardinality 2 is not supported` | | `image_urls` length > `3` | `20003` | `gemini-omni: image_urls accepts at most 3 entries, got N` | | `duration` not one of 4/6/8/10 | `20003` | `gemini-omni: duration must be 4, 6, 8, or 10 seconds, got N` | | Unknown `resolution` | `20003` | `gemini-omni: invalid resolution "X" (allowed: 720p / 1080p / 4k)` | | Unknown `aspect_ratio` | `20003` | `gemini-omni: invalid aspect_ratio "X" (allowed: 16:9 / 9:16)` | | `aspect_ratio` and `size` disagree | `20003` | `gemini-omni: aspect_ratio "X" and size "Y" disagree` | | `image_urls` carrying a `data:` URI or non-http(s) | `20003` | `gemini-omni: image_urls entries must be public http(s) URLs` | | `video_urls` source clip longer than 30 seconds | `20003` | `Reference video must be at most 30s (got Ns); trim the clip before submitting.` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Text-to-video — minimum request ```json { "model": "gemini-omni", "prompt": "A little girl walking down a sunset coastal road" } ``` ### Text-to-video — full parameters ```json { "model": "gemini-omni", "prompt": "A kitten playing piano, slow camera push-in, cinematic warm tones", "duration": 8, "resolution": "1080p", "aspect_ratio": "16:9" } ``` ### Image-to-video — animate a single frame ```json { "model": "gemini-omni", "prompt": "Bring the scene to life with a gentle camera dolly forward", "image_urls": ["https://your-cdn.com/first_frame.jpg"], "duration": 6, "resolution": "1080p" } ``` ### Three-image fusion ```json { "model": "gemini-omni", "prompt": "Compose a 10-second product spot mixing scene, character, and product", "image_urls": [ "https://your-cdn.com/scene.jpg", "https://your-cdn.com/character.jpg", "https://your-cdn.com/product.jpg" ], "duration": 10, "resolution": "1080p", "aspect_ratio": "9:16" } ``` ### 4K hero shot ```json { "model": "gemini-omni", "prompt": "A neon city street in the rain, slow camera pan, reflections on the asphalt", "duration": 4, "resolution": "4k", "aspect_ratio": "16:9" } ``` ### Reference-to-video — match a source clip ```json { "model": "gemini-omni", "prompt": "the same scene but at night with neon lights", "resolution": "720p", "aspect_ratio": "16:9", "video_urls": ["https://your-cdn.com/source.mp4"] } ``` The output tracks the source clip (which must be **≤ 30s**; the first ≤ 10s are used as the reference); **omit `duration`**. Billing is a flat per-generation rate (see [Pricing](#pricing) below). *** ## Choosing a mode | Need | Send | | ---------------------------------------- | ------------------------------------------------- | | Generate from text | `prompt` only | | Animate a still | `prompt + image_urls` (1 entry) | | Compose scene + character + product | `prompt + image_urls` (3 entries) | | Match an existing clip's motion / length | `prompt + video_urls` (1 entry, no `duration`) | | Cut spend | Drop `resolution` to `720p` and `duration` to `4` | | Hero shot | Pick `4k` at `4-10s` | *** ## Polling pattern The task endpoint behaves identically to other video tasks — the only difference is the completed `output` shape (`video_urls` instead of `image_urls`). A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. The worker's wall-clock cap is **48 hours**, comfortably above any realistic queue. *** ## Pricing Two billing modes — picked by request shape. ### Per generation — text / image / fusion Charged once per submitted job. 720p and 1080p share the same rate at every duration; only 4K is uplifted. Duration tiers are `4s` / `6s` / `8s` / `10s`. See current per-tier rates on the [Gemini Omni model page](https://reapi.ai/models/gemini-omni). ### Flat per generation — reference-to-video Triggered when `video_urls` is set. Charged once per job at a flat rate by resolution — independent of clip length. 720p and 1080p share the same rate; 4K is uplifted. The source clip must be **≤ 30 seconds**: the gateway probes its decoded length server-side and rejects longer clips with `400`; the first ≤ 10 seconds are used as the reference. See current rates on the [Gemini Omni model page](https://reapi.ai/models/gemini-omni). ### Bill formula `1 credit = $0.001`. Integer credits = `ceil(usd × 1000)`. Failed jobs refund automatically. *** ## Tips * **Prompt motion, not just scene.** "Slow push-in, warm tones, shallow depth of field" outperforms a pure noun-list of what's on screen. * **Pick 720p first if you're iterating.** It's the same per-generation price as 1080p, but renders faster and lets you change your mind on the final tier without re-doing the bill math. * **Three-image fusion needs cohesive references.** Pick three images that share lighting and composition cues — the model fuses them more cleanly than three random shots. * **Pick 4K only when shipping.** A 4K render is roughly 2× the cost of 720p / 1080p; reserve it for the final keeper. * **Keep reference clips ≤ 30s.** Reference-to-video requires a source clip of **≤ 30 seconds** (the server probes its length via ffmpeg and rejects anything longer with `400`); only the first ≤ 10 seconds are used as the reference. Billing is a flat per-generation rate regardless of length. Omit `duration` — the server rejects requests that pass both. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # glm-5.2 (https://reapi.ai/docs/glm-5-2) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Z.AI's GLM-5.2 — a flagship foundation model built for long-horizon tasks — > exposed through api.reapi.ai as a drop-in OpenAI-compatible Chat Completions > endpoint. A **1M-token** context window Z.AI describes as *solid and lossless*, > **128K** max output, thinking **on by default but switchable off**, a > `reasoning_effort` dial that no other model in the GLM family accepts, genuinely > tunable `temperature` / `top_p`, function calling with streamed tool arguments, > JSON mode and context caching. Text in, text out. The wire `model` id is > **`glm-5.2`** — with the dot. Current rates live on the > [model page](https://reapi.ai/models/glm-5-2) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). **The URL and the model id differ.** This page and the model page spell the slug `glm-5-2` because a URL cannot carry the dot. The string your request body needs is `glm-5.2`. Sending `glm-5-2` as the model is the first thing to check on an unknown-model error. ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "glm-5.2", "messages": [ { "role": "user", "content": "Refactor this module and add tests." } ], "thinking": { "type": "enabled" }, "reasoning_effort": "max", "max_tokens": 8192, "stream": true }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="glm-5.2", messages=[{"role": "user", "content": "Refactor this module and add tests."}], max_tokens=8192, stream=True, extra_body={ "thinking": {"type": "enabled"}, "reasoning_effort": "max", }, ) for chunk in stream: delta = chunk.choices[0].delta reasoning = getattr(delta, "reasoning_content", None) if reasoning: print(reasoning, end="") if delta.content: print(delta.content, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "glm-5.2", messages: [{ role: "user", content: "Refactor this module and add tests." }], max_tokens: 8192, stream: true, // @ts-expect-error vendor-specific fields pass through thinking: { type: "enabled" }, reasoning_effort: "max", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "glm-5.2", "messages": []map[string]string{ {"role": "user", "content": "Refactor this module and add tests."}, }, "thinking": map[string]string{"type": "enabled"}, "reasoning_effort": "max", "max_tokens": 8192, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs (`openai-python`, `openai-node`, `openai-go`, …) work once you swap the base URL, the key and the model string. Vendor-specific fields such as `thinking` go through the SDK's pass-through mechanism — `extra_body` in Python. *** ## Request body ### `model` — string, required Must be `glm-5.2` exactly, dot included. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Roles are `system`, `user`, `assistant` and `tool`. **Text only** — see [Modality](#modality). ### `max_tokens` — integer Upper bound on output tokens for this response. This model supports a **128K** maximum output and the schema accepts values up to **131,072**. Reasoning is generated before the answer and draws on the same allowance. ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events terminated by `data: [DONE]`. Reasoning and answer arrive as **separate deltas** — `reasoning_content` and `content`. ### `thinking` — object, default `{"type": "enabled"}` Chain-of-thought control. See [Reasoning](#reasoning). ### `reasoning_effort` — string, default `"max"` How hard the model thinks; applies only while thinking is enabled. See [Reasoning](#reasoning) for the value-collapsing behaviour, which is the one surprise on this model. ### `temperature` / `top_p` — numbers Actually tunable here. See [Sampling parameters](#sampling-parameters). ### `tools` / `tool_choice` / `tool_stream` — optional Function definitions, selection strategy and streamed arguments. See [Tool calling](#tool-calling). ### `response_format` — object, optional `{"type": "text"}` (default) or `{"type": "json_object"}`. See [Structured output](#structured-output). ### `stop` — array, optional Stop words. **Only one is supported** despite the array shape. ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Reasoning Two things are unusual here, and both cut in the developer's favour. **1. Thinking is on by default, and can be turned off.** `thinking` defaults to `{"type": "enabled"}`, and `{"type": "disabled"}` is accepted — a switch several models in this class no longer offer. **2. With thinking on, the model decides per request whether to think.** Z.AI contrasts this explicitly with the previous generation, which reasoned unconditionally. Leaving thinking enabled therefore does not mean paying for reasoning on every trivial turn. ### The effort ladder collapses `reasoning_effort` accepts seven values for cross-provider compatibility, but they map onto **three** behaviours: | You send | What actually happens | | --------- | --------------------------------------------- | | `max` | **Default.** Deep reasoning. | | `xhigh` | Mapped to `max`. | | `high` | Enhanced reasoning — the real middle setting. | | `medium` | Mapped to `high`. | | `low` | Mapped to `high`. | | `minimal` | Skips thinking. | | `none` | Skips thinking. | **A middling value does not buy a middling cost.** `low` and `medium` both behave as `high`, so a client that drops to `low` expecting a cheap pass gets the same work as `high`. The only ways down are `high`, or skipping thinking entirely with `minimal` / `none`. ### Prior-turn reasoning is dropped by default `thinking.clear_thinking` defaults to **`true`**: the model ignores `reasoning_content` from earlier turns and keeps only visible text, tool calls and tool results. That keeps multi-turn context short and cheap, and it is why this model needs no special history handling out of the box. Set it to `false` for Preserved Thinking — and then the full, unmodified, correctly ordered `reasoning_content` history must be forwarded. Missing, truncated, rewritten or reordered blocks degrade the result. *** ## Sampling parameters Unlike several open-weight peers that pin these, both work: | Parameter | Range | Default | | ------------- | ----------------- | ------- | | `temperature` | `0.0` – **`1.0`** | `1.0` | | `top_p` | `0.01` – `1.0` | `0.95` | **`temperature` is capped at 1.0.** Code carried over from a provider that allows up to 2.0 will be rejected. Z.AI also advises tuning **one** of the two rather than both — `temperature` for creative latitude, `top_p` for convergence. A separate `do_sample` flag defaults to `true`; setting it `false` makes both sampling parameters stop taking effect. *** ## Tool calling * `tools` accepts up to **128** functions. * `tool_choice` accepts **`auto` only** — the model decides when a call is warranted. There is no `required` or per-function forcing on this model. * `tool_stream: true` streams tool-call arguments as they are generated instead of delivering the complete call at once. Concatenate `delta.tool_calls[*].function.arguments` across chunks. After executing calls, append one `tool` message per call with the matching `tool_call_id` before asking for the next completion. *** ## Structured output ```json { "response_format": { "type": "json_object" } } ``` This is **JSON mode, not JSON Schema** — you do not supply a schema and the model does not validate against one. Ask for the shape you want in the prompt as well, which Z.AI recommends explicitly. If you need schema-guaranteed fields, validate on your side after parsing. *** ## Modality | Modality | Supported | | -------- | :-------: | | Text in | ✅ | | Text out | ✅ | | Image in | ❌ | | Video in | ❌ | Z.AI's model card lists input and output modalities for this model as **text**. Vision is a different model in their lineup. If a step in your workflow needs a screenshot read, route that step elsewhere — this model is a strong choice for the code around it, not for looking at it. *** ## Context caching Caching is part of this model's capability set and rewards the obvious shape: keep a long stable prefix — system prompt, knowledge document, tool definitions — in front of a changing question, and let repeat requests reuse it. No cache id and no TTL to manage. Z.AI prices cached input as its own dimension. **reAPI does not publish a separate cached-input rate for this model**, so treat caching as a latency and context-length benefit here, and bill against the input and output rates in the pricing table. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Reasoning tokens bill as output.** Thinking is on by default at the deepest effort setting, which is the usual reason a bill exceeds an estimate built from visible answer length. * **Effort is the first lever.** Because the ladder collapses, the meaningful choices are deep (`max`), enhanced (`high`) or none at all. * **Output dominates.** For most generative workloads the output rate decides the invoice. Both token rates sit at **about a third below Z.AI's published per-token rate**. Current numbers are on the [model page](https://reapi.ai/models/glm-5-2) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "glm-5.2", "choices": [ { "index": 0, "message": { "role": "assistant", "reasoning_content": "...", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1204, "completion_tokens": 860, "total_tokens": 2064 } } ``` `reasoning_content` is a sibling of `content`. Unless you have turned off `clear_thinking`, you do not need to send it back. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk`. Reasoning arrives in `choices[0].delta.reasoning_content` and the answer in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | --------------------------------------------------- | ----------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `glm-5.2` with the dot — not the hyphenated slug | | `temperature` above `1.0` | Lower it; the ceiling is 1.0 on this model | | `tool_choice` set to `required` or a named function | Only `auto` is supported | | An image part in `messages` | Not a multimodal model — route vision elsewhere | | More than one entry in `stop` | Only one stop word is supported | | `max_tokens` above the ceiling | Lower it; the documented ceiling is 131,072 | | `reasoning_effort` sent with thinking disabled | It only takes effect while thinking is enabled | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another model | *** ## Tips * **Send the whole project, then ask for the audit first.** Z.AI's own recommended opening move is an architecture map, module responsibilities, API contracts, data flows and technical debt — before any edit. * **Bound long tasks explicitly.** State what must not change (business logic, API signatures, runtime behaviour) and ask for the plan, impact scope, risk boundaries and verification method up front. * **Give it your real engineering standards.** Lint rules, build commands, test requirements, commit conventions and prohibited actions belong in the prompt; adherence under long context is what this generation improved. * **Pick an effort behaviour, not a number.** Deep, enhanced, or none — the values in between are aliases. * **Mind the `temperature` ceiling** of 1.0, and tune one sampling parameter rather than both. * **Stream anything interactive**, and render `reasoning_content` separately from the answer rather than concatenating them. * **Front-load the stable bulk** of your prompt so caching can do its job. *** ## Related * [GLM-5.2 model page](https://reapi.ai/models/glm-5-2) — current rates * [Kimi K3](/docs/kimi-k3) — the other open-weight 1M-context coding flagship * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # gpt-5.4 (https://reapi.ai/docs/gpt-5-4) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > GPT-5.4 is OpenAI's established reasoning model, exposed through > api.reapi.ai as a drop-in OpenAI-compatible Chat Completions endpoint. > 1M token context, 128K max output, function calling, and JSON-mode > responses. The cost-efficient route in the GPT family — current rates > live on the [model page](https://reapi.ai/models/gpt-5-4) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.4", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "temperature": 0.7, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="gpt-5.4", messages=[{"role": "user", "content": "Hello"}], stream=True, temperature=0.7, top_p=1, frequency_penalty=0, presence_penalty=0, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "gpt-5.4", messages: [{ role: "user", content: "Hello" }], stream: true, temperature: 0.7, top_p: 1, frequency_penalty: 0, presence_penalty: 0, // `group` is an api.reapi.ai-specific extension; pass it via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-5.4", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "temperature": 0.7, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The GPT-5.4 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoint ```http POST https://api.reapi.ai/v1/chat/completions ``` OpenAI-compatible. The same SDKs (`openai-python`, `openai-node`, `openai-go`, …) work once the base URL is set to `https://api.reapi.ai/v1`. *** ## Request body ### `model` — string, required Must be `"gpt-5.4"`. The value is echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string or content-parts array" } ``` Multi-turn history is sent in chronological order — the last message is the one the model responds to. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. When `false`, the full response body is returned in one HTTP response. ### `temperature` — number, default `1` Range `0.0` – `2.0`. Sampling temperature. Lower values make output more deterministic; higher values increase randomness. OpenAI recommends tuning either `temperature` or `top_p`, not both. ### `top_p` — number, default `1` Range `0.0` – `1.0`. Nucleus sampling cutoff — restricts sampling to the smallest set of tokens whose cumulative probability mass exceeds `top_p`. ### `frequency_penalty` — number, default `0` Range `-2.0` – `2.0`. Penalises tokens by how often they've already appeared in the response so far. Positive values discourage literal repetition. ### `presence_penalty` — number, default `0` Range `-2.0` – `2.0`. Penalises tokens that have appeared at all, regardless of frequency. Positive values encourage the model to talk about new topics. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. `"default"` is the standard pool and covers nearly every workload — omit the field if you don't need custom routing. ### Other OpenAI parameters Every other field on the OpenAI Chat Completions spec — `max_tokens`, `stop`, `n`, `seed`, `tools`, `tool_choice`, `response_format`, `logprobs`, `top_logprobs`, `user`, `parallel_tool_calls` — passes through unchanged. The OpenAI SDKs do not need a reAPI-specific shim. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "gpt-5.4", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21 } } ``` `usage.prompt_tokens` and `usage.completion_tokens` are the inputs to the bill — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing) for the live rate card. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta: ``` data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1735000000,"model":"gpt-5.4","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1735000000,"model":"gpt-5.4","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1735000000,"model":"gpt-5.4","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: [DONE] ``` The final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). Usage stats are omitted from the stream — call again with `stream: false` if you need exact token counts per turn. *** ## Pricing GPT-5.4 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. Current rates live on the model page and on [api.reapi.ai/pricing](https://api.reapi.ai/pricing); the table at the top of the [model page](https://reapi.ai/models/gpt-5-4) is the authoritative number for what you'll be charged today. Long-context billing: when the input portion of a single request exceeds **272K tokens**, the whole call is billed at **2× input and 1.5× output**. Requests at or below 272K input use the standard rate. Failed requests are not charged. *** ## Limits | Limit | Value | | ------------------- | ------------- | | Context window | 1M tokens | | Max output per call | 128K tokens | | Standard-rate input | ≤ 272K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | -------------------------------------- | -------------------------------------------- | | `400` | Bad request shape, unknown field, etc. | Same shape OpenAI returns | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that's a one-for-one wire failure and a retry from your side is safe; the upstream provider may have already produced output, but the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "gpt-5.4", "messages": [ { "role": "user", "content": "Summarise the OpenAI Chat Completions spec in three sentences." } ] } ``` ### Full parameter set ```json { "model": "gpt-5.4", "group": "default", "messages": [ { "role": "system", "content": "You are a senior staff engineer." }, { "role": "user", "content": "Walk me through a 1M-token codebase review strategy." } ], "stream": true, "temperature": 0.7, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0 } ``` ### Tool use (function calling) ```json { "model": "gpt-5.4", "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### JSON mode ```json { "model": "gpt-5.4", "response_format": { "type": "json_object" }, "messages": [ { "role": "system", "content": "Return a JSON object with keys: title, summary, tags." }, { "role": "user", "content": "Article: ..." } ] } ``` *** ## When to pick GPT-5.4 over GPT-5.5 GPT-5.4 and GPT-5.5 share the same endpoint, the same context window, and the same OpenAI-compatible wire format — switching between them is a one-line change in the `model` field. Pick GPT-5.4 when: * **High-volume production traffic** where per-call cost dominates the decision. * **Established workflows** (classification, extraction, summarisation, routine support replies) that don't benefit from GPT-5.5's newest reasoning gains or Tool Search. * **Latency-sensitive surfaces** where a slightly less expensive model also tends to respond faster on identical inputs. Pick GPT-5.5 when you need its strongest reasoning, Tool Search for large agent ecosystems, or `reasoning_effort` controls. *** ## Tips * **Stream by default for chat UX.** Streaming responses cut perceived latency dramatically and let your UI render tokens as they're produced. * **Watch the long-context boundary.** Splitting a 300K-token prompt into a 270K turn and a follow-up keeps you on the standard rate rather than the long-context tier. * **Tune `temperature` *or* `top_p`, not both.** Mixing them tends to produce results that are hard to reason about. * **Use `response_format: { type: "json_object" }` for structured output.** Much more reliable than parsing free-text JSON that the model writes inside backticks. * **Drop `frequency_penalty` and `presence_penalty` first when debugging weird output.** Non-zero values can introduce artefacts that look like model bugs. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # gpt-5.5 (https://reapi.ai/docs/gpt-5-5) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > GPT-5.5 is OpenAI's frontier reasoning model, exposed through reAPI as a > drop-in OpenAI-compatible Chat Completions endpoint. 1M token context, > 128K max output, advanced reasoning with adjustable effort, and Tool > Search for large agent workflows. Current rates live on the > [model page](https://reapi.ai/models/gpt-5-5) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.5", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "temperature": 0.7, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="gpt-5.5", messages=[{"role": "user", "content": "Hello"}], stream=True, temperature=0.7, top_p=1, frequency_penalty=0, presence_penalty=0, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "gpt-5.5", messages: [{ role: "user", content: "Hello" }], stream: true, temperature: 0.7, top_p: 1, frequency_penalty: 0, presence_penalty: 0, // `group` is a reAPI-specific extension; pass it via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-5.5", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "temperature": 0.7, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The GPT-5.5 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoint ```http POST https://api.reapi.ai/v1/chat/completions ``` OpenAI-compatible. The same SDKs (`openai-python`, `openai-node`, `openai-go`, …) work once the base URL is set to `https://api.reapi.ai/v1`. *** ## Request body ### `model` — string, required Must be `"gpt-5.5"`. The value is echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string or content-parts array" } ``` Multi-turn history is sent in chronological order — the last message is the one the model responds to. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. When `false`, the full response body is returned in one HTTP response. ### `temperature` — number, default `1` Range `0.0` – `2.0`. Sampling temperature. Lower values make output more deterministic; higher values increase randomness. OpenAI recommends tuning either `temperature` or `top_p`, not both. ### `top_p` — number, default `1` Range `0.0` – `1.0`. Nucleus sampling cutoff — restricts sampling to the smallest set of tokens whose cumulative probability mass exceeds `top_p`. ### `frequency_penalty` — number, default `0` Range `-2.0` – `2.0`. Penalises tokens by how often they've already appeared in the response so far. Positive values discourage literal repetition. ### `presence_penalty` — number, default `0` Range `-2.0` – `2.0`. Penalises tokens that have appeared at all, regardless of frequency. Positive values encourage the model to talk about new topics. ### `group` — string, default `"default"` reAPI-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. `"default"` is the standard pool and covers nearly every workload — you can omit the field if you don't need custom routing. ### Other OpenAI parameters Every other field on the OpenAI Chat Completions spec — `max_tokens`, `stop`, `n`, `seed`, `tools`, `tool_choice`, `response_format`, `logprobs`, `top_logprobs`, `user`, `parallel_tool_calls`, `reasoning_effort` (`none` / `low` / `medium` / `high` / `xhigh`) — passes through unchanged. The OpenAI SDKs do not need a reAPI-specific shim. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "gpt-5.5", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21 } } ``` `usage.prompt_tokens` and `usage.completion_tokens` are the inputs to the bill — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing) for the live rate card. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta: ``` data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1735000000,"model":"gpt-5.5","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"},"finish_reason":null}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1735000000,"model":"gpt-5.5","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":null}]} data: {"id":"chatcmpl-…","object":"chat.completion.chunk","created":1735000000,"model":"gpt-5.5","choices":[{"index":0,"delta":{},"finish_reason":"stop"}]} data: [DONE] ``` The final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). Usage stats are omitted from the stream — call again with `stream: false` if you need exact token counts per turn. *** ## Pricing GPT-5.5 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. The live per-1M-token rate card lives on [api.reapi.ai/pricing](https://api.reapi.ai/pricing); top up tokens at [api.reapi.ai](https://api.reapi.ai/). The bill for a single call is: ``` input_cost = prompt_tokens × input_rate / 1,000,000 output_cost = completion_tokens × output_rate / 1,000,000 ``` Failed requests are not charged. ### Long-context tier (>272K input tokens) When the input portion of a single request exceeds 272K tokens, the entire request is billed at **2× the input rate** and **1.5× the output rate**. A request with 270K input tokens stays at the standard rate; a request with 280K input tokens shifts the whole call (input *and* output) to the long-context rate. See [api.reapi.ai/pricing](https://api.reapi.ai/pricing) for the resolved per-1M-token numbers in both tiers. *** ## Limits | Limit | Value | | ------------------- | ------------- | | Context window | 1M tokens | | Max output per call | 128K tokens | | Standard-rate input | ≤ 272K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | -------------------------------------- | -------------------------------------------- | | `400` | Bad request shape, unknown field, etc. | Same shape OpenAI returns | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that's a one-for-one wire failure and a retry from your side is safe; the upstream provider may have already produced output, but the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "gpt-5.5", "messages": [ { "role": "user", "content": "Summarise the OpenAI Chat Completions spec in three sentences." } ] } ``` ### Full parameter set ```json { "model": "gpt-5.5", "group": "default", "messages": [ { "role": "system", "content": "You are a senior staff engineer." }, { "role": "user", "content": "Walk me through a 1M-token codebase review strategy." } ], "stream": true, "temperature": 0.7, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0 } ``` ### Tool use (function calling) ```json { "model": "gpt-5.5", "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Reasoning effort ```json { "model": "gpt-5.5", "reasoning_effort": "high", "messages": [ { "role": "user", "content": "Prove that the sum of the first n odd numbers is n^2." } ] } ``` `reasoning_effort` accepts `none` / `low` / `medium` / `high` / `xhigh` — pick the lowest level that still produces correct output for the workload to keep latency and token spend down. *** ## Tips * **Stream by default for chat UX.** Streaming responses cut perceived latency dramatically and let your UI render tokens as they're produced. * **Watch the long-context boundary.** Splitting a 300K-token prompt into a 270K turn and a follow-up keeps you on the standard rate rather than paying the 2× / 1.5× long-context premium. * **Tune `temperature` *or* `top_p`, not both.** Mixing them tends to produce results that are hard to reason about. * **`reasoning_effort: high` is the right default for agents.** Reserve `xhigh` for the genuinely hard turns — it adds latency and token spend. * **Drop `frequency_penalty` and `presence_penalty` first when debugging weird output.** Non-zero values can introduce artefacts that look like model bugs. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # gpt-5.6-luna (https://reapi.ai/docs/gpt-5-6-luna) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > OpenAI's GPT-5.6 Luna — the tier optimised for cost-sensitive, high-volume workloads — exposed through api.reapi.ai as a drop-in > OpenAI-compatible Chat Completions endpoint. A **1,050,000-token** context > window, **128,000** max output tokens, six `reasoning_effort` rungs from > `none` to `max` defaulting to **`medium`**, text and image input, and > functions, web search, file search and computer use. OpenAI rates its reasoning **High** and its speed Fast. The wire > `model` id is **`gpt-5.6-luna`**. Current rates live on the > [model page](https://reapi.ai/models/gpt-5-6-luna) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). **The URL and the model id differ.** This page and the model page spell the slug `gpt-5-6-luna` because a URL cannot carry dots. The string your request body needs is `gpt-5.6-luna`. ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-luna", "messages": [ { "role": "user", "content": "Classify this ticket. Return only the category id." } ], "reasoning_effort": "none", "max_completion_tokens": 4096, "stream": true }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="gpt-5.6-luna", messages=[{"role": "user", "content": "Classify this ticket. Return only the category id."}], reasoning_effort="none", max_completion_tokens=4096, stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "gpt-5.6-luna", messages: [{ role: "user", content: "Classify this ticket. Return only the category id." }], reasoning_effort: "none", max_completion_tokens: 4096, stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-5.6-luna", "messages": []map[string]string{ {"role": "user", "content": "Classify this ticket. Return only the category id."}, }, "reasoning_effort": "none", "max_completion_tokens": 4096, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs work once you swap the base URL, the key and the model string. OpenAI states that its reasoning models "work better with the Responses API", and that "while the Chat Completions API is still supported, you'll get improved model intelligence and performance by using Responses." The GPT-5.6 release entry lists `v1/responses`, `v1/chat/completions` and `v1/batch` as this family's endpoints — so Chat Completions is a documented, supported surface, and this is a vendor preference rather than a restriction. *** ## Request body ### `model` — string, required Must be `gpt-5.6-luna` exactly. There is no alias for this tier — the bare `gpt-5.6` id routes to the frontier model instead. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Roles are `system`, `user`, `assistant` and `tool`. Text and image parts are supported — see [Image input](#image-input). ### `max_completion_tokens` — integer Upper bound on generated tokens for this response, **reasoning tokens included**. The documented maximum output is **128,000** tokens. Reasoning tokens bill as **output** tokens and occupy the context window. A budget sized only for the visible answer can truncate on a harder prompt, and it is the usual reason an invoice exceeds an estimate built from answer length. ### `reasoning_effort` — string, default `"medium"` How much the model thinks before answering. See [Reasoning effort](#reasoning-effort). ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events terminated by `data: [DONE]`. On a volume route the useful reason to stream is early cancellation: you can abandon a response that has already gone wrong instead of paying for the rest of it. ### `tools` / `tool_choice` — optional Function definitions and the selection strategy. Functions, web search, file search and computer use are all available on this family, and this generation adds programmatic tool calling. ### `response_format` — object, optional Constrains the answer's shape, including a JSON schema for machine-consumed output. ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Reasoning effort Six rungs, and unlike some families these do not collapse into one another — each is a distinct behaviour. The default is **`medium`**: OpenAI's docs state that "if you omit reasoning.effort, GPT-5.6 defaults to medium in both modes." | Effort | OpenAI's stated best-for | | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `none` | Latency-critical tasks that do not benefit from reasoning or multi-chained tool calls — voice, fast retrieval, classification | | `low` | Efficient reasoning with modest added latency: tool use, planning, search, multi-step decisions | | `medium` | **Default.** Quality and reliability where the task involves planning and judgement — agentic coding, research, spreadsheets and slides, delegated long-horizon work | | `high` | Hard reasoning, complex debugging, deep planning, high-value tasks where quality beats latency | | `xhigh` | Deep research and long asynchronous runs — security and code review, enterprise productivity. "Only use when your evals show a clear benefit" | | `max` | "Maximum reasoning for your most complex tasks. If you are currently using xhigh, evaluate if max results in stronger performance" | There is **no `minimal`** on this family. This is the tier the bottom of that ladder exists for. **Set effort explicitly** — the default is `medium`, so a request that omits the field is paying for a reasoning pass a classification route probably does not want. OpenAI also documents a **Pro reasoning mode** for GPT-5.6 (`reasoning.mode`, independent of effort), and **multi-agent orchestration** in beta. Both are features of OpenAI's Responses API, so neither is part of a Chat Completions request through this endpoint. *** ## Image input | Modality | Supported | | -------- | :-------: | | Text in | ✅ | | Image in | ✅ | | Text out | ✅ | This generation accepts images **at their original dimensions**, with `original` or `auto` image detail — no resizing step required before a screenshot or scan goes in. Output is text only. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Reasoning tokens bill as output.** The default effort is `medium`, so a request that omits the field is paying for a reasoning pass. * **Effort is the first lever**, and on this family every rung is real — a middle setting buys a middle cost. * **The tier is the second lever.** All three GPT-5.6 tiers share this context window, this output ceiling, this effort ladder and this endpoint, so moving between them changes reasoning depth and price, not capability surface. Both token rates sit **20% below OpenAI's published per-token rate**, on input and output alike. Current numbers are on the [model page](https://reapi.ai/models/gpt-5-6-luna) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. OpenAI prices cached input as a separate dimension. **reAPI does not publish a cached-input rate for this model**, so bill against the input and output rates in the pricing table. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "gpt-5.6-luna", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1204, "completion_tokens": 860, "total_tokens": 2064 } } ``` `usage.completion_tokens` includes reasoning tokens, so it is the number to reconcile a bill against. On OpenAI's own Responses API the split is reported under `output_tokens_details.reasoning_tokens`. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk` with the incremental text in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | ----------------------------------------- | ---------------------------------------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `gpt-5.6-luna` with the dots — not the hyphenated slug | | `reasoning_effort` set to `minimal` | Not a value on this family — use `none`, `low`, `medium`, `high`, `xhigh` or `max` | | `reasoning.mode` or multi-agent fields | Responses-API features; not part of a Chat Completions request | | `max_completion_tokens` above the ceiling | Lower it; the documented maximum output is 128,000 | | Truncated answer on a hard prompt | The reasoning pass consumed the allowance — raise `max_completion_tokens` | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another tier | *** ## Tips * **Set effort explicitly.** The default is `medium`; on this tier `none` or `low` is usually what you actually mean. * **Cap `max_completion_tokens` tight.** On volume work it is a cost ceiling, not just a length limit. * **Constrain the output with a schema.** A machine-parsed route turns a bad answer into a validation error you can see. * **Do not pair `none` with a long tool loop.** OpenAI ties the no-reasoning rung to routes without multi-chained tool calls; raise the effort instead. * **Use it as the first stage.** Cheap triage here, escalation to a dearer tier by model string, is the biggest cost lever on a chat workload. * **The window is the frontier tier's.** Dropping to this tier does not force you to split long inputs. *** ## Related * [GPT-5.6 Luna model page](https://reapi.ai/models/gpt-5-6-luna) — current rates * [GPT-5.6 Terra](/docs/gpt-5-6-terra) — the balanced tier above it * [GPT-5.6 Sol](/docs/gpt-5-6-sol) — the frontier tier * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # gpt-5.6-sol (https://reapi.ai/docs/gpt-5-6-sol) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > OpenAI's GPT-5.6 Sol — the frontier model for complex professional work — exposed through api.reapi.ai as a drop-in > OpenAI-compatible Chat Completions endpoint. A **1,050,000-token** context > window, **128,000** max output tokens, six `reasoning_effort` rungs from > `none` to `max` defaulting to **`medium`**, text and image input, and > functions, web search, file search and computer use. OpenAI rates its reasoning **Highest** in this family and its speed Fast. The wire > `model` id is **`gpt-5.6-sol`**. Current rates live on the > [model page](https://reapi.ai/models/gpt-5-6-sol) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). **The URL and the model id differ.** This page and the model page spell the slug `gpt-5-6-sol` because a URL cannot carry dots. The string your request body needs is `gpt-5.6-sol`. ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-sol", "messages": [ { "role": "user", "content": "Review this migration plan and identify the failure modes." } ], "reasoning_effort": "high", "max_completion_tokens": 16000, "stream": true }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="gpt-5.6-sol", messages=[{"role": "user", "content": "Review this migration plan and identify the failure modes."}], reasoning_effort="high", max_completion_tokens=16000, stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "gpt-5.6-sol", messages: [{ role: "user", content: "Review this migration plan and identify the failure modes." }], reasoning_effort: "high", max_completion_tokens: 16000, stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-5.6-sol", "messages": []map[string]string{ {"role": "user", "content": "Review this migration plan and identify the failure modes."}, }, "reasoning_effort": "high", "max_completion_tokens": 16000, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs work once you swap the base URL, the key and the model string. OpenAI states that its reasoning models "work better with the Responses API", and that "while the Chat Completions API is still supported, you'll get improved model intelligence and performance by using Responses." The GPT-5.6 release entry lists `v1/responses`, `v1/chat/completions` and `v1/batch` as this family's endpoints — so Chat Completions is a documented, supported surface, and this is a vendor preference rather than a restriction. *** ## Request body ### `model` — string, required Must be `gpt-5.6-sol` exactly. The bare `gpt-5.6` alias also routes here; sending the suffixed id pins the tier you are paying for. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Roles are `system`, `user`, `assistant` and `tool`. Text and image parts are supported — see [Image input](#image-input). ### `max_completion_tokens` — integer Upper bound on generated tokens for this response, **reasoning tokens included**. The documented maximum output is **128,000** tokens. Reasoning tokens bill as **output** tokens and occupy the context window. A budget sized only for the visible answer can truncate on a harder prompt, and it is the usual reason an invoice exceeds an estimate built from answer length. ### `reasoning_effort` — string, default `"medium"` How much the model thinks before answering. See [Reasoning effort](#reasoning-effort). ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events terminated by `data: [DONE]`. Worth enabling on this tier in particular: at high effort the model can think for a long time before the first visible token, and a non-streamed request with a large budget can reach an HTTP timeout. ### `tools` / `tool_choice` — optional Function definitions and the selection strategy. Functions, web search, file search and computer use are all available on this family, and this generation adds programmatic tool calling. ### `response_format` — object, optional Constrains the answer's shape, including a JSON schema for machine-consumed output. ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Reasoning effort Six rungs, and unlike some families these do not collapse into one another — each is a distinct behaviour. The default is **`medium`**: OpenAI's docs state that "if you omit reasoning.effort, GPT-5.6 defaults to medium in both modes." | Effort | OpenAI's stated best-for | | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `none` | Latency-critical tasks that do not benefit from reasoning or multi-chained tool calls — voice, fast retrieval, classification | | `low` | Efficient reasoning with modest added latency: tool use, planning, search, multi-step decisions | | `medium` | **Default.** Quality and reliability where the task involves planning and judgement — agentic coding, research, spreadsheets and slides, delegated long-horizon work | | `high` | Hard reasoning, complex debugging, deep planning, high-value tasks where quality beats latency | | `xhigh` | Deep research and long asynchronous runs — security and code review, enterprise productivity. "Only use when your evals show a clear benefit" | | `max` | "Maximum reasoning for your most complex tasks. If you are currently using xhigh, evaluate if max results in stronger performance" | There is **no `minimal`** on this family. This is the tier the top of that ladder exists for. Starting at `high` and evaluating `xhigh` and `max` against your own cases is the usual approach; the `medium` default will under-use what you are paying for. OpenAI also documents a **Pro reasoning mode** for GPT-5.6 (`reasoning.mode`, independent of effort), and **multi-agent orchestration** in beta. Both are features of OpenAI's Responses API, so neither is part of a Chat Completions request through this endpoint. *** ## Image input | Modality | Supported | | -------- | :-------: | | Text in | ✅ | | Image in | ✅ | | Text out | ✅ | This generation accepts images **at their original dimensions**, with `original` or `auto` image detail — no resizing step required before a screenshot or scan goes in. Output is text only. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Reasoning tokens bill as output.** The default effort is `medium`, so a request that omits the field is paying for a reasoning pass. * **Effort is the first lever**, and on this family every rung is real — a middle setting buys a middle cost. * **The tier is the second lever.** All three GPT-5.6 tiers share this context window, this output ceiling, this effort ladder and this endpoint, so moving between them changes reasoning depth and price, not capability surface. Both token rates sit **20% below OpenAI's published per-token rate**, on input and output alike. Current numbers are on the [model page](https://reapi.ai/models/gpt-5-6-sol) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. OpenAI prices cached input as a separate dimension. **reAPI does not publish a cached-input rate for this model**, so bill against the input and output rates in the pricing table. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "gpt-5.6-sol", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1204, "completion_tokens": 860, "total_tokens": 2064 } } ``` `usage.completion_tokens` includes reasoning tokens, so it is the number to reconcile a bill against. On OpenAI's own Responses API the split is reported under `output_tokens_details.reasoning_tokens`. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk` with the incremental text in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | ----------------------------------------- | ---------------------------------------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `gpt-5.6-sol` with the dots — not the hyphenated slug | | `reasoning_effort` set to `minimal` | Not a value on this family — use `none`, `low`, `medium`, `high`, `xhigh` or `max` | | `reasoning.mode` or multi-agent fields | Responses-API features; not part of a Chat Completions request | | `max_completion_tokens` above the ceiling | Lower it; the documented maximum output is 128,000 | | Truncated answer on a hard prompt | The reasoning pass consumed the allowance — raise `max_completion_tokens` | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another tier | *** ## Tips * **Start at `high`, not the default.** The default is `medium`; if a route is on this tier it is usually because it needs more than that. * **Evaluate `max` only against `xhigh`.** OpenAI's own framing is to compare the two rather than jump straight to the top. * **Stream, and set a generous `max_completion_tokens`** so a deep pass has room to finish. * **Send the suffixed id in production.** `gpt-5.6` works, but it follows whatever OpenAI points the alias at later. * **Keep the routine turns on a cheaper tier.** Same key, same endpoint, one model string apart — escalation is a field, not an integration. * **Give it the whole system.** A 1.05M-token window is only useful if you actually put the repository, the tests and the history in it. *** ## Related * [GPT-5.6 Sol model page](https://reapi.ai/models/gpt-5-6-sol) — current rates * [GPT-5.6 Terra](/docs/gpt-5-6-terra) — the balanced tier below it * [GPT-5.6 Luna](/docs/gpt-5-6-luna) — the volume tier * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # gpt-5.6-terra (https://reapi.ai/docs/gpt-5-6-terra) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > OpenAI's GPT-5.6 Terra — the tier that balances intelligence and cost — exposed through api.reapi.ai as a drop-in > OpenAI-compatible Chat Completions endpoint. A **1,050,000-token** context > window, **128,000** max output tokens, six `reasoning_effort` rungs from > `none` to `max` defaulting to **`medium`**, text and image input, and > functions, web search, file search and computer use. OpenAI rates its reasoning **Higher** and its speed Fast. The wire > `model` id is **`gpt-5.6-terra`**. Current rates live on the > [model page](https://reapi.ai/models/gpt-5-6-terra) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). **The URL and the model id differ.** This page and the model page spell the slug `gpt-5-6-terra` because a URL cannot carry dots. The string your request body needs is `gpt-5.6-terra`. ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-5.6-terra", "messages": [ { "role": "user", "content": "Implement the change in the linked issue, with tests." } ], "reasoning_effort": "medium", "max_completion_tokens": 8192, "stream": true }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="gpt-5.6-terra", messages=[{"role": "user", "content": "Implement the change in the linked issue, with tests."}], reasoning_effort="medium", max_completion_tokens=8192, stream=True, ) for chunk in stream: delta = chunk.choices[0].delta.content if delta: print(delta, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "gpt-5.6-terra", messages: [{ role: "user", content: "Implement the change in the linked issue, with tests." }], reasoning_effort: "medium", max_completion_tokens: 8192, stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-5.6-terra", "messages": []map[string]string{ {"role": "user", "content": "Implement the change in the linked issue, with tests."}, }, "reasoning_effort": "medium", "max_completion_tokens": 8192, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs work once you swap the base URL, the key and the model string. OpenAI states that its reasoning models "work better with the Responses API", and that "while the Chat Completions API is still supported, you'll get improved model intelligence and performance by using Responses." The GPT-5.6 release entry lists `v1/responses`, `v1/chat/completions` and `v1/batch` as this family's endpoints — so Chat Completions is a documented, supported surface, and this is a vendor preference rather than a restriction. *** ## Request body ### `model` — string, required Must be `gpt-5.6-terra` exactly. There is no alias for this tier — the bare `gpt-5.6` id routes to the frontier model instead. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Roles are `system`, `user`, `assistant` and `tool`. Text and image parts are supported — see [Image input](#image-input). ### `max_completion_tokens` — integer Upper bound on generated tokens for this response, **reasoning tokens included**. The documented maximum output is **128,000** tokens. Reasoning tokens bill as **output** tokens and occupy the context window. A budget sized only for the visible answer can truncate on a harder prompt, and it is the usual reason an invoice exceeds an estimate built from answer length. ### `reasoning_effort` — string, default `"medium"` How much the model thinks before answering. See [Reasoning effort](#reasoning-effort). ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events terminated by `data: [DONE]`. At the default effort the model thinks before it answers, so streaming is what keeps an interactive surface from looking stalled. ### `tools` / `tool_choice` — optional Function definitions and the selection strategy. Functions, web search, file search and computer use are all available on this family, and this generation adds programmatic tool calling. ### `response_format` — object, optional Constrains the answer's shape, including a JSON schema for machine-consumed output. ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Reasoning effort Six rungs, and unlike some families these do not collapse into one another — each is a distinct behaviour. The default is **`medium`**: OpenAI's docs state that "if you omit reasoning.effort, GPT-5.6 defaults to medium in both modes." | Effort | OpenAI's stated best-for | | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `none` | Latency-critical tasks that do not benefit from reasoning or multi-chained tool calls — voice, fast retrieval, classification | | `low` | Efficient reasoning with modest added latency: tool use, planning, search, multi-step decisions | | `medium` | **Default.** Quality and reliability where the task involves planning and judgement — agentic coding, research, spreadsheets and slides, delegated long-horizon work | | `high` | Hard reasoning, complex debugging, deep planning, high-value tasks where quality beats latency | | `xhigh` | Deep research and long asynchronous runs — security and code review, enterprise productivity. "Only use when your evals show a clear benefit" | | `max` | "Maximum reasoning for your most complex tasks. If you are currently using xhigh, evaluate if max results in stronger performance" | There is **no `minimal`** on this family. This tier is where the default is genuinely the right starting point. Sweep `low` for speed on planning-shaped work and `high` when a route needs complex debugging; if your evals keep choosing `xhigh` or `max`, that route belongs on the frontier tier instead. OpenAI also documents a **Pro reasoning mode** for GPT-5.6 (`reasoning.mode`, independent of effort), and **multi-agent orchestration** in beta. Both are features of OpenAI's Responses API, so neither is part of a Chat Completions request through this endpoint. *** ## Image input | Modality | Supported | | -------- | :-------: | | Text in | ✅ | | Image in | ✅ | | Text out | ✅ | This generation accepts images **at their original dimensions**, with `original` or `auto` image detail — no resizing step required before a screenshot or scan goes in. Output is text only. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Reasoning tokens bill as output.** The default effort is `medium`, so a request that omits the field is paying for a reasoning pass. * **Effort is the first lever**, and on this family every rung is real — a middle setting buys a middle cost. * **The tier is the second lever.** All three GPT-5.6 tiers share this context window, this output ceiling, this effort ladder and this endpoint, so moving between them changes reasoning depth and price, not capability surface. Both token rates sit **20% below OpenAI's published per-token rate**, on input and output alike. Current numbers are on the [model page](https://reapi.ai/models/gpt-5-6-terra) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. OpenAI prices cached input as a separate dimension. **reAPI does not publish a cached-input rate for this model**, so bill against the input and output rates in the pricing table. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "gpt-5.6-terra", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1204, "completion_tokens": 860, "total_tokens": 2064 } } ``` `usage.completion_tokens` includes reasoning tokens, so it is the number to reconcile a bill against. On OpenAI's own Responses API the split is reported under `output_tokens_details.reasoning_tokens`. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk` with the incremental text in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | ----------------------------------------- | ---------------------------------------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `gpt-5.6-terra` with the dots — not the hyphenated slug | | `reasoning_effort` set to `minimal` | Not a value on this family — use `none`, `low`, `medium`, `high`, `xhigh` or `max` | | `reasoning.mode` or multi-agent fields | Responses-API features; not part of a Chat Completions request | | `max_completion_tokens` above the ceiling | Lower it; the documented maximum output is 128,000 | | Truncated answer on a hard prompt | The reasoning pass consumed the allowance — raise `max_completion_tokens` | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another tier | *** ## Tips * **Leave the default alone first.** `medium` is what OpenAI calls the well-balanced point, and this tier is priced for it. * **Then sweep in both directions** on a real route — `low` for speed, `high` for hard debugging — and keep whichever your evals prefer. * **Escalate on evidence, not instinct.** A route that always wants `xhigh` or `max` is telling you it belongs one tier up. * **Use a JSON schema for agent steps** whose output another step consumes. * **Budget for the reasoning pass** in `max_completion_tokens`, not just the answer. * **The window is the frontier tier's.** Choosing this tier does not shrink what the model can see. *** ## Related * [GPT-5.6 Terra model page](https://reapi.ai/models/gpt-5-6-terra) — current rates * [GPT-5.6 Sol](/docs/gpt-5-6-sol) — the frontier tier above it * [GPT-5.6 Luna](/docs/gpt-5-6-luna) — the volume tier below it * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # gpt-image-2-official (https://reapi.ai/docs/gpt-image-2-stable) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > The **stable channel** of GPT Image 2 on reAPI — async > `/api/v1/images/generations` with the full feature surface: quality tiers > (`auto` / `low` / `medium` / `high`), batches up to 4 images, and > mask-based inpainting. The channel always > returns PNG. See current pricing on the > [model page](https://reapi.ai/models/gpt-image-2). **Wire id is `gpt-image-2-official`.** The doc / pricing page / playground all label this variant as **"Stable"** for clarity, but the request body must set `"model": "gpt-image-2-official"`. The shorter `gpt-image-2` is a separate variant — see [Differences from `gpt-image-2`](#differences-from-gpt-image-2). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2-official", "prompt": "ancient castle beneath a starry sky", "size": "16:9", "resolution": "2k", "quality": "high", "n": 1 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "gpt-image-2-official", "prompt": "ancient castle beneath a starry sky", "size": "16:9", "resolution": "2k", "quality": "high", "n": 1, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gpt-image-2-official", prompt: "ancient castle beneath a starry sky", size: "16:9", resolution: "2k", quality: "high", n: 1, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-image-2-official", "prompt": "ancient castle beneath a starry sky", "size": "16:9", "resolution": "2k", "quality": "high", "n": 1, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2-official", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URLs (length = `n`), valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required `string`. Must be `"gpt-image-2-official"`. ### `prompt` — required `string`, **1–32,000 characters**. English and Chinese both supported. Detailed prompts produce better results. Every prompt goes through pre-submission moderation; rejected prompts return `400` at no charge. Don't restate the ratio in the prompt — pass it via `size`. Repeating it confuses the upstream. **Failure modes.** * Missing / empty → `400 prompt is required` (code `20002`). * Longer than 32,000 chars → `400 prompt must be at most 32000 characters` (code `20007`). ### `size` — string, default `"1:1"` Output ratio. One of these 14 values (or `auto` to let the upstream pick from the prompt / first reference image): ``` auto 1:1 16:9 9:16 4:3 3:4 3:2 2:3 5:4 4:5 2:1 1:2 21:9 9:21 ``` This channel additionally accepts a pixel string `WIDTHxHEIGHT` (e.g. `1024x1024`, `3840x2160`); the upstream snaps it to the closest supported dimension. Anything outside the list and not a pixel string is rejected with `400`. When `size` is omitted: * **T2I** (no `image_urls`) → defaults to `"1:1"`. * **I2I** (`image_urls` set) → output mirrors the first reference image's ratio (upstream-side derivation; gateway omits the field). #### 4K constraint `resolution: "4k"` is only valid with the six widescreen sizes below. Other ratios — including `auto` — exceed the model's total-pixel cap and are rejected with `400`. **`size` is required** when `resolution: "4k"`; sending 4K with no `size` is rejected before the request leaves the gateway. | `size` | `1k` | `2k` | `4k` | | --------------- | ------------ | ------------ | ------------- | | `1:1` | 1024×1024 | 2048×2048 | ❌ | | `3:2` / `2:3` | 1536×1024 | 2048×1360 | ❌ | | `4:3` / `3:4` | 1024×768 | 2048×1536 | ❌ | | `5:4` / `4:5` | 1280×1024 | 2560×2048 | ❌ | | `16:9` / `9:16` | 1536×864 | 2048×1152 | **3840×2160** | | `2:1` / `1:2` | 2048×1024 | 2688×1344 | **3840×1920** | | `21:9` / `9:21` | 2016×864 | 2688×1152 | **3840×1648** | | `auto` | server picks | server picks | ❌ | > `3:2` / `2:3` at 2K resolves to 2048×1360 — 1360 is the nearest > 16-aligned approximation of 3:2 (under 0.5% off). Other cells are > exact. **4K is widescreen-only.** `resolution: "4k"` requires `size` to be one of `16:9`, `9:16`, `2:1`, `1:2`, `21:9`, or `9:21`. Sending 4K with `auto`, a non-widescreen ratio, or no size returns `400 4K requires an explicit size in {16:9, 9:16, 2:1, 1:2, 21:9, 9:21}` (code `20003`). See the 4K table under `size` above for the full grid. ### `resolution` — string, default `"1k"` `1k` / `2k` / `4k`. Case-insensitive — `"2K"` and `"2k"` are equivalent. Drives pricing. ### `quality` — string, default `"auto"` `auto` / `low` / `medium` / `high`. Higher tiers are slower and price separately. **`auto` bills at the `high` rate.** The upstream does not honor a lower-tier hint when `auto` is set — the request runs at `high` internally. reAPI mirrors that on billing: `auto` (and any request that omits `quality`) is charged at the `high` rate. To pay the `low` or `medium` rate, set `quality` explicitly. ### `n` — integer, default `1` Number of images per request. Range `1`–`10`. Each generated image is billed individually — a 4-image batch costs **4×** the per-image rate. `output.image_urls` length matches `n`. ### `image_urls` — string\[] Reference images for image-to-image. Up to **16** entries. Triggers I2I when set. Public HTTP(S) URLs only. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide. Upload to your own object storage (S3 / R2 / OSS) and pass the URL. ### `mask_url` — string PNG mask URL for inpainting. **Requires `image_urls` with at least one entry.** The mask must: * carry an alpha channel where the model should paint, and * share dimensions with the **first** entry in `image_urls`. Public HTTP(S) URL only. Mismatched dimensions or a fully opaque mask return `400` from upstream. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2-official", "status": "completed", "created_at": 1735000000, "output": { "image_urls": [ "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png", "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/1.png" ] }, "error": null } ``` | Field | Type | Notes | | ------------------- | -------------- | ----------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion | | `output.image_urls` | string\[] | Generated image URLs — length = `n`, valid for 7 days | | `error` | object \| null | Populated on `failed` — `{ code, message }` | ### Upstream errors (502 / 503) reAPI does not surface raw upstream `5xx` codes to the caller. When the upstream provider returns `502 Bad Gateway`, `503 Service Unavailable`, or a connection failure, the worker retries up to 5 attempts with exponential backoff (\~30s total budget). If all retries fail, the task ends with one of these reAPI-specific codes (returned via `GET /api/v1/tasks/{id}` as `error.code`): | reAPI code | Meaning | Origin | | ---------- | -------------------------- | ------------------------------------ | | `80001` | `provider_submit_failed` | Upstream `5xx` / network on submit | | `80002` | `provider_polling_timeout` | Wall-clock cap reached while polling | | `80003` | `provider_failed` | Upstream returned a terminal failure | See [Errors catalog](/docs/api/errors) for the full code list. *** ## Validation errors All cases below return HTTP 400 with the noted code. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values) and are not a stable contract. | Trigger | Code | Message | | --------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------ | | `prompt` missing / empty | `20002` | `prompt is required` | | `prompt` longer than 32,000 chars | `20007` | `prompt must be at most 32000 characters` | | Unknown `size` value | `20003` | `invalid size "..." (allowed: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 2:1, 1:2, 21:9, 9:21, auto, or WxH pixels)` | | Unknown `resolution` value | `20003` | `invalid resolution "..." (allowed: 1k, 2k, 4k)` | | `4k` with non-widescreen / `auto` / no `size` | `20003` | `4K requires an explicit size in {16:9, 9:16, 2:1, 1:2, 21:9, 9:21}` | | `n` outside `1`–`10` | `20003` | `n must be between 1 and 10` | | `image_urls` > 16 | `20003` | `image_urls accepts at most 16 entries` | | `mask_url` without `image_urls` | `20003` | `mask_url requires at least one entry in image_urls` | | Any URL field carrying a `data:` URI | `20003` | `image URL must be a public http(s) URL — data: URIs are rejected` (or `mask_url must be a public URL …`) | | Unknown `quality` | `20003` | `invalid "..." (allowed: …)` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation. *** ## Recipes ### Text-to-image — minimal ```json { "model": "gpt-image-2-official", "prompt": "ancient castle beneath a starry sky" } ``` ### 2K poster ```json { "model": "gpt-image-2-official", "prompt": "cyberpunk night cityscape", "size": "16:9", "resolution": "2k", "quality": "high" } ``` ### 4K wallpaper ```json { "model": "gpt-image-2-official", "prompt": "panoramic snow-capped mountains at sunrise", "size": "16:9", "resolution": "4k", "quality": "high" } ``` ### Multi-reference fusion (image-to-image) ```json { "model": "gpt-image-2-official", "prompt": "blend the two references into one cohesive illustrated poster", "size": "1:1", "quality": "high", "image_urls": [ "https://your-cdn.com/input-a.png", "https://your-cdn.com/input-b.png" ] } ``` ### Mask-based inpainting The mask must match the dimensions of the first `image_urls` entry and carry an alpha channel where the model should paint. ```json { "model": "gpt-image-2-official", "prompt": "replace the background with a desert sunset", "size": "1:1", "quality": "medium", "image_urls": ["https://your-cdn.com/photo.png"], "mask_url": "https://your-cdn.com/mask.png" } ``` ### Batch of 4 variations ```json { "model": "gpt-image-2-official", "prompt": "four minimalist poster variations of a red fox", "size": "1:1", "quality": "low", "n": 4 } ``` *** ## Polling pattern Latency depends heavily on `quality` and `resolution`: | `quality` × `resolution` | Typical end-to-end | | ------------------------ | ------------------ | | `low` × `1k` | 20 – 40 s | | `medium` × `1k` | 30 – 60 s | | `high` × `2k` | 60 – 120 s | | `high` × `4k` | 120 – 180 s | Recommended cadence: ``` 0–30s: wait before the first poll 30s–3m: poll every 3–5s 3m+: back off to 10s; cap at 30s ``` Set client-side request timeouts to **≥ 180 seconds** when using `quality: "high"` with `2k` / `4k`. The worker's wall-clock cap is **1 hour** (image tasks), comfortably above any realistic queue. *** ## Pricing Per-image rates depend on three axes: * **Resolution** (`1k` / `2k` / `4k`) * **Quality** (`low` / `medium` / `high` — `auto` bills at `high`) * **`size`** (the `2k` / `4k` cells charge slightly more for the widest ratios; live numbers on the [model page](https://reapi.ai/models/gpt-image-2#pricing) are authoritative) When `size` is `"auto"`, reAPI prices against the **most expensive ratio** at the resolved `(resolution, quality)` cell so the bill never undershoots once the upstream picks a ratio at runtime. The forwarded body keeps `auto` — the override is billing-only. **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_image_usd × n × 1000) ``` Charged on submit; refunded automatically on `failed` / `provider_submit_failed` / `provider_polling_timeout`. Moderated prompts return `400` before charging — no balance impact. **Worked example.** `n: 2`, `resolution: "2k"`, `quality: "high"`, `size: "16:9"` charges **2× the 16:9\@2k\_high cell**. Rates evolve; check the [model page](https://reapi.ai/models/gpt-image-2#pricing) for live numbers. *** ## Tips * **Specify ratio in `size`, not in the prompt.** Repeating "16:9 wide shot" inside the prompt confuses the upstream. Use `size` for shape and the prompt for content / style. * **Set `quality` explicitly to save money.** `auto` runs at `high` — if `medium` is good enough, send `"medium"` and pay the medium rate. * **Batches are linear cost.** `n: 4` is exactly 4× the price of `n: 1` at the same parameters — no batch discount, but no batch surcharge either. * **Mask alpha matters.** The mask's transparent regions are where the model paints; opaque regions are preserved. A fully opaque mask returns `400` from upstream. * **Pre-cache reference images.** The upstream fetches each `image_urls` entry once per submit; if your CDN is slow, latency shows up as polling time, not as billing. *** ## Differences from `gpt-image-2` | Feature | [`gpt-image-2`](/docs/gpt-image-2) | `gpt-image-2-official` (this page) | | ------------------------------------- | :--------------------------------: | :--------------------------------------------------------------------------------------------: | | Endpoint | `/api/v1/images/generations` | `/api/v1/images/generations` | | Async / task model | ✅ | ✅ | | `size` enum (14) | ✅ | ✅ | | Resolution tiers (`1k` / `2k` / `4k`) | ✅ | ✅ | | Image-to-image (`image_urls`) | ✅ | ✅ | | Pricing | flat per resolution | varies by resolution × quality × ratio — see [model page](https://reapi.ai/models/gpt-image-2) | | Batch (`n` > 1) | ❌ | ✅ up to 10 | | Quality tiers | ❌ | ✅ `auto` / `low` / `medium` / `high` | | Mask inpainting (`mask_url`) | ❌ | ✅ | | Background control | ❌ | ✅ (`transparent` silently downgraded) | | Moderation knob | ❌ (default) | ✅ `auto` / `low` | *** ## Related * [`gpt-image-2`](/docs/gpt-image-2) — cheaper variant, single image, flat per-resolution pricing * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Pricing — gpt-image-2](https://reapi.ai/models/gpt-image-2#pricing) --- # gpt-image-2 (https://reapi.ai/docs/gpt-image-2) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Async image generation through reAPI's cheap channel. One endpoint > covers text-to-image and image-to-image. Flat per-resolution > pricing — the cheapest variant in the family. For batches, masks, > or quality tiers, switch to > [`gpt-image-2 stable`](/docs/gpt-image-2-stable). * Async processing — `POST` returns a `task_id`, poll `GET /api/v1/tasks/{id}` for the result. * standard `/api/v1/images/generations` envelope (text-to-image / image-to-image). * 14 ratios via `size`; three resolution tiers (`1k` / `2k` / `4k`) via `resolution`. * Up to 16 reference images via `image_urls` — public HTTP(S) URLs only. * Single image per request — `n` is fixed at 1. * Flat per-resolution price; failed / moderated requests are not charged. *** ## Try it *** ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "a ginger cat on a windowsill at sunset, watercolor", "size": "16:9", "resolution": "2k" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "gpt-image-2", "prompt": "a ginger cat on a windowsill at sunset, watercolor", "size": "16:9", "resolution": "2k", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "gpt-image-2", prompt: "a ginger cat on a windowsill at sunset, watercolor", size: "16:9", resolution: "2k", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "gpt-image-2", "prompt": "a ginger cat on a windowsill at sunset, watercolor", "size": "16:9", "resolution": "2k", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2", "status": "processing", "created_at": 1735000000 } ``` Hold onto `id` and poll `GET /api/v1/tasks/{id}` until completion. *** ## Endpoint ```http POST /api/v1/images/generations # submit a job GET /api/v1/tasks/{id} # poll for the result ``` Async — submit returns a `task_id` immediately; the actual image arrives via the polling endpoint. Polling is free. *** ## Authentication Bearer token, minted at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer rk_live_xxx ``` *** ## Body ### `model` `string` · **required** · default `"gpt-image-2"` Must be `"gpt-image-2"`. ### `prompt` `string` · **required** 1 – 32000 characters. English and Chinese both supported. Detailed prompts produce better results. Every prompt goes through pre-submission moderation; rejected prompts return `400` at no charge. Don't restate the ratio in the prompt — pass it via `size`. Repeating it in the prompt confuses the upstream. ### `size` `string` · default `"1:1"` (text-to-image) / inherited (image-to-image) Output ratio. One of these 14 values: ``` auto 1:1 16:9 9:16 4:3 3:4 3:2 2:3 5:4 4:5 2:1 1:2 21:9 9:21 ``` `auto` lets the upstream pick from the prompt or first reference image. Pixel strings (e.g. `1024x1024`) are not accepted — combine `size` with `resolution` to control output pixels. Anything outside the list is rejected with `400`. When `image_urls` is provided **without** `size`, the output inherits the first reference image's resolution (image-to-image mode). Pass `size` to force a specific ratio. ### `resolution` `string` · default `"1k"` `1k` / `2k` / `4k`. Case-insensitive — `"2K"` and `"2k"` are equivalent. `4k` is only valid with the six widescreen sizes below. Other sizes — including `auto` — exceed the model's total-pixel cap and are rejected with `400`. | `size` | `1k` | `2k` | `4k` | | --------------- | ------------ | ------------ | ------------- | | `1:1` | 1024×1024 | 2048×2048 | ❌ | | `3:2` / `2:3` | 1536×1024 | 2048×1360 | ❌ | | `4:3` / `3:4` | 1024×768 | 2048×1536 | ❌ | | `5:4` / `4:5` | 1280×1024 | 2560×2048 | ❌ | | `16:9` / `9:16` | 1536×864 | 2048×1152 | **3840×2160** | | `2:1` / `1:2` | 2048×1024 | 2688×1344 | **3840×1920** | | `21:9` / `9:21` | 2016×864 | 2688×1152 | **3840×1648** | | `auto` | server picks | server picks | ❌ | ### `n` `integer` · default `1` · **must be `1`** Single image per request. This variant produces one image per call; sending any other value returns `400`. For batches up to 4, use [`gpt-image-2 stable`](/docs/gpt-image-2-stable). ### `image_urls` `string[]` · optional Reference images for image-to-image. Up to **16** entries. Each entry must be a public HTTP(S) URL — `data:` / base64 payloads are rejected. Upload to your own object storage (S3 / R2 / OSS) and pass the URL. **No batch / quality / mask on this variant.** Sending `n > 1`, `quality`, `mask_url`, `output_format`, or `output_compression` against `gpt-image-2` returns `400`. Switch to [`gpt-image-2 stable`](/docs/gpt-image-2-stable) — set `"model": "gpt-image-2-official"` — when you need those features. *** ## Use cases ### 1. Text-to-image (minimal) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gpt-image-2", "prompt": "a ginger cat on a windowsill at sunset, watercolor" }' ``` ### 2. Text-to-image at 2K widescreen ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gpt-image-2", "prompt": "a corgi astronaut on the moon, cinematic", "size": "16:9", "resolution": "2k" }' ``` ### 3. Text-to-image at 4K ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gpt-image-2", "prompt": "ancient castle beneath a starry sky", "size": "16:9", "resolution": "4k" }' ``` ### 4. Image-to-image (single reference) ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gpt-image-2", "prompt": "turn this photo into a watercolor painting", "image_urls": ["https://your-cdn.com/photo.jpg"] }' ``` ### 5. Multi-reference fusion ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gpt-image-2", "prompt": "blend these two photos into a poster", "size": "4:3", "resolution": "2k", "image_urls": [ "https://your-cdn.com/photo-a.jpg", "https://your-cdn.com/photo-b.jpg" ] }' ``` ### 6. Force a ratio for image-to-image When the reference is portrait but you need a landscape output: ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -d '{ "model": "gpt-image-2", "prompt": "extend the scene horizontally into a moonlit forest", "size": "21:9", "resolution": "2k", "image_urls": ["https://your-cdn.com/portrait.jpg"] }' ``` *** ## Response `POST` returns immediately with `status: "processing"`; poll `GET /api/v1/tasks/{id}` until `status` is `completed` or `failed`. Both responses share the same envelope — the `output` field is `null` until the task finishes. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2", "status": "processing", "created_at": 1735000000 } ``` ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2", "status": "completed", "created_at": 1735000000, "output": { "image_urls": [ "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png" ] }, "error": null } ``` URLs are stable for **7 days**. Download to your own storage if you need them longer. ```json { "error": { "code": 20003, "message": "gpt-image-2: field 'quality' is only supported on gpt-image-2-official", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 10003, "message": "API key invalid", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 30001, "message": "Insufficient credits", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 50001, "message": "Rate limit exceeded", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ```json { "error": { "code": 60099, "message": "Internal error — please retry", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` ### Upstream errors (502 / 503) reAPI does not surface raw upstream `5xx` codes to the caller. When the upstream provider returns `502 Bad Gateway`, `503 Service Unavailable`, or a connection failure, the worker retries up to 5 attempts with exponential backoff (\~30s total budget). If all retries fail, the task ends with one of these reapi-specific error codes (returned via `GET /api/v1/tasks/{id}` as `error.code`): | reapi code | Meaning | Origin | | ---------- | -------------------------- | ------------------------------------ | | `80001` | `provider_submit_failed` | Upstream `5xx` / network on submit | | `80002` | `provider_polling_timeout` | Wall-clock cap reached while polling | | `80003` | `provider_failed` | Upstream returned a terminal failure | See [Errors catalog](/docs/api/errors) for the full code list. *** ## Polling | `status` | Meaning | | ------------ | -------------------------------- | | `processing` | Submitted, still generating | | `completed` | `output.image_urls` is ready | | `failed` | See `error.message`; not charged | Recommended cadence: ``` 0–30s: wait before the first poll 30s–3m: poll every 3–5s 3m+: back off to 10s; cap at 30s ``` A 1K image typically completes in 30–60s; 2K adds \~30s; 4K can take 90–120s. *** ## Differences from the stable channel | Feature | `gpt-image-2` (this page) | [`gpt-image-2 stable`](/docs/gpt-image-2-stable) | | ------------------------------- | :--------------------------: | :--------------------------------------------------------------------------: | | Endpoint | `/api/v1/images/generations` | `/api/v1/images/generations` | | `size` enum (14) | ✅ | ✅ | | Resolution tiers (1k / 2k / 4k) | ✅ | ✅ | | Image-to-image (`image_urls`) | ✅ | ✅ | | Pricing | flat per resolution | varies by parameters — see [model page](https://reapi.ai/models/gpt-image-2) | | Batch (`n` > 1) | ❌ | ✅ up to 4 | | Quality tiers | ❌ | ✅ `auto` / `low` / `medium` / `high` | | Mask inpainting (`mask_url`) | ❌ | ✅ | | Background control | ❌ | ✅ (`transparent` is silently downgraded by upstream) | | Output format / compression | ❌ (always PNG) | ✅ `png` / `jpeg` / `webp` + compression | | Moderation knob | ❌ (default) | ✅ `auto` / `low` | *** ## Related * [`gpt-image-2 stable`](/docs/gpt-image-2-stable) — full feature surface (batch, mask, quality tiers). * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Pricing — gpt-image-2](https://reapi.ai/models/gpt-image-2#pricing) --- # grok-imagine-1.0-video (https://reapi.ai/docs/grok-imagine-1-0-video) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Grok Imagine 1.0 Video — async video generation. **One model id** > (`grok-imagine-1.0-video`) covers both **text-to-video** and > **image-to-video**. Mode is implicit: zero `image_urls` runs T2V; 1 to 7 > reference images run I2V. 6 to 30 second outputs at 480p / 720p, five > aspect ratios. See current pricing on the > [model page](https://reapi.ai/models/grok-imagine-1-0-video). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-imagine-1.0-video", "prompt": "A dog running on a sunlit beach, slow-motion", "size": "16:9", "duration": 6, "quality": "720p" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "grok-imagine-1.0-video", "prompt": "A dog running on a sunlit beach, slow-motion", "size": "16:9", "duration": 6, "quality": "720p", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "grok-imagine-1.0-video", prompt: "A dog running on a sunlit beach, slow-motion", size: "16:9", duration: 6, quality: "720p", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "grok-imagine-1.0-video", "prompt": "A dog running on a sunlit beach, slow-motion", "size": "16:9", "duration": 6, "quality": "720p", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "grok-imagine-1.0-video", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL, valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Mode routing `grok-imagine-1.0-video` picks its mode from the **count of `image_urls`** you send — there is no `mode` parameter: | `image_urls` count | Mode | What it does | | ------------------ | ------- | ---------------------------------------------------------------- | | `0` (or omitted) | **T2V** | Generate from text. `size` controls output ratio. | | `1` – `7` | **I2V** | Use the references as visual guidance. Output ratio follows ref. | **Mutex rules.** * In T2V (no `image_urls`), `prompt` is **required**. * When `image_urls` is set (1 to 7 entries), `size` is forwarded but ignored upstream — the source frame's ratio decides the output ratio. * More than 7 `image_urls` is rejected with `400 image_urls accepts at most 7 entries`. *** ## Request body ### `model` — required `string`. Must be `"grok-imagine-1.0-video"`. ### `prompt` — string, conditional Up to **4,000 characters**. Required in T2V (when `image_urls` is empty); optional in I2V when at least one image is provided. Empty / whitespace-only prompts are treated as missing. **Failure modes.** * Empty / missing in T2V → `400 prompt is required when image_urls is empty (text-to-video)` (code `20002`). * Longer than 4,000 chars → `400 prompt exceeds 4000 characters (got N)` (code `20007`). ### `size` — string, default `"16:9"` Output aspect ratio in T2V mode. One of: | Value | Shape | | ------ | ------------------- | | `16:9` | Landscape (default) | | `9:16` | Portrait | | `1:1` | Square | | `3:2` | Landscape | | `2:3` | Portrait | In I2V mode the upstream derives the ratio from the reference image, so this field is ignored. ### `duration` — integer, default `6` Output length in seconds. Any integer in `[6, 30]`. Out-of-range → `400`. Drives pricing linearly: `ceil(per_second_usd × duration × 1000)` credits (1 credit = $0.001). **Send a number, not a string.** `"duration": "6"` is rejected with `400`. ### `quality` — string, default `"480p"` `480p` (SD) or `720p` (HD). Lowercase is canonical. Quality does **not** change the per-second rate. ### `image_urls` — string\[] Array of public HTTP(S) URLs. **0 to 7 entries**: * **0 entries** — pure text-to-video. * **1 to 7 entries** — image-to-video; references guide subject and style. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field on this endpoint must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "grok-imagine-1.0-video", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | `output.video_urls` URLs are valid for **7 days**. Re-host to your own storage if you need them longer. *** ## Validation errors All cases below return HTTP 400 with code `20003` unless noted. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values, etc.) and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------------------- | ------- | --------------------------------------------------------------------------- | | `prompt` missing in T2V | `20002` | `grok-imagine: prompt is required when image_urls is empty (text-to-video)` | | `prompt` longer than 4,000 chars | `20007` | `grok-imagine: prompt exceeds 4000 characters (got N)` | | `image_urls` length > 7 | `20003` | `grok-imagine: image_urls accepts at most 7 entries, got N` | | `duration` outside `[6, 30]` | `20003` | `grok-imagine: duration must be 6-30 seconds, got N` | | Unknown `size` | `20003` | `grok-imagine: invalid size "X" (allowed: 16:9 / 9:16 / 1:1 / 3:2 / 2:3)` | | Unknown `quality` | `20003` | `grok-imagine: invalid quality "X" (allowed: 480p / 720p)` | | `image_urls` carrying a `data:` URI or non-http(s) | `20003` | `grok-imagine: image_urls entries must be public http(s) URLs` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### T2V — minimum request ```json { "model": "grok-imagine-1.0-video", "prompt": "A little girl walking down a sunset coastal road" } ``` ### T2V — full parameters ```json { "model": "grok-imagine-1.0-video", "prompt": "A dog running on a sunlit beach, slow-motion, cinematic warm tones", "size": "16:9", "duration": 10, "quality": "720p" } ``` ### I2V — animate from references ```json { "model": "grok-imagine-1.0-video", "prompt": "Bring the scene to life with a gentle camera dolly forward", "image_urls": ["https://your-cdn.com/reference.jpg"], "duration": 8, "quality": "720p" } ``` ### I2V — multi-reference ```json { "model": "grok-imagine-1.0-video", "prompt": "Smooth cinematic motion across the reference subjects", "image_urls": [ "https://your-cdn.com/ref-1.jpg", "https://your-cdn.com/ref-2.jpg", "https://your-cdn.com/ref-3.jpg" ], "duration": 12 } ``` *** ## Polling pattern The task endpoint behaves identically to other video tasks — the only difference is the completed `output` shape (`video_urls` instead of `image_urls`). A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. The worker's wall-clock cap is **48 hours**, comfortably above any realistic queue. *** ## Pricing Per-second rate. `quality` does **not** change the price, and the rate is flat across `480p` and `720p`. See current rate on the [Grok Imagine model page](https://reapi.ai/models/grok-imagine-1-0-video). **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_second_usd × duration × 1000) ``` Failed jobs refund automatically. *** ## Tips * **Prompt motion, not just scene.** "Slow push-in, warm tones, shallow depth of field" outperforms a pure noun-list of what's on screen. * **Sweet-spot duration: 6–10 seconds.** Above 10s the upstream wall-time grows fast; the per-second price stays the same either way. * **Reference-image quality matters.** Subject centered, clear composition, no heavy filters — I2V output quality tracks input quality directly. * **Send up to 7 references for richer guidance.** A first frame plus several style boards usually outperforms a single reference. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # grok-imagine-video-1.5-official (https://reapi.ai/docs/grok-imagine-video-1-5-official) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Grok Imagine Video 1.5 **Official Channel** — async **image-to-video** > with **native synchronized audio**, distinct from the > [`grok-imagine-video-1.5-beta`](/docs/grok-imagine-video-1-5) channel. > Same one-reference-image workflow at a **lower per-second rate**, with a > slightly stricter input contract: the prompt is required and clips run > 6 to 15 seconds. Model id `grok-imagine-video-1.5-official`. See current > pricing on the > [model page](https://reapi.ai/models/grok-imagine-video-1-5). **Channel differences at a glance.** Compared to the beta channel this surface requires a `prompt`, narrows `aspect_ratio` to `1:1` / `16:9` / `9:16` (no `auto`), starts at 6-second clips, adds an `audio` toggle, and has no `nsfw_checker` parameter. The two channels bill independently — each has its own per-second rate. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-imagine-video-1.5-official", "prompt": "Gentle cinematic push-in, golden-hour light, subtle motion", "image_urls": ["https://your-cdn.com/source.jpg"], "aspect_ratio": "16:9", "resolution": "720p", "duration": 8 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "grok-imagine-video-1.5-official", "prompt": "Gentle cinematic push-in, golden-hour light, subtle motion", "image_urls": ["https://your-cdn.com/source.jpg"], "aspect_ratio": "16:9", "resolution": "720p", "duration": 8, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "grok-imagine-video-1.5-official", prompt: "Gentle cinematic push-in, golden-hour light, subtle motion", image_urls: ["https://your-cdn.com/source.jpg"], aspect_ratio: "16:9", resolution: "720p", duration: 8, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "grok-imagine-video-1.5-official", "prompt": "Gentle cinematic push-in, golden-hour light, subtle motion", "image_urls": []string{"https://your-cdn.com/source.jpg"}, "aspect_ratio": "16:9", "resolution": "720p", "duration": 8, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "grok-imagine-video-1.5-official", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL (with audio), valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. This is an **image-to-video** model — exactly one reference image is required on every request. There is no text-to-video mode, no last-frame or reference image input, and no `mode` parameter. *** ## Request body ### `model` — required `string`. Must be `"grok-imagine-video-1.5-official"`. ### `prompt` — string, required Describes the motion, camera, atmosphere, and any dialogue or sound you want in the generated audio. **Required on this channel** (the beta channel accepts image-only requests; this one does not). Maximum **4000 characters**; whitespace-only prompts and prompts over 4000 characters are rejected with `400`. ### `image_urls` — string\[], required Array with **exactly one** public HTTP(S) image URL — the first frame the model animates. Accepted source formats: JPEG, PNG, WebP. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — the image URL must be a public HTTP(S) link. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. More than one entry is rejected. ### `aspect_ratio` — string, default `"16:9"` Output framing. `auto` is **not** available on this channel. Output pixel size follows the ratio × resolution matrix: | Value | 480p | 720p | | ------ | ------- | -------- | | `1:1` | 544×544 | 960×960 | | `16:9` | 736×400 | 1280×720 | | `9:16` | 400×736 | 720×1280 | ### `resolution` — string, default `"480p"` `480p` or `720p`. `720p` costs 2× per second — see Pricing. ### `duration` — integer, default `8` Output length in seconds. Any integer in `[6, 15]` — note the 6-second minimum (the beta channel starts at 1). Out-of-range → `400`. Drives pricing linearly. **Send a number, not a string.** `"duration": "8"` is rejected with `400`. ### `audio` — boolean, default `true` Whether the generated clip carries a native synchronized audio track. Set `false` for a silent video at the same per-second rate. Each request produces exactly **one** video. For multiple takes, submit concurrent requests — each bills and refunds independently. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "grok-imagine-video-1.5-official", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | `output.video_urls` URLs are valid for **7 days** — re-host to your own storage if you need them longer. *** ## Validation errors Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values) and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------------------- | ------- | ------------------------------------------------ | | `prompt` missing, empty, or whitespace-only | `20002` | `prompt is required` | | `prompt` longer than 4000 characters | `20003` | `prompt must be at most 4000 characters` | | `image_urls` missing | `20002` | `image_urls is required` | | `image_urls` with more than one entry | `20003` | `image_urls allows at most 1 entry` | | `duration` outside `[6, 15]` | `20003` | `duration must be 6-15 seconds` | | Unknown `resolution` | `20003` | `invalid resolution (allowed: 480p / 720p)` | | `aspect_ratio` outside `1:1` / `16:9` / `9:16` | `20003` | `invalid aspect_ratio` | | `image_urls` carrying a `data:` URI or non-http(s) | `20003` | `image_urls entries must be public http(s) URLs` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see the [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Minimum request ```json { "model": "grok-imagine-video-1.5-official", "prompt": "Slow push-in with ambient room tone", "image_urls": ["https://your-cdn.com/source.jpg"] } ``` ### Directed motion + HD ```json { "model": "grok-imagine-video-1.5-official", "prompt": "Slow dolly forward, wind moving the hair, warm cinematic light", "image_urls": ["https://your-cdn.com/portrait.jpg"], "resolution": "720p", "duration": 10 } ``` ### Vertical social clip, no audio ```json { "model": "grok-imagine-video-1.5-official", "prompt": "Energetic motion, quick handheld feel", "image_urls": ["https://your-cdn.com/poster.jpg"], "aspect_ratio": "9:16", "resolution": "720p", "duration": 6, "audio": false } ``` *** ## Polling pattern The task endpoint behaves identically to other video tasks. A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in about a minute. The worker's wall-clock cap is **48 hours**, comfortably above any realistic queue. *** ## Pricing Per-second rate by **resolution** — `720p` costs 2× the `480p` rate. This channel is priced independently of (and lower than) the beta channel. See current rates on the [Grok Imagine Video 1.5 model page](https://reapi.ai/models/grok-imagine-video-1-5). **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_second_usd × duration × 1000) ``` Failed jobs refund automatically. *** ## Tips * **Write the prompt like a shot direction.** It is required here — lean into it: camera move, subject motion, atmosphere, and the sound you want. * **One clear subject image works best.** A centered, well-lit reference with clean composition tracks identity and motion far better than a busy frame. * **Sweet-spot duration: 6–10 seconds.** Longer clips raise wall-time without changing the per-second rate. * **Pick `720p` for hero shots, `480p` to save.** The 720p rate is exactly 2× the 480p rate on this channel. *** ## Related * [grok-imagine-video-1.5-beta](/docs/grok-imagine-video-1-5) * [grok-imagine-1.0-video](/docs/grok-imagine-1-0-video) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # grok-imagine-video-1.5-beta (https://reapi.ai/docs/grok-imagine-video-1-5) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Grok Imagine Video 1.5 — async **image-to-video** with **native > synchronized audio**. Pass exactly one reference image (and an optional > prompt) and the model returns a realistic clip with lifelike motion at > 480p or 720p, 1 to 15 seconds. Model id `grok-imagine-video-1.5-beta`. > See current pricing on the > [model page](https://reapi.ai/models/grok-imagine-video-1-5). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-imagine-video-1.5-beta", "prompt": "Gentle cinematic push-in, golden-hour light, subtle motion", "image_urls": ["https://your-cdn.com/source.jpg"], "resolution": "720p", "duration": 8 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "grok-imagine-video-1.5-beta", "prompt": "Gentle cinematic push-in, golden-hour light, subtle motion", "image_urls": ["https://your-cdn.com/source.jpg"], "resolution": "720p", "duration": 8, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "grok-imagine-video-1.5-beta", prompt: "Gentle cinematic push-in, golden-hour light, subtle motion", image_urls: ["https://your-cdn.com/source.jpg"], resolution: "720p", duration: 8, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "grok-imagine-video-1.5-beta", "prompt": "Gentle cinematic push-in, golden-hour light, subtle motion", "image_urls": []string{"https://your-cdn.com/source.jpg"}, "resolution": "720p", "duration": 8, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "grok-imagine-video-1.5-beta", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL (with audio), valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. This is an **image-to-video** model — exactly one reference image is required on every request. There is no text-to-video mode and no `mode` parameter. *** ## Request body ### `model` — required `string`. Must be `"grok-imagine-video-1.5-beta"`. ### `image_urls` — string\[], required Array with **exactly one** public HTTP(S) image URL — the frame the model animates. Accepted source formats: JPEG, PNG, WebP. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — the image URL must be a public HTTP(S) link. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. More than one entry is rejected. ### `prompt` — string, optional Up to **4,096 characters**. Optional — the reference image alone will animate. Use it to direct motion, camera, atmosphere, and any dialogue or sound you want in the generated audio. ### `aspect_ratio` — string, default `"auto"` Output framing. `auto` follows the source image's size. One of: | Value | Shape | | ------ | ----------------------------- | | `auto` | Follow source image (default) | | `1:1` | Square | | `16:9` | Landscape | | `9:16` | Portrait | | `4:3` | Landscape | | `3:4` | Portrait | | `3:2` | Landscape | | `2:3` | Portrait | ### `resolution` — string, default `"480p"` `480p` or `720p`. Unlike a flat-rate model, `720p` costs more per second than `480p` — see Pricing. ### `duration` — integer, default `8` Output length in seconds. Any integer in `[1, 15]`. Out-of-range → `400`. Drives pricing linearly. **Send a number, not a string.** `"duration": "8"` is rejected with `400`. ### `nsfw_checker` — boolean, default `true` Content safety filter. Defaults to `true`. You can set it to `false` to relax filtering for your own request. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "grok-imagine-video-1.5-beta", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | The generated MP4 carries the native audio track. `output.video_urls` URLs are valid for **7 days** — re-host to your own storage if you need them longer. *** ## Validation errors Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values) and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------------------- | ------- | ------------------------------------------------ | | `image_urls` missing | `20002` | `image_urls is required` | | `image_urls` with more than one entry | `20003` | `image_urls allows at most 1 entry` | | `prompt` longer than 4,096 chars | `20007` | `prompt must be at most 4096 characters` | | `duration` outside `[1, 15]` | `20003` | `duration must be 1-15 seconds` | | Unknown `resolution` | `20003` | `invalid resolution (allowed: 480p / 720p)` | | Unknown `aspect_ratio` | `20003` | `invalid aspect_ratio` | | `image_urls` carrying a `data:` URI or non-http(s) | `20003` | `image_urls entries must be public http(s) URLs` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see the [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Minimum request — image only ```json { "model": "grok-imagine-video-1.5-beta", "image_urls": ["https://your-cdn.com/source.jpg"] } ``` ### Directed motion + HD ```json { "model": "grok-imagine-video-1.5-beta", "prompt": "Slow dolly forward, wind moving the hair, warm cinematic light", "image_urls": ["https://your-cdn.com/portrait.jpg"], "resolution": "720p", "duration": 10 } ``` ### Vertical social clip ```json { "model": "grok-imagine-video-1.5-beta", "prompt": "Energetic motion with ambient street sound", "image_urls": ["https://your-cdn.com/poster.jpg"], "aspect_ratio": "9:16", "resolution": "720p", "duration": 6 } ``` *** ## Polling pattern The task endpoint behaves identically to other video tasks. A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. The worker's wall-clock cap is **48 hours**, comfortably above any realistic queue. *** ## Channels Grok Imagine Video 1.5 ships in two independent channels. You pick a channel by switching the `model` id you POST; each bills at its own per-second rate and neither falls back to the other. | Channel | `model` id | prompt | duration | aspect\_ratio | extras | | -------------------- | --------------------------------- | -------- | -------- | ----------------------- | -------------- | | Official *(default)* | `grok-imagine-video-1.5-official` | required | 6–15 s | `1:1` / `16:9` / `9:16` | `audio` toggle | | Beta | `grok-imagine-video-1.5-beta` | optional | 1–15 s | `auto` + 7 ratios | `nsfw_checker` | Both are image-to-video with exactly one reference image and native audio; submit/poll envelope, task id format, retention (7 days), and error codes are identical. The official channel has the lower per-second rate — see the [full official-channel reference](/docs/grok-imagine-video-1-5-official). *** ## Pricing Per-second rate by **resolution** — `720p` costs more per second than `480p`. See current rates on the [Grok Imagine Video 1.5 model page](https://reapi.ai/models/grok-imagine-video-1-5). **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_second_usd × duration × 1000) ``` Failed jobs refund automatically. *** ## Tips * **One clear subject image works best.** A centered, well-lit reference with clean composition tracks identity and motion far better than a busy frame. * **Prompt the motion and the sound.** "Slow push-in, ambient room tone, soft breathing" gives the native audio something to lock onto, not just the video. * **Sweet-spot duration: 5–10 seconds.** Longer clips raise wall-time without changing the per-second rate. * **Pick `720p` for hero shots, `480p` to save.** Resolution changes the per-second cost on this model, unlike flat-rate siblings. *** ## Related * [grok-imagine-video-1.5-official](/docs/grok-imagine-video-1-5-official) * [grok-imagine-1.0-video](/docs/grok-imagine-1-0-video) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # happyhorse-1.0-official (https://reapi.ai/docs/happyhorse-1-0-official) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Happy Horse 1.0 **Official Channel** — direct first-party routing, > distinct from the standard [`happyhorse-1.0`](/docs/happyhorse-1-0) > channel. It uses the model vendor's official first-party SKUs behind > one ReAPI model id and keeps ReAPI's URL-only media contract. **Official channel, ReAPI boundary.** The upstream is the model vendor's first-party platform. Media inputs must still be public `http(s)` URLs; base64/data URI media is not accepted by ReAPI even where upstream docs show base64 examples. Watermark policy is also a ReAPI override: the upstream's official default is `true`, but ReAPI defaults `watermark` to `false`. Send `"watermark": true` if you want the upstream watermark. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0-official", "prompt": "A coastal road at sunset, slow-motion camera push-in, cinematic feel", "resolution": "1080P", "size": "4:5", "duration": 5, "seed": 42 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "happyhorse-1.0-official", "prompt": "A coastal road at sunset, slow-motion camera push-in", "resolution": "1080P", "size": "4:5", "duration": 5, "seed": 42, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "happyhorse-1.0-official", prompt: "A coastal road at sunset, slow-motion camera push-in", resolution: "1080P", size: "4:5", duration: 5, seed: 42, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "happyhorse-1.0-official", "prompt": "A coastal road at sunset, slow-motion camera push-in", "resolution": "1080P", "size": "4:5", "duration": 5, "seed": 42, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Request surface The public endpoint and async response envelope are the same as the standard channel: ```txt POST /api/v1/videos/generations ``` One `model` id auto-routes by request shape: | Shape | Official upstream SKU | | ---------------------------------------------------- | --------------------------- | | `prompt` only | `happyhorse-1.0-t2v` | | `first_frame_image` (+ optional `prompt`) | `happyhorse-1.0-i2v` | | `image_urls` 1-9 + `prompt` | `happyhorse-1.0-r2v` | | `video_url` (+ optional `image_urls` 0-5) + `prompt` | `happyhorse-1.0-video-edit` | `first_frame_image`, `image_urls`, and `video_url` are mutually exclusive except for the legal EDIT combination: `video_url + image_urls`. ## Official-channel constraints | Field | Official channel behavior | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | Must be `"happyhorse-1.0-official"` | | `prompt` | Required for T2V / R2V / EDIT, optional for I2V. The upstream truncates over-length prompt text; ReAPI does not reject official-channel prompts at the standard-channel 2500-character cap. | | `first_frame_image` | Public `http(s)` URL only. Base64/data URI is rejected by ReAPI. | | `image_urls` | Public `http(s)` URLs only. R2V accepts 1-9 images; EDIT accepts 0-5 reference images. | | `video_url` | Public `http(s)` URL only. EDIT source video must be 3-60 seconds, long side ≤2160 px, short side ≥320 px, and aspect ratio between 1:2.5 and 2.5:1. The upstream also enforces file size ≤100 MB and fps >8. | | `resolution` | `"720P"` or `"1080P"`; omitted lets upstream apply its default. | | `size` | T2V/R2V ratio: `"16:9"`, `"9:16"`, `"1:1"`, `"4:3"`, `"3:4"`, `"4:5"`, `"5:4"`. Ignored for I2V and EDIT because output shape follows the source media. | | `duration` | 3-15 seconds for T2V/I2V/R2V. Ignored for EDIT because output length follows the source video. | | `watermark` | ReAPI default is `false` even though the upstream's official default is `true`. Explicit `true` / `false` is honored. | | `seed` | Integer from 0 to 2147483647. | | `audio_setting` | EDIT only: `"auto"` or `"origin"`. | ## Differences from `happyhorse-1.0` | Aspect | `happyhorse-1.0` | `happyhorse-1.0-official` | | ----------------------- | ----------------------------------- | ----------------------------------------------------------------------------- | | Upstream channel | Standard | Vendor first-party official | | Wire `model` value | `"happyhorse-1.0"` | `"happyhorse-1.0-official"` | | T2V/R2V ratios | `16:9`, `9:16`, `1:1`, `4:3`, `3:4` | Adds `4:5` and `5:4` | | Prompt cap | ReAPI rejects above 2500 chars | Upstream truncation semantics; no local 2500-char reject | | EDIT video dimensions | Standard channel validation rules | Official first-party validation rules | | Default watermark | ReAPI default `false` | ReAPI default `false` (intentional override from the upstream default `true`) | | Per-second rate | Baseline | **10% off** the baseline | | Validation error prefix | `happyhorse:` | `happyhorse-official:` | *** ## Pricing Per-second × resolution. **10% off** the standard channel at every supported resolution. See current 720P / 1080P / 4K rates on the [Happy Horse model page](https://reapi.ai/models/happyhorse-1-0). **Bill formula** (1 credit = $0.001): | Mode | Billable seconds | | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | T2V / I2V / R2V | `duration` you sent (default 5) | | EDIT | `ceil(probed_source_seconds) + min(ceil(probed_source_seconds), 15)` — vendor processes the source AND produces a capped output; both sides are billable. Failed probe → `400 PRICING_UNAVAILABLE`, no charge. | Final bill: `ceil(per_second_usd_after_discount × billable_seconds × 1000)` credits. Failed jobs refund automatically. ### Examples | Source video | Mode | Billable seconds | | ------------ | ------------------ | --------------------- | | — | T2V, `duration=5` | 5 | | — | T2V, `duration=10` | 10 | | 5s clip | EDIT | 5 + min(5, 15) = 10 | | 8.3s clip | EDIT | 9 + min(9, 15) = 18 | | 60s clip | EDIT | 60 + min(60, 15) = 75 | | 20s clip | EDIT | 20 + min(20, 15) = 35 | Apply `ceil(per_second_usd_after_discount × billable_seconds × 1000)` for the credit charge. *** ## Validation errors The response envelope and numeric error-code system match the standard channel, but official-channel validation follows the first-party rules listed above. Error messages from this channel use the `happyhorse-official:` prefix. Pattern-match on the numeric `code`, not the message string. *** ## When to pick which channel | Need | Channel | | --------------------------------------------- | ------------------------- | | Lowest unit price | `happyhorse-1.0-official` | | Official first-party route | `happyhorse-1.0-official` | | `size` values `4:5` or `5:4` | `happyhorse-1.0-official` | | Existing integration with no migration | `happyhorse-1.0` | | Standard channel route / existing constraints | `happyhorse-1.0` | Switching channels = changing the `model` string in your request body. The response envelope and polling flow are shared; provider-specific validation and pricing differ as documented above. *** ## Related * [`happyhorse-1.0` — full reference](/docs/happyhorse-1-0) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) --- # happyhorse-1.0 (https://reapi.ai/docs/happyhorse-1-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Alibaba Happy Horse 1.0 — a single async video endpoint that > auto-routes between **T2V / I2V / R2V / EDIT** based on which media field > your request carries. 720P or 1080P, 3–15 second outputs, billed only by > resolution × duration regardless of mode. See current pricing on the > [model page](https://reapi.ai/models/happyhorse-1-0). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0", "prompt": "A coastal road at sunset, slow-motion camera push-in, cinematic feel", "resolution": "1080P", "size": "16:9", "duration": 5, "seed": 42 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "happyhorse-1.0", "prompt": "A coastal road at sunset, slow-motion camera push-in", "resolution": "1080P", "size": "16:9", "duration": 5, "seed": 42, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "happyhorse-1.0", prompt: "A coastal road at sunset, slow-motion camera push-in", resolution: "1080P", size: "16:9", duration: 5, seed: 42, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "happyhorse-1.0", "prompt": "A coastal road at sunset, slow-motion camera push-in", "resolution": "1080P", "size": "16:9", "duration": 5, "seed": 42, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "happyhorse-1.0", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URLs, valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Mode routing `happyhorse-1.0` is **one model id** that picks its mode from which media fields you set: | Fields you send | Mode | What it does | | --------------------------------------------------------------------- | -------- | ----------------------------------------- | | `prompt` only | **T2V** | Generate from text | | `prompt` + `first_frame_image` | **I2V** | Animate starting from a still frame | | `prompt` + `image_urls` (1–9) | **R2V** | Compose a new scene from reference images | | `video_url` (+ `prompt`, optional `image_urls` ≤ 5 / `audio_setting`) | **EDIT** | Restyle / rewrite an existing clip | Resolution priority when multiple fields are set: `video_url` > `first_frame_image` > `image_urls` > `prompt`-only. **Mutex rule.** The three media fields (`first_frame_image`, `image_urls`, `video_url`) are mutually exclusive **in pairs**. The single legal pairing is `video_url + image_urls` (EDIT with style references). Any other combination is rejected with `400 first_frame_image and image_urls cannot be combined` or `400 first_frame_image and video_url cannot be combined` (code `20003`). *** ## Request body ### `model` — required `string`. Always `"happyhorse-1.0"`. ### `prompt` — string Up to **2,500 characters**. Required in T2V / R2V / EDIT; optional in I2V (but recommended — phrasing the camera move and motion improves output quality). **Failure modes.** * Missing in non-I2V → `400 prompt is required in T2V / R2V / EDIT modes` (code `20002`). * Longer than 2,500 chars → `400 prompt must be at most 2500 characters` (code `20007`). ### `first_frame_image` — string Public HTTP(S) URL pointing at the still you want animated. Triggers **I2V** when set. Mutually exclusive with `image_urls` and `video_url`. Recommended source asset: JPEG / PNG / BMP / WEBP, short side ≥ 300px, ratio between `1:2.5` and `2.5:1`, ≤ 10MB. The upstream model also enforces these — the gateway forwards the URL untouched, so non-compliant assets surface as a delayed `provider_failed` rather than an immediate 400. Validate before submitting if the source isn't yours. **No `data:` URIs.** reapi rejects base64 inputs platform-wide. Upload to public storage (your own CDN, S3, R2…) and pass the URL. ### `image_urls` — string\[] Array of public HTTP(S) URLs. * **R2V** (no `video_url`): **1–9** entries. The upstream composes a fresh scene that incorporates the supplied subjects / styles. * **EDIT** (`video_url` set): **0–5** entries acting as style references on top of the source video. Sending more than 5 is rejected with `400 image_urls allows at most 5 entries in EDIT mode`. Same per-asset constraints as `first_frame_image` (short side ≥ 720px is recommended for R2V, short / long ≥ 0.4, ≤ 10MB each). T2V and I2V requests are **rejected** if `image_urls` is present — the upstream wouldn't consume it, and silently dropping it would make billing surprising. Mutually exclusive with `first_frame_image`. ### `video_url` — string Public HTTP(S) URL of the source clip. Triggers **EDIT** mode. Combinable with `image_urls` (≤ 5) and `audio_setting`. Mutually exclusive with `first_frame_image`. Source asset shape (enforced upstream): MP4 / MOV (H.264 recommended), duration 3–60 seconds, ≥ 480p / short side ≥ 360, ratio between `1:8` and `8:1`, > 8 fps, ≤ 100MB. **Length caps the output.** If the source video runs longer than 15s, the upstream truncates from second 0 to second 15 before processing. The output clip's length **matches the source's processed length** — trim the input yourself if you need a different segment or a tighter total. In EDIT mode the `duration` parameter is **ignored for both generation and billing**; reapi probes the source clip server-side and charges `(ceil(probed_seconds) + min(ceil(probed_seconds), 15)) × per_second_usd` — input and capped output are both billable. See the `duration` field below. ### `audio_setting` — string, default `"auto"` Only valid in EDIT mode. Sending it without `video_url` is rejected with `400 audio_setting requires video_url (EDIT mode only)`. | Value | Behavior | | ---------- | -------------------------------------- | | `"auto"` | Generate a fresh audio track (default) | | `"origin"` | Keep the source video's original audio | ### `resolution` — string, default `"1080P"` `"720P"` or `"1080P"`. Drives pricing — every other parameter is free across the two tiers. Lowercase forms (`"720p"`, `"1080p"`) are accepted and normalized for symmetry with seedance; the upstream sees the canonical uppercase form. ### `size` — string, default `"16:9"` Output ratio for **T2V and R2V only**. One of `16:9` / `9:16` / `1:1` / `4:3` / `3:4`. In **I2V** and **EDIT**, the upstream derives the output ratio from the input media (first-frame image / source video) and ignores `size`. The gateway still accepts the field — it's just inert. ### `duration` — integer, default `5` Output length in seconds for **T2V / I2V / R2V**. Any integer in `[3, 15]`. Drives pricing linearly: `ceil(per_second_usd × duration × 1000)` credits (1 credit = $0.001). **EDIT mode ignores `duration` for billing.** When `video_url` is set, reapi probes the source video's actual length on the server (ffmpeg metadata) and bills both the input clip AND the (capped) output: ``` billable = ceil(probed_seconds) + min(ceil(probed_seconds), 15) bill_usd = billable × per_second_usd ``` A 5s source bills 10s; a 60s source bills 75s (60 + 15-cap output). Whatever you send in `duration` is ignored for cost. The upstream also ignores `duration` here (output length tracks the source). Probe failures return `400 PRICING_UNAVAILABLE` (code `30002`) with no charge. ### `watermark` — boolean, default `false` Adds the platform watermark to the generated clip when `true`. ### `seed` — integer Reproducibility hint. Range `[0, 2147483647]`. Same seed plus an otherwise identical request returns a similar (not bit-for-bit identical) result. Omit for full randomness. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "happyhorse-1.0", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | `output.video_urls` URLs are valid for **7 days**. Re-host to your own storage if you need them longer. *** ## Validation errors All cases below return HTTP 400 with code `20003` unless noted. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed dimensions, etc.) and are not a stable contract. | Trigger | Code | Message (illustrative) | | ----------------------------------------------------- | ------- | --------------------------------------------------------------------------------- | | `prompt` missing in T2V / R2V / EDIT | `20002` | `happyhorse: prompt is required in T2V / R2V / EDIT modes` | | `prompt` longer than 2,500 chars | `20007` | `happyhorse: prompt must be at most 2500 characters` | | `first_frame_image` + `image_urls` together | `20003` | `happyhorse: first_frame_image and image_urls cannot be combined` | | `first_frame_image` + `video_url` together | `20003` | `happyhorse: first_frame_image and video_url cannot be combined` | | `image_urls` empty array in R2V | `20003` | `happyhorse: image_urls contained no usable URLs` | | `image_urls` > 5 in EDIT | `20003` | `happyhorse: image_urls allows at most 5 entries in EDIT mode` | | `audio_setting` set without `video_url` | `20003` | `happyhorse: audio_setting requires video_url (EDIT mode only)` | | `image_urls` carrying a `data:` URI | `20003` | `happyhorse: image_urls must be public http(s) URLs` | | `video_url` carrying a `data:` URI | `20003` | `happyhorse: video_url must be a public http(s) URL` | | EDIT source duration \< 3s or > 60s | `20003` | `video_url duration X.XXs is out of range (must be 3–60s)` | | EDIT source resolution below 480p (short side \< 360) | `20003` | `video_url resolution WxH is below the 480p minimum (short side must be ≥ 360px)` | | EDIT source ratio outside 1:8–8:1 | `20003` | `video_url aspect ratio WxH is out of range (must be between 1:8 and 8:1)` | | EDIT source video probe fails (network / format) | `30002` | `Could not determine source video duration for billing: …` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### T2V — minimum request ```json { "model": "happyhorse-1.0", "prompt": "A little girl walking down the road, cinematic feel" } ``` ### T2V — full parameters ```json { "model": "happyhorse-1.0", "prompt": "Sunset coastal road, slow camera push-in, cinematic warm tones", "resolution": "1080P", "size": "16:9", "duration": 8, "watermark": false, "seed": 42 } ``` ### I2V — first-frame animation ```json { "model": "happyhorse-1.0", "prompt": "Bring the scene to life with gentle camera dolly forward", "first_frame_image": "https://your-cdn.com/first_frame.png", "resolution": "1080P", "duration": 5 } ``` ### R2V — multiple references ```json { "model": "happyhorse-1.0", "prompt": "The protagonist from image 1 runs through image 2's scene then picks up the prop from image 3. 3D cartoon style, smooth motion.", "image_urls": [ "https://your-cdn.com/img_01.jpg", "https://your-cdn.com/img_02.png", "https://your-cdn.com/img_03.jpeg" ], "resolution": "1080P", "size": "16:9", "duration": 5 } ``` ### EDIT — keep original audio + style reference ```json { "model": "happyhorse-1.0", "prompt": "Repaint the character in a 3D cartoon style, keep the original motion", "video_url": "https://your-cdn.com/source.mp4", "image_urls": ["https://your-cdn.com/style_ref.jpg"], "resolution": "1080P", "audio_setting": "origin", "seed": 42 } ``` ### 720P — cost-conscious ```json { "model": "happyhorse-1.0", "prompt": "Waves crashing on a beach at sunset, wide shot", "resolution": "720P", "size": "16:9", "duration": 5 } ``` *** ## Choosing a mode | Need | Send | | ----------------------------------------- | ------------------------------------------------------------------- | | Generate from text | `prompt` only (T2V) | | Animate a still | `prompt + first_frame_image` (I2V) | | Compose a new scene from reference images | `prompt + image_urls` 1–9 (R2V) | | Restyle / rewrite an existing clip | `video_url` (+ `prompt`, optional refs ≤ 5, `audio_setting`) (EDIT) | | Cut spend in half | Set `resolution: "720P"` | *** ## Polling pattern The task endpoint behaves identically to image tasks — the only difference is the completed `output` shape (`video_urls` instead of `image_urls`). A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. The worker's wall-clock cap is **48 hours**, comfortably above any realistic queue. *** ## Channels `happyhorse-1.0` ships in three channels. The wire schema is identical; you pick a channel by switching the `model` id you POST. Pricing, upstream routing, and a few feature corners differ — same input you send to any of them, just at different cost / quality / latency. | Channel | `model` id | Pricing | 4K | mask | negative prompt | | -------------------- | ------------------------- | -------- | -- | ---- | --------------- | | Standard *(default)* | `happyhorse-1.0` | baseline | — | — | — | | Official *(-10%)* | `happyhorse-1.0-official` | 0.9 × | ✓ | — | — | Both accept the **same request body** documented in this page — `prompt`, `first_frame_image`, `image_urls`, `video_url`, `audio_setting`, `resolution`, `size`, `duration`, `seed`, `watermark`. The only client-visible difference at the schema level is: * **Official channel**: adds 2 extra aspect ratios (`4:5`, `5:4`) and supports `4K` resolution. `watermark` is forced `false`. Submit/poll envelope is identical across channels — task id format, `status` enum, `output.video_urls` shape. Polling rate, retention (7 days for video URLs), and validation error codes are the same. Pick by use case: * **Standard** is the default for new integrations — predictable latency, full feature surface (only one that supports R2V image cardinality up to 9). * **Official** if you need 4K output, the wider aspect-ratio set, or the 10% discount applies to your volume. *** ## Pricing Per-second × resolution. Mode does **not** change the rate. Both channels share the same parameter shape: * **Standard** — `happyhorse-1.0`, full feature surface. * **Official** — `happyhorse-1.0-official`, cheaper than Standard, supports 4K (see official-only doc). See current 720P / 1080P / 4K rates per channel on the [Happy Horse model page](https://reapi.ai/models/happyhorse-1-0). **Bill formula** (1 credit = $0.001): | Mode | Billable seconds | | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | T2V / I2V / R2V | `duration` you sent (default 5) | | EDIT | `ceil(server_probed_source_seconds) + min(ceil(server_probed_source_seconds), 15)` — input and capped output both billable. `duration` is **ignored** in EDIT; server measures the uploaded clip. Failed probe → `400 PRICING_UNAVAILABLE`, no charge | Final bill: `ceil(per_second_usd × billable_seconds × 1000)` credits. Failed jobs refund automatically. *** ## Tips * **Prompt motion, not just scene.** "Slow push-in, warm tones, shallow depth of field" outperforms a pure noun-list of what's on screen. * **Sweet-spot duration: 5–10 seconds.** Below 5s motion looks choppy; above 10s upstream wall-time grows fast. * **First-frame quality matters.** Subject centered, clear composition, no heavy filters — I2V output quality tracks input quality directly. * **Pre-trim EDIT sources.** > 15s clips get auto-truncated to the first 15s upstream **and capped at 15s for billing**. Slice the input yourself if you want a different segment. * **EDIT cost = source length.** A 5s source bills 5s; an 8s source bills 8s; a 60s source bills 15s (the cap). The playground's draft estimate may show a default before the upload finishes — the authoritative number is computed at submit after the server probes the file. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # happyhorse-1-1 (https://reapi.ai/docs/happyhorse-1-1) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Alibaba HappyHorse 1.1 — a single async video endpoint that auto-routes > between **T2V / I2V / R2V** based on which media field your request carries. > 720p or 1080p, 3–15 second outputs, billed only by resolution × duration > regardless of mode. See current pricing on the > [model page](https://reapi.ai/models/happyhorse-1-1). Generation is **asynchronous**: the POST returns a task id, then poll [`GET /api/v1/tasks/{id}`](/docs/api/tasks) until `status` is `completed`. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1-1", "prompt": "A coastal road at sunset, slow-motion camera push-in, cinematic feel", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "happyhorse-1-1", "prompt": "A coastal road at sunset, slow-motion camera push-in", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "happyhorse-1-1", prompt: "A coastal road at sunset, slow-motion camera push-in", resolution: "1080p", aspect_ratio: "16:9", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "happyhorse-1-1", "prompt": "A coastal road at sunset, slow-motion camera push-in", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var out map[string]any json.NewDecoder(resp.Body).Decode(&out) fmt.Println(out) } ``` ## Endpoint ```http POST /api/v1/videos/generations Authorization: Bearer rk_live_xxx Content-Type: application/json ``` Submitting returns a task id; poll [`GET /api/v1/tasks/{id}`](/docs/api/tasks) for the result. Polling does not consume credits. ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | --------- | ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | yes | — | `happyhorse-1-1` | | `prompt` | string | T2V / R2V: yes · I2V: no | — | Any language. ≤5000 non-CJK / ≤2500 CJK characters (over-length is auto-truncated upstream). In R2V, reference images with `[Image 1]`, `[Image 2]`, … | | `image_urls` | string\[] | I2V | — | First-frame image, **exactly 1** public URL. Presence selects **image-to-video**. JPEG/PNG/WEBP, short side ≥300px, ratio 1:2.5–2.5:1, ≤20MB. | | `reference_image_urls` | string\[] | R2V | — | **1–9** reference image URLs. Presence selects **reference-to-video**. JPEG/PNG/WEBP, short side ≥400px, ≤20MB. | | `resolution` | enum | no | `720p` | `720p` · `1080p` | | `aspect_ratio` | enum | no | `16:9` | `16:9` `9:16` `3:4` `4:3` `4:5` `5:4` `1:1` `9:21` `21:9`. **T2V / R2V only** — in I2V the orientation is derived from the source image. | | `duration` | integer | no | `5` | Output length in seconds, `3`–`15`. | `image_urls` (I2V) and `reference_image_urls` (R2V) are **mutually exclusive**. All media inputs must be public HTTP(S) URLs — base64 / `data:` URIs are rejected. ## Modes Mode is implicit — selected by which inputs you send: | Mode | Trigger | prompt | aspect\_ratio | | ---------------------------- | ---------------------------- | -------- | --------------- | | **Text-to-video (T2V)** | no media | required | yes | | **Image-to-video (I2V)** | `image_urls` (1) | optional | no (from image) | | **Reference-to-video (R2V)** | `reference_image_urls` (1–9) | required | yes | ```json // I2V — animate a first frame { "model": "happyhorse-1-1", "image_urls": ["https://…/frame.jpg"], "resolution": "1080p", "duration": 5 } // R2V — keep subjects consistent across the clip { "model": "happyhorse-1-1", "prompt": "the woman in [Image 1] walks through [Image 2]", "reference_image_urls": ["https://…/a.jpg", "https://…/b.jpg"], "resolution": "1080p", "duration": 5 } ``` ## Pricing Billed by **per-second rate × resolution × duration**; the routing mode does not change the rate. Two tiers: `720p` and `1080p`. See the [model page](https://reapi.ai/models/happyhorse-1-1) for current rates. **Bill formula** (`1 credit = $0.001`): ``` credits = ceil(per_second_usd × duration × 1000) ``` ## Output On success, `GET /api/v1/tasks/{id}` returns: ```json { "id": "task_…", "model": "happyhorse-1-1", "status": "completed", "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/…/0.mp4"] }, "error": null } ``` ## Errors | HTTP | `code` | When | | ---- | ----------------- | ------------------------------------------------------------------------------------ | | 400 | `20002` | Missing / invalid parameter (e.g. prompt required in T2V/R2V, both image fields set) | | 401 | `10001` – `10005` | Auth missing / invalid / revoked | | 402 | `30001` | Insufficient credits | | 429 | `50001` | Per-user rate limit exceeded | Failed generations are surfaced under `error` in the polling response and are refunded automatically. Full catalog: [Errors](/docs/api/errors). ## Tips * **Pick the mode by inputs, not a flag.** Sending `reference_image_urls` switches to R2V; sending `image_urls` switches to I2V; neither → T2V. * In **R2V**, name each subject explicitly and reference it by `[Image N]` in the prompt, matching the array order, for the strongest identity retention. * `aspect_ratio` is ignored in I2V — crop your source image to the orientation you want instead. * Longer `duration` scales the bill linearly; start at 5s while iterating. ## Related * [Tasks](/docs/api/tasks) — universal polling endpoint * [Errors](/docs/api/errors) — full error catalog * [happyhorse-1-0](/docs/happyhorse-1-0) — the previous generation --- # humanize (https://reapi.ai/docs/humanize) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > `humanize` is a single async endpoint that takes AI-generated text and returns > a rewrite that reads as human-written — varied rhythm, natural transitions, no > tell-tale AI cadence — built to pass common AI detectors. Tune the rewrite > with `readability`, `purpose`, `strength`, and `model_version`. See current > pricing on the [model page](https://reapi.ai/models/humanize). ## Quick example ```bash curl https://reapi.ai/api/v1/humanize \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "humanize", "content": "Artificial intelligence has fundamentally transformed the way modern enterprises approach data-driven decision making.", "readability": "University", "purpose": "General Writing", "strength": "Balanced", "model_version": "v2" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/humanize", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "humanize", "content": "Artificial intelligence has fundamentally transformed the way modern enterprises approach data-driven decision making.", "readability": "University", "purpose": "General Writing", "strength": "Balanced", "model_version": "v2", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/humanize", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "humanize", content: "Artificial intelligence has fundamentally transformed the way modern enterprises approach data-driven decision making.", readability: "University", purpose: "General Writing", strength: "Balanced", model_version: "v2", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "humanize", "content": "Artificial intelligence has fundamentally transformed the way modern enterprises approach data-driven decision making.", "readability": "University", "purpose": "General Writing", "strength": "Balanced", "model_version": "v2", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/humanize", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "humanize", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` until `status === "completed"`. The completed payload's `output.humanized_text` holds the rewritten text. A rewrite usually finishes in a few seconds. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/humanize GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; polling the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required Always `"humanize"`. ### `content` — required (string) The AI-generated text to humanize. Minimum **50 characters**. Longer text takes proportionally longer to return. ### `readability` — required (string) Target reading level of the rewrite. One of: | Value | Register | | ------------- | --------------------------------- | | `High School` | Simple, accessible prose. | | `University` | Standard academic / professional. | | `Doctorate` | Dense, formal, advanced. | | `Journalist` | Punchy, news-style. | | `Marketing` | Persuasive, brand-friendly. | ### `purpose` — required (string) What the text is for — tunes tone and structure. One of: `General Writing`, `Essay`, `Article`, `Marketing Material`, `Story`, `Cover Letter`, `Report`, `Business Material`, `Legal Material`. ### `strength` — optional (string) How aggressively to rewrite. Default: `"Balanced"`. | Value | Behavior | | ------------ | ----------------------------------------------------------- | | `Quality` | Lightest touch; stays closest to the source wording. | | `Balanced` | Default trade-off between fidelity and humanization. | | `More Human` | Most aggressive rewrite for the strongest detector evasion. | ### `model_version` — optional (string) Which humanizer model handles the rewrite. Default: `"v2"`. | Value | Best for | | ------- | -------------------------------------------------- | | `v2` | All languages, medium humanization. | | `v11` | English, high humanization. | | `v11sr` | English, strongest humanization (slightly slower). | `model_version` maps to the underlying engine's model selector. reAPI uses `model` at the top level to route the request, so this knob is exposed as a separate `model_version` field to avoid the name collision — its values are unchanged. *** ## Output ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "humanize", "status": "completed", "created_at": 1735000000, "output": { "humanized_text": "AI has reshaped how today's companies make decisions with data..." }, "error": null } ``` `output.humanized_text` is plain text — drop it straight back into your document or CMS. *** ## Pricing Billed **per word** of the `content` you submit, with a **50-word floor** (text under 50 words is charged as 50 words). Polling the task does not add any charge. Failed and rejected requests are refunded automatically. `1 credit = $0.001 USD`. See the live banner on the [model page](https://reapi.ai/models/humanize) for the current per-1,000-words rate in credits. *** ## Errors Standard envelope: ```json { "error": { "code": 20003, "message": "content must be at least 50 characters", "request_id": "req_..." } } ``` Common cases: | Code | When | | ------- | -------------------------------------------------------------------------------- | | `20002` | `content`, `readability`, or `purpose` missing. | | `20003` | Invalid enum value, or `content` under 50 characters. | | `30001` | Insufficient credits for the submitted word count. | | `80001` | Provider rejected the submission — includes insufficient upstream credits/words. | | `80003` | Provider failed while processing the rewrite. | *** ## Related * [AI Text Detector](/docs/ai-text-detector) — score text 0–100 for AI authorship. Pair it with `humanize` for a detect → rewrite → detect QA loop. --- # imagen-4-0 (https://reapi.ai/docs/imagen-4-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Google's Imagen 4 model on reAPI. **Text-to-image only** — no reference > images, no inpainting masks. Five aspect ratios at a **flat per-image > rate**. Async-first: submit returns a `task_id`; poll until ready. See > current pricing on the [model page](https://reapi.ai/models/imagen-4-0). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "imagen-4-0", "prompt": "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k", "size": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "imagen-4-0", "prompt": "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k", "size": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "imagen-4-0", prompt: "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k", size: "16:9", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "imagen-4-0", "prompt": "A corgi wearing an astronaut helmet on the lunar surface, Earth in the background, cinematic lighting, 8k", "size": "16:9", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` The response carries a `task_id`. Poll [`GET /api/v1/tasks/{task_id}`](/docs/api/tasks) until `status` is `completed`, then read `result.images[].url`. ## Request body | Field | Type | Required | Default | Description | | -------- | ------- | -------- | ------- | --------------------------------------------------------------------------------------------------------- | | `model` | string | yes | — | Must be `imagen-4-0`. | | `prompt` | string | yes | — | Image description. English or Chinese both supported. Up to 4000 characters. | | `n` | integer | no | `1` | Number of images per request. Only `1` is accepted. | | `size` | string | no | `16:9` | Aspect ratio. One of `1:1` / `4:3` / `3:4` / `16:9` / `9:16`. Passing an unsupported ratio returns a 400. | `imagen-4-0` is **text-to-image only**. The endpoint rejects `image_urls`, `image`, `mask`, and similar reference fields. For image-to-image, see [seedream-5-0-lite](/docs/seedream-5-0-lite) or the [gemini-3-pro-image-preview](/docs/gemini-3-pro-image-preview) family. ## Response Submission returns the standard async envelope: ```json { "code": 200, "data": [ { "status": "submitted", "task_id": "task_01K8AYYM6R03TGZ3Q2P0TZVNPX" } ] } ``` Polled completion (`GET /api/v1/tasks/{task_id}`): ```json { "code": 200, "data": { "status": "completed", "result": { "images": [{ "url": "https://cdn.reapi.ai/..." }] } } } ``` Image URLs are valid for 24 hours from completion. Re-host the asset to your own storage if you need durable access. ## Pricing Flat per-image rate. `n` is fixed at `1`, so total charge is exactly one image per request. See the [model page](https://reapi.ai/models/imagen-4-0) for the live rate. ## Errors `imagen-4-0` shares the platform-wide [error envelope](/docs/api/errors). The validation surface is small: * `prompt` missing or empty → `400 INVALID_REQUEST`. * `size` outside the five accepted ratios → `400 INVALID_REQUEST`. * `n` set to any value other than `1` → `400 INVALID_REQUEST`. * Any reference media (`image_urls`, `image`, `mask`) supplied → `400 INVALID_REQUEST` with a text-to-image-only message. --- # Welcome (https://reapi.ai/docs) reAPI is an aggregator that runs every leading image, video, chat, and code model behind a single standard endpoint. Pay-as-you-go via credits, no per-provider account juggling. ## Where to start * **[Quickstart](/docs/api/quickstart)** — first call in 5 minutes. * **[Authentication](/docs/api/authentication)** — create and use API keys. * **[Tasks](/docs/api/tasks)** — `GET /api/v1/tasks/{id}` polling reference (image, video, and audio). * **[Errors](/docs/api/errors)** — error codes and how to handle them. Per-model request schemas (parameters, sizes, resolutions, examples) live on each model's own page — see the **Models** sidebar. --- # kimi-k3 (https://reapi.ai/docs/kimi-k3) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Moonshot's Kimi K3 — the flagship for long-horizon coding and end-to-end > knowledge work — exposed through api.reapi.ai as a drop-in OpenAI-compatible > Chat Completions endpoint. A **1,048,576-token** context window, output > defaulting to **131,072** tokens and raisable to the full window, **reasoning > that is always on** with a three-rung `reasoning_effort` dial, native **image > and video** input, tool calling with a `required` tool choice, strict JSON > Schema output, and automatic context caching. The wire `model` id is > `kimi-k3`. Current rates live on the > [model page](https://reapi.ai/models/kimi-k3) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kimi-k3", "messages": [ { "role": "user", "content": "Refactor this module and add tests." } ], "reasoning_effort": "high", "stream": true }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="kimi-k3", messages=[{"role": "user", "content": "Refactor this module and add tests."}], reasoning_effort="high", stream=True, ) for chunk in stream: delta = chunk.choices[0].delta reasoning = getattr(delta, "reasoning_content", None) if reasoning: print(reasoning, end="") if delta.content: print(delta.content, end="") ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "kimi-k3", messages: [{ role: "user", content: "Refactor this module and add tests." }], reasoning_effort: "high", stream: true, }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "kimi-k3", "messages": []map[string]string{ {"role": "user", "content": "Refactor this module and add tests."}, }, "reasoning_effort": "high", }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Chat models are served from the `api.reapi.ai` gateway, which has its own console and its own key. Create the key there, then send it as a bearer token: ```http Authorization: Bearer YOUR_API_KEY ``` The gateway key is **not** the same credential as a media-generation key used against `reapi.ai/api/v1`. Sign in at [api.reapi.ai](https://api.reapi.ai/) to create one. *** ## Endpoint ```http POST /v1/chat/completions ``` Base URL `https://api.reapi.ai`. The wire format is OpenAI-compatible, so the same SDKs (`openai-python`, `openai-node`, `openai-go`, …) work once you swap the base URL, the key and the model string. Moonshot's own quickstart drives this model through the OpenAI SDK, so the compatibility is the vendor's design rather than a translation layer. *** ## Request body ### `model` — string, required Must be `kimi-k3` exactly — no date suffix, no version decimal. ### `messages` — array, required Conversation history, each entry an object with `role` and `content`. Text, image and video parts are supported — see [Visual input](#visual-input). **Echo the assistant message back unchanged.** In multi-turn conversations and tool-call loops, the complete assistant message returned by the API has to go back into `messages` as-is, including `reasoning_content` and `tool_calls`. Keeping only `content` — the habit most OpenAI-shaped code has — breaks this model's Preserved Thinking. ### `max_completion_tokens` — integer Upper bound on output tokens for this response. Moonshot documents a **default of 131,072**, raisable to **1,048,576** — the size of the whole context window. Reasoning runs before the answer, so budget for both. ### `reasoning_effort` — string, default `"max"` Top-level field controlling how hard the model thinks. See [Reasoning](#reasoning). ### `stream` — boolean, default `false` When `true`, tokens arrive as server-sent events. Reasoning and answer come as **separate deltas** — `reasoning_content` and `content` — so a client can render the reasoning live and still parse the answer on its own. ### `tools` / `tool_choice` — optional Tool definitions and the strategy for picking among them. `tool_choice` accepts `auto`, `none` and `required`. See [Tool calling](#tool-calling). ### `response_format` — object, optional A JSON Schema with `strict: true` constrains the **answer** field. Parse that field, not `reasoning_content`, which is prose. ### `group` — string, default `"default"` Token group on the gateway. Leave it at `default` unless your account has been given another group to route through. *** ## Reasoning **This model always reasons.** Moonshot's own FAQ answers "how do I turn off the chain of thought" with a flat *you can't*. There is no thinking toggle; the lever is effort. `reasoning_effort` takes **three** rungs and defaults to the most expensive one: | Level | Use it for | | ------ | --------------------------------------------------------------------------------------------- | | `max` | **The default.** The hardest reasoning, where correctness outweighs cost. | | `high` | A step down that still reasons hard. | | `low` | Short, scoped, latency-sensitive work — and the answer to "the reasoning is taking too long". | There is no `medium`. **Pick the rung before the conversation starts.** Moonshot documents that switching effort levels **invalidates prefix-cache hits**, so flipping it mid-session silently throws away your cache. The K2-era `thinking` object is **not** a parameter on this model. If you are migrating from `kimi-k2.6` or `kimi-k2.7-code`, delete it and use top-level `reasoning_effort` instead. Code that already sends OpenAI's `reasoning_effort` needs no change beyond the accepted values. *** ## Parameters that are fixed Moonshot pins all five of these on this model. Passing any other value returns an error, so leave them out of the request entirely: | Parameter | Fixed at | | ------------------- | -------- | | `temperature` | `1.0` | | `top_p` | `0.95` | | `n` | `1` | | `presence_penalty` | `0` | | `frequency_penalty` | `0` | Steer with prompting and the `reasoning_effort` rung instead. *** ## Tool calling Two controls are specific to this generation. **`tool_choice: "required"`** forces at least one tool call on the turn — the way to stop an agent answering from memory when it was supposed to look something up. The K2 models reject this value; this one accepts it. **Dynamic tool loading** introduces a tool partway through a conversation: put its complete definition in a `system` message that carries `tools` and **no** `content`. It becomes available from that position onward. ```json { "role": "system", "tools": [ { "type": "function", "function": { "name": "calculate", "description": "Evaluate an arithmetic expression", "parameters": { "type": "object", "properties": { "expression": { "type": "string" } }, "required": ["expression"] } } } ] } ``` The server does **not** retain a dynamically loaded tool. Keep that `system` message in your request history or the tool disappears on the next turn. Include the complete `name`, `description` and `parameters` in the definition, and after executing calls, append one `tool` message per call with the matching `tool_call_id`. *** ## Visual input | Modality | Supported | | -------- | :-------: | | Text | ✅ | | Image | ✅ | | Video | ✅ | Output is **text only**. Vision is native to this model rather than a separate variant, which is what makes screenshot-driven work — frontend layout, game development, CAD — practical: it can look at what it just produced. **Public image URLs are not accepted.** Moonshot documents base64 data URIs, or a file reference from its own upload API, as the two ways in. `content` must also be an **array of parts**, not a serialized string. ```json { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": "data:image/png;base64,iVBORw0..." } }, { "type": "text", "text": "Why does this layout break at 768px?" } ] } ``` Note that file references come from Moonshot's Files API, which the Chat Completions endpoint does not itself provide. *** ## Context caching Caching is **automatic** — no cache id, no TTL, no extra parameter. Keep a long prefix (system prompt, knowledge document, tool definitions) stable and repeat requests attempt a hit on their own. Two conditions decide whether that happens: * The **previous** request's prompt tokens must exceed **256**. Below that the request is not cached at all. * The `reasoning_effort` rung must not change — switching it invalidates the prefix cache. Put the fixed bulk at the front of `messages` and append the varying question after it. *** ## Pricing dimensions Billing is **per token**, in USD, against your `api.reapi.ai` balance, with separate **input** and **output** rates. Three things to keep in mind: * **Reasoning tokens bill as output.** Since this model always reasons, that is the usual reason a bill exceeds an estimate built from visible answer length. * **The rate is flat across context length.** Moonshot documents no long-context tier, so a million-token prompt costs the same per token as a short one. * **Effort moves the bill.** It is the only reasoning lever, and it defaults to the most expensive rung — so it is the first thing to tune. Both token rates sit **below Moonshot's published per-token rate**, output by a full fifth. Current numbers are on the [model page](https://reapi.ai/models/kimi-k3) and [api.reapi.ai/pricing](https://api.reapi.ai/pricing) — those tables are the canonical source, not this page. Chat models bill in USD on the gateway balance. They do **not** draw down the integer credits used by the media-generation endpoints on `reapi.ai/api/v1`. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1785000000, "model": "kimi-k3", "choices": [ { "index": 0, "message": { "role": "assistant", "reasoning_content": "...", "content": "..." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 1204, "completion_tokens": 860, "total_tokens": 2064 } } ``` `reasoning_content` is a sibling of `content`, not a replacement for it — and it is the field you must carry into the next request. ### Streaming (`stream: true`) Server-sent events, each `data:` line carrying a `chat.completion.chunk`. Reasoning arrives in `choices[0].delta.reasoning_content` and the answer in `choices[0].delta.content`, terminated by `data: [DONE]`. *** ## Errors Failures use the gateway's standard envelope. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: | Trigger | What to do | | ------------------------------------------------------ | ---------------------------------------------------- | | Missing or invalid bearer token | Create a key in the api.reapi.ai console | | Unknown `model` value | Send `kimi-k3` exactly | | `temperature` / `top_p` / `n` / penalty params present | Remove them; they are fixed on this model | | K2-era `thinking` object present | Remove it and use `reasoning_effort` | | `reasoning_effort` set to `medium` | Not a valid rung — use `low`, `high` or `max` | | A public image URL in an `image_url` part | Send a base64 data URI or an uploaded file reference | | `content` sent as a string for a multimodal turn | Make it an array of parts | | `max_completion_tokens` above the ceiling | Lower it; the documented ceiling is 1,048,576 | | Insufficient balance | Top up on the gateway | | Upstream rate limit | Retry with backoff, or route through another model | Moonshot flags its own `web_search` tool as **being updated** and does not recommend using it in the near term. Treat web search as unavailable on this model for now and supply fresh context yourself. *** ## Tips * **Give the whole task up front.** This model is built for long-horizon work under minimal supervision; a complete specification beats a drip-feed of short turns. * **Drop your sampling parameters first.** The single most common migration error here is a carried-over `temperature`. * **Tune effort before anything else.** The default is `max`; `low` exists precisely for the case where reasoning is costing more than the answer is worth. * **Budget for reasoning.** If responses truncate on hard prompts, the reasoning pass consumed the allowance — raise `max_completion_tokens`. * **Stream anything interactive**, and render `reasoning_content` separately from the answer rather than concatenating them. * **Keep the assistant message intact** in history. Stripping `reasoning_content` is silent — it does not error, it just degrades multi-turn behaviour. * **Front-load the stable bulk** of your prompt so automatic caching can hit, and do not change the effort rung mid-conversation. *** ## Related * [Kimi K3 model page](https://reapi.ai/models/kimi-k3) — current rates * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # kling-3-0-turbo (https://reapi.ai/docs/kling-3-0-turbo) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Kuaishou's Kling 3.0 Turbo on reAPI — the fast tier of Kling 3.0 for > **text-to-video** and **image-to-video** (first frame), at **720p** or > **1080p**. One async endpoint: submit returns a `task_id`; poll until ready. > See current pricing on the [model page](https://reapi.ai/models/kling-3-0-turbo). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-3-0-turbo", "prompt": "a corgi running on the beach, cinematic, golden hour", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "kling-3-0-turbo", "prompt": "a corgi running on the beach, cinematic, golden hour", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "kling-3-0-turbo", prompt: "a corgi running on the beach, cinematic, golden hour", resolution: "1080p", aspect_ratio: "16:9", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "kling-3-0-turbo", "prompt": "a corgi running on the beach, cinematic, golden hour", "resolution": "1080p", "aspect_ratio": "16:9", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "kling-3-0-turbo", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated video URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Modes There is no separate model id per modality — the modality is implicit in the request shape: * **Text-to-video** — no `first_frame_image`. `prompt` is required, and `aspect_ratio` applies. * **Image-to-video** — pass `first_frame_image` (a public HTTPS URL). The clip starts from that frame, `prompt` is optional, and `aspect_ratio` is ignored (the frame fixes the ratio). Multi-shot direction is expressed inside the `prompt` (describe each shot); there is no dedicated multi-shot field. *** ## Request body ### `model` — string, required Must be `kling-3-0-turbo`. ### `prompt` — string Up to **3,072 characters** (recommended ≤ 2,500). Required for text-to-video; optional in image-to-video (omit it to animate purely from the first frame). ### `first_frame_image` — string, optional Start frame for image-to-video. **Public HTTPS URL only** — base64 / `data:` URIs are rejected at the gateway. JPG / JPEG / PNG, ≤ 50 MB, ≥ 300 px, with an aspect ratio between 1:2.5 and 2.5:1. ### `resolution` — string, default `720p` Output clarity tier: `720p` or `1080p`. Billed per second at the tier's rate. ### `duration` — integer, default `5` Total video length in seconds, range `3–15`. Billed per second. ### `aspect_ratio` — string, default `16:9` One of `16:9`, `9:16`, `1:1`. **Text-to-video only.** When `first_frame_image` is supplied (image-to-video), this field has **no effect** — the output ratio is determined by the first frame. Set it only for text-to-video. ### `watermark` — boolean, optional Add a watermark to the output video. Omitted by default (no watermark). Modality is auto-detected: supply `first_frame_image` for image-to-video, omit it for text-to-video. You never set a mode flag. *** ## Pricing Kling 3.0 Turbo bills **per second**, by resolution tier (`resolution`): ``` credits = ceil(per_second_usd × seconds × 1000) ``` where `1 credit = $0.001 USD` and `seconds` is `duration`. The 1080p tier carries a higher per-second rate than 720p. Failed and rejected requests are not charged. The exact per-second credit cost for each tier surfaces on the [model page](https://reapi.ai/models/kling-3-0-turbo) and through the playground estimator before submit. *** ## Response The poll envelope returns the video URL in `output.video_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "kling-3-0-turbo", "status": "completed", "output": { "video_urls": [ "https://cdn.reapi.ai/...mp4" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (prompt over 3072 chars, out-of-range `duration`, a non-HTTPS `first_frame_image`, an invalid `resolution` or `aspect_ratio`) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * Use cinematic language in the prompt (shot type, camera move, lighting) — Kling 3.0 Turbo reads it; there is no dedicated camera-control parameter. * Draft at `720p` to iterate cheaply, then re-run the winner at `1080p` for delivery — same call, one parameter change. * For image-to-video, the first frame fixes the aspect ratio, so you can skip `aspect_ratio` in that mode. * Reach for the full [Kling 3.0](/docs/kling-3-0) when you need multi-shot control, native audio, or 4K; Kling 3.0 Turbo trades those for speed and a lower per-second cost. *** ## Related * [Kling 3.0](/docs/kling-3-0) * [Video generation models](/docs/seedance-2-0) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # kling-3-0 (https://reapi.ai/docs/kling-3-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Kuaishou's Kling 3.0 on reAPI — one async endpoint for **text-to-video**, > **image-to-video** (first/last frame), and **multi-shot** cinematic > sequences, with optional **native multilingual audio** and up to **4K**. > Submit returns a `task_id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/kling-3-0). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-3-0", "prompt": "A soft anime-style girl in a field, warm sunset glow, smooth loop", "duration": 6, "aspect_ratio": "16:9", "mode": "pro" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "kling-3-0", "prompt": "A soft anime-style girl in a field, warm sunset glow, smooth loop", "duration": 6, "aspect_ratio": "16:9", "mode": "pro", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "kling-3-0", prompt: "A soft anime-style girl in a field, warm sunset glow, smooth loop", duration: 6, aspect_ratio: "16:9", mode: "pro", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "kling-3-0", "prompt": "A soft anime-style girl in a field, warm sunset glow, smooth loop", "duration": 6, "aspect_ratio": "16:9", "mode": "pro", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "kling-3-0", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated video URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Modes There is no separate model id per modality — the modality is implicit in the request shape: * **Text-to-video** — no `image_urls`. `prompt` is required. * **Image-to-video** — pass `image_urls`: index 0 is the start frame, index 1 (optional) is the end frame. Aspect ratio auto-adapts to the images. * **Multi-shot** — set `multi_shots: true` and provide `multi_prompt` (per-shot prompts + durations). The resolution tier (`std` 720p / `pro` 1080p / `4K`) is the `mode` field; native audio is the `sound` toggle. *** ## Request body ### `model` — string, required Must be `kling-3-0`. ### `prompt` — string Up to **2,500 characters**. Required for single-shot; superseded by `multi_prompt` in multi-shot mode. ### `image_urls` — array, optional First/last frame for image-to-video. **Public HTTPS URLs only** — base64 / `data:` URIs are rejected at the gateway. Up to **2** (index 0 = first frame, index 1 = last frame). ### `duration` — integer, default `5` Total video length in seconds, range `3–15`. Billed per second. ### `aspect_ratio` — string, default `16:9` One of `16:9`, `9:16`, `1:1`. Ignored (auto-adapted) when `image_urls` is supplied. ### `mode` — string, default `pro` Resolution tier: `std` (720p), `pro` (1080p), or `4K`. ### `sound` — boolean, default `false` Generate synchronized native audio (dialogue, lip sync, ambient sound). Audio tiers cost more per second. ### `multi_shots` — boolean, default `false` Enable multi-shot mode (a connected sequence of shots). ### `multi_prompt` — array, optional (required when `multi_shots: true`) Up to **5** shots; each item is `{ "prompt": string, "duration": int }` where per-shot duration is **1–12s** and prompt is up to **500 chars**. ```json { "multi_shots": true, "multi_prompt": [ { "prompt": "a chef plating a dish, close-up", "duration": 4 }, { "prompt": "pull back to a busy restaurant", "duration": 5 } ] } ``` ### `kling_elements` — array, optional Up to **3** reusable `@`-referenced elements. Each item is `{ "name": string, "description"?: string, "element_input_urls": [string] }` with **2–4** image URLs (JPG/PNG). Reference an element in the prompt with `@name`. Multi-shot bills the **sum of the per-shot durations**; single-shot bills the top-level `duration`. *** ## Pricing Kling 3.0 bills **per second**, by resolution tier (`mode`) and whether audio is on (`sound`): ``` credits = ceil(per_second_usd × seconds × 1000) ``` where `1 credit = $0.001 USD`, and `seconds` is `duration` (single-shot) or the sum of `multi_prompt` durations (multi-shot). Higher tiers and audio carry a higher per-second rate. Failed and rejected requests are not charged. The exact per-second credit cost for each tier surfaces on the [model page](https://reapi.ai/models/kling-3-0) and through the playground estimator before submit. *** ## Response The poll envelope returns the video URL in `output.video_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "kling-3-0", "status": "completed", "output": { "video_urls": [ "https://cdn.reapi.ai/...mp4" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (prompt over 2500 chars, out-of-range `duration`, a non-HTTPS media URL, more than 2 `image_urls`, more than 5 shots) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * Use cinematic language in the prompt (shot type, camera move, lighting) — Kling 3.0 reads it; there is no dedicated camera-control parameter. * For sequences, prefer multi-shot over stitching separate requests — characters stay consistent across cuts. * For image-to-video, supply both a first and last frame to control the start and end of the motion. * Reach for `mode: "4K"` only when the destination needs it — the per-second rate is highest there. *** ## Related * [Video generation models](/docs/seedance-2-0) * [Grok Imagine Video 1.5](/docs/grok-imagine-video-1-5) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # kling-motion-control (https://reapi.ai/docs/kling-motion-control) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Kling Motion Control transfers the motion from a **reference video** onto a > subject taken from a **reference image**. One async endpoint, two version > tiers (`kling-v3-motion-control`, `kling-v2-6-motion-control`), `std` or > `pro` quality. Billing is per second of the source video's server-probed > length. See current pricing on the > [model page](https://reapi.ai/models/kling-motion-control). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-v3-motion-control", "prompt": "Keep the subject consistent, follow the reference motion, cinematic lighting", "image_url": "https://your-cdn.com/subject.png", "video_url": "https://your-cdn.com/motion-8s.mp4", "character_orientation": "image", "mode": "std", "keep_original_sound": "yes" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "kling-v3-motion-control", "prompt": "Follow the reference motion, keep the subject consistent", "image_url": "https://your-cdn.com/subject.png", "video_url": "https://your-cdn.com/motion-8s.mp4", "character_orientation": "image", "mode": "std", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "kling-v3-motion-control", prompt: "Follow the reference motion, keep the subject consistent", image_url: "https://your-cdn.com/subject.png", video_url: "https://your-cdn.com/motion-8s.mp4", character_orientation: "image", mode: "std", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "kling-v3-motion-control", "prompt": "Follow the reference motion, keep the subject consistent", "image_url": "https://your-cdn.com/subject.png", "video_url": "https://your-cdn.com/motion-8s.mp4", "character_orientation": "image", "mode": "std", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "kling-v3-motion-control", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URLs. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Version tiers Two `model` ids share the **exact same request shape** — pick one by the `model` string you POST: | `model` id | Tier | Notes | | --------------------------- | ---- | --------------------------------------------- | | `kling-v3-motion-control` | v3 | Latest — higher motion fidelity & consistency | | `kling-v2-6-motion-control` | v2.6 | Budget tier, lower per-second rate | Everything else in this page applies identically to both ids. See current per-second rates for each tier on the [model page](https://reapi.ai/models/kling-motion-control). *** ## Request body ### `model` — required `string`. One of `"kling-v3-motion-control"` or `"kling-v2-6-motion-control"`. ### `prompt` — required `string`. Refines the motion, camera, and style. The API rejects requests without a prompt — more specific prompts yield more stable results. ### `image_url` — required `string`. Public HTTP(S) URL of the **reference image** — the subject whose appearance and identity the output keeps. **No `data:` URIs.** reApi rejects base64 inputs platform-wide. Upload to public storage (your own CDN, S3, R2…) and pass the URL. ### `video_url` — required `string`. Public HTTP(S) URL of the **reference video** — the clip whose motion is transferred onto the subject. MP4 / MOV recommended, ≤ 100MB. The allowed source length depends on `character_orientation` (see below). The **billable second count is the source video's server-probed duration**, not a client estimate. ### `character_orientation` — required `string`. Controls whose facing the subject follows. | Value | Behavior | Source video length | | --------- | -------------------------------------- | ------------------- | | `"image"` | Facing follows the reference **image** | 3 – 10 seconds | | `"video"` | Facing follows the reference **video** | 3 – 30 seconds | ### `mode` — required `string`. Quality / cost tier. | Value | Behavior | | ------- | ------------------------------------------------- | | `"std"` | Standard — balances speed and quality | | `"pro"` | Pro — higher quality, usually slower; higher rate | ### `keep_original_sound` — string, default `"yes"` Whether to retain the reference video's original audio track. | Value | Behavior | | ------- | --------------------------------- | | `"yes"` | Keep the original audio (default) | | `"no"` | Drop the original audio | ### `watermark_info` — object Watermark control. Default disabled. ```json { "watermark_info": { "enabled": false } } ``` | Field | Type | Default | Behavior | | --------- | ------- | ------- | --------------- | | `enabled` | boolean | `false` | Add a watermark | *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "kling-v3-motion-control", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | *** ## Pricing Per-second × `mode`. The billable second count is the source video's **server-probed** length — reApi measures the uploaded clip server-side rather than trusting a client value. `kling-v3-motion-control` and `kling-v2-6-motion-control` have separate per-second rates, and `pro` costs more than `std`. **Bill formula** (1 credit = $0.001): ``` billable_seconds = ceil(server_probed_source_seconds) bill_usd = per_second_usd(tier, mode) × billable_seconds credits = ceil(bill_usd × 1000) ``` See current per-second rates for each tier and mode on the [model page](https://reapi.ai/models/kling-motion-control). Failed jobs refund automatically. A probe failure returns `400 PRICING_UNAVAILABLE` (code `30002`) with no charge. The playground's draft estimate may show a default before the upload finishes — the authoritative number is computed at submit, after the server probes the file. *** ## Validation errors All cases below return HTTP 400. Pattern-match on `code`, not `message` — message strings carry request-specific context and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------------------- | ------- | -------------------------------------------------------------- | | `image_url` missing | `20002` | `kling-motion-control: image_url is required` | | `video_url` missing | `20002` | `kling-motion-control: video_url is required` | | `character_orientation` missing / invalid | `20003` | `kling-motion-control: invalid character_orientation` | | `mode` missing / invalid | `20003` | `kling-motion-control: invalid mode (allowed: std / pro)` | | `keep_original_sound` invalid | `20003` | `kling-motion-control: invalid keep_original_sound` | | `image_url` / `video_url` carrying a `data:` URI | `20003` | `kling-motion-control: image_url must be a public http(s) URL` | | Source video probe fails (network / format) | `30002` | `Could not determine source video duration for billing: …` | | Source video length outside the orientation window | `80007` | Provider rejected the request as invalid | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Minimum request (image orientation) ```json { "model": "kling-v3-motion-control", "prompt": "Follow the reference motion, keep the subject consistent", "image_url": "https://your-cdn.com/subject.png", "video_url": "https://your-cdn.com/motion-8s.mp4", "character_orientation": "image", "mode": "std" } ``` ### Video orientation, pro quality, up to 30s ```json { "model": "kling-v3-motion-control", "prompt": "Follow the reference performance and rhythm, keep motion continuous", "image_url": "https://your-cdn.com/subject.png", "video_url": "https://your-cdn.com/motion-20s.mp4", "character_orientation": "video", "mode": "pro", "keep_original_sound": "no" } ``` ### Budget tier, watermark off ```json { "model": "kling-v2-6-motion-control", "image_url": "https://your-cdn.com/subject.png", "video_url": "https://your-cdn.com/motion-6s.mp4", "character_orientation": "image", "mode": "std", "watermark_info": { "enabled": false } } ``` *** ## Tips * **Match the clip to the orientation.** `character_orientation: "image"` caps the reference video at 10s; use `"video"` when you need up to 30s. * **Cost tracks the source clip.** A 5s reference video bills \~5 seconds; trim the input to control spend. * **Prompt the motion, not just the scene.** Phrasing the action ("turns and waves, smooth and continuous") sharpens the transfer. * **Start on `std`, escalate to `pro`.** Validate the motion on the cheaper mode, then re-run on `pro` for the final take. * **Pick the tier by budget.** `kling-v2-6-motion-control` is the cheaper run; `kling-v3-motion-control` maximizes fidelity and subject consistency. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # midjourney-v7 (https://reapi.ai/docs/midjourney-v7) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Midjourney V7 on reAPI. **Four images per request**, native MJ prompt > syntax (`--ar`, `--s`, `--chaos`, `--sref`, `--oref`, …), and **eleven edit > operations** that chain off any generated image. Async-first: submit > returns a `task_id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/midjourney-v7). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "mj-v7", "prompt": "a serene Japanese garden with cherry blossoms --ar 16:9 --s 500", "model_params": { "speed": "fast" } }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "mj-v7", "prompt": "a serene Japanese garden with cherry blossoms --ar 16:9 --s 500", "model_params": {"speed": "fast"}, }, timeout=30, ) task_id = resp.json()["id"] ``` ```javascript const resp = await fetch('https://reapi.ai/api/v1/images/generations', { method: 'POST', headers: { Authorization: 'Bearer rk_live_xxx', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'mj-v7', prompt: 'a serene Japanese garden with cherry blossoms --ar 16:9 --s 500', model_params: { speed: 'fast' }, }), }); const { id } = await resp.json(); ``` ```go body := strings.NewReader(`{ "model": "mj-v7", "prompt": "a serene Japanese garden with cherry blossoms --ar 16:9 --s 500", "model_params": { "speed": "fast" } }`) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", body) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) ``` Generation is asynchronous. The call returns a `task_id`; poll `GET /api/v1/tasks/:task_id` until `status` is `completed`, then read the image URLs. Each request returns **1–4 images** (content review may filter some) and is billed **once per request**. ## Endpoint ``` POST https://reapi.ai/api/v1/images/generations GET https://reapi.ai/api/v1/tasks/:task_id ``` | Header | Value | | --------------- | -------------------- | | `Authorization` | `Bearer rk_live_xxx` | | `Content-Type` | `application/json` | reAPI accepts only **public http(s) image URLs** for every image input — never base64 or `data:` URIs. For image-to-image, place the URL at the start of the `prompt`; for the direct-image edits, pass it in `image_urls`. ## Models The family is one base generator plus eleven edit operations. Each is a separate `model` id on the same endpoint. | `model` | Operation | References a prior task? | | -------------------- | ------------------------------- | -------------------------------- | | `mj-v7` | Text-to-image / image-to-image | — | | `mj-v7-variation` | Subtle/strong variations | yes (`task_id` + `image_number`) | | `mj-v7-upscale` | Upscale one image | yes | | `mj-v7-remix` | Re-prompt an image | yes | | `mj-v7-enhance` | Enhance a draft image | yes (draft tasks only) | | `mj-v7-pan` | Extend the canvas directionally | yes | | `mj-v7-outpaint` | Zoom out / extend the frame | yes | | `mj-v7-inpaint` | Repaint a masked region | yes | | `mj-v7-edit` | Canvas edit (reposition + fill) | yes | | `mj-v7-remove-bg` | Remove background | no (`image_urls`) | | `mj-v7-retexture` | Re-texture / restyle | no (`image_urls`) | | `mj-v7-upload-paint` | Upload + masked repaint | no (`image_urls`) | The eight parent-referencing edits take the reAPI `task_id` of a **completed Midjourney V7 generation** in `model_params.task_id`, plus `model_params.image_number` (0–3) to pick which of the four grid images to act on. reAPI resolves your task id to the upstream reference automatically. ## Base generation — `mj-v7` | Field | Type | Required | Default | Notes | | -------------------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | — | `mj-v7` | | `prompt` | string | yes | — | Native MJ syntax, ≤ 8192 chars. Image-to-image: place public image URL(s) at the start. A single image with no text is rejected. | | `model_params.speed` | string | no | `fast` | `draft` / `fast` / `turbo` | Native MJ parameters are written **inside the prompt**, not as JSON fields: | Flag | Range | Default | Meaning | | ----------------- | ------------ | ------- | ------------------------------ | | `--ar W:H` | any ratio | `1:1` | Aspect ratio | | `--s` | 0–1000 | 100 | Stylize | | `--chaos` / `--c` | 0–100 | 0 | Variation spread | | `--no` | keywords | — | Negative prompt | | `--seed` | 0–4294967295 | random | Reproducible seed | | `--weird` / `--w` | 0–3000 | 0 | Unconventional degree | | `--exp` | 0–100 | 0 | Experimental aesthetic (V7) | | `--raw` | flag | off | Disable default beautification | | `--tile` | flag | off | Seamless tile | | `--sref [URL]` | URL | — | Style Reference | | `--sw` | 0–1000 | 100 | Style weight | | `--sv` | 1–6 | 4 | Style version | | `--oref [URL]` | URL | — | Omni Reference (doubles cost) | | `--ow` | 1–1000 | 100 | Omni Reference weight | | `--iw` | 0–3 | 1 | Image-prompt weight | `--v` / `--version` / `--niji` are ignored (the version is locked to V7). Speed is set via `model_params.speed`, not a prompt flag. ## Edit operations All edits share the endpoint and the async `task_id` lifecycle. `speed` (where present) is `fast` / `turbo` (default `fast`). ### Parent-referencing edits Common `model_params`: `task_id` (required, the reAPI task id of a completed Midjourney V7 generation), `image_number` (0–3, default 0). | `model` | Extra `model_params` | Top-level `prompt` | | ----------------- | ------------------------------------------------------------------------------------------------------- | ------------------ | | `mj-v7-variation` | `type`: `subtle` \| `strong` (default `subtle`); `speed` | optional | | `mj-v7-upscale` | `type`: `standard` \| `creative` (default `standard`) | — | | `mj-v7-remix` | `mode`: `strong` \| `subtle` (default `strong`); `speed` | **required** | | `mj-v7-enhance` | — (parent must be a `draft` task) | — | | `mj-v7-pan` | `direction`: `down` \| `right` \| `up` \| `left` (default `down`); `scale` 1.1–3 (default 1.5); `speed` | optional | | `mj-v7-outpaint` | `scale` 1.1–2 (default 1.5); `speed` | optional | | `mj-v7-inpaint` | `mask` (required); `speed` | optional | | `mj-v7-edit` | `canvas` (required); `img_pos` (required); `mask` (optional); `speed` | **required** | `mask` is one of two shapes (mutually exclusive): ```json { "mask": { "areas": [ { "width": 200, "height": 200, "points": [50,50,50,250,250,250,250,50] } ] } } ``` ```json { "mask": { "url": "https://example.com/mask.png" } } ``` `points` is a flat `[x1,y1,x2,y2,…]` closed polygon; for the URL form, white = repaint region, black = preserve. `canvas` is `width` / `height` (px); `img_pos` is `width` / `height` / `x` / `y` (placement of the source image on the canvas). Example — upscale image 0 of a prior generation: ```json { "model": "mj-v7-upscale", "model_params": { "task_id": "task_xxx", "image_number": 0, "type": "standard" } } ``` ### Direct-image edits These take the source image in `image_urls` (exactly one public http(s) URL) and do not reference a prior task. | `model` | Required | `model_params` | | -------------------- | ---------------------- | --------------------------------------------------------------------- | | `mj-v7-remove-bg` | `image_urls` | — | | `mj-v7-retexture` | `prompt`, `image_urls` | `speed` (optional) | | `mj-v7-upload-paint` | `prompt`, `image_urls` | `mask` (required), `canvas` (required), `img_pos` (required), `speed` | ## Pricing Midjourney V7 bills **per request** (four images), not per image. Cost scales with: * **Speed tier** — `draft` \< `fast` \< `turbo`. * **Operation** — base generation and lightweight edits (remove-bg, pan, outpaint, enhance) cost less than heavy edits (upscale, variation, remix, inpaint, canvas edit, retexture, upload-paint). * **`--oref`** — Omni Reference in the prompt **doubles** the cost. Integer credits, `1 credit = $0.001`: ``` credits = ceil(request_price_usd × 1000) ``` where `request_price_usd` is the (model, speed) rate, doubled when the prompt carries `--oref`. See the [model page](https://reapi.ai/models/midjourney-v7) for current rates. ## Output Poll `GET /api/v1/tasks/:task_id`. On `completed`: ```json { "id": "task_xxx", "status": "completed", "output": { "image_urls": ["https://cdn.reapi.ai/.../0.png", "https://cdn.reapi.ai/.../1.png"] } } ``` `output.image_urls` holds 1–4 URLs (content review may filter some of the four). Save them promptly. ## Errors Customer-facing errors use the standard envelope `{ error: { code, message, request_id } }`. Common cases: | Situation | Code | | ----------------------------------------------------- | -------------------------- | | Prompt rejected by content review | `CONTENT_POLICY_VIOLATION` | | Malformed / out-of-range request | `INVALID_REQUEST` | | Referenced task not found / not yours / not completed | `INVALID_REQUEST` | | Insufficient credits | `INSUFFICIENT_CREDITS` | | Upstream generation failed | `UPSTREAM_ERROR` | See the full catalog at [/docs/api/errors](/docs/api/errors). ## Tips * A single reference image with no text is rejected — add a short description. * Use `--oref` for subject consistency and `--sref` for style transfer; they combine. `--oref` doubles the bill, so reserve it for shots that need it. * Generate with `mj-v7` first, then chain `mj-v7-upscale` / `mj-v7-variation` / `mj-v7-inpaint` off the returned `task_id` — no re-upload needed. * `mj-v7-enhance` only accepts a parent created with `speed: "draft"`. * Keep the version implicit — `--v` / `--niji` are ignored on V7. ## Related * [Model page & live playground](https://reapi.ai/models/midjourney-v7) * [API quickstart](/docs/api/quickstart) * [Error codes](/docs/api/errors) --- # midjourney-v8 (https://reapi.ai/docs/midjourney-v8) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Midjourney V8 on reAPI. One `midjourney` model with an `action` parameter > covering generation, blend, edit, and the upscale / variation / zoom / pan / > reroll / reshape toolkit; a separate `midjourney-video` model animates a > still into a short clip. Async-first: submit returns a `task_id`; poll until > ready. See current pricing on the > [model page](https://reapi.ai/models/midjourney-v8). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "midjourney", "prompt": "a serene Japanese garden with cherry blossoms, painterly", "version": "8.1", "size": "16:9", "speed": "fast" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "midjourney", "prompt": "a serene Japanese garden with cherry blossoms, painterly", "version": "8.1", "size": "16:9", "speed": "fast", }, timeout=30, ) task_id = resp.json()["data"][0]["task_id"] ``` ```javascript const resp = await fetch('https://reapi.ai/api/v1/images/generations', { method: 'POST', headers: { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'midjourney', prompt: 'a serene Japanese garden with cherry blossoms, painterly', version: '8.1', size: '16:9', speed: 'fast', }), }); const { data } = await resp.json(); ``` ```go body := strings.NewReader(`{ "model": "midjourney", "prompt": "a serene Japanese garden with cherry blossoms, painterly", "version": "8.1", "size": "16:9", "speed": "fast" }`) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", body) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) ``` Generation is asynchronous. The call returns a `task_id`; poll `GET /api/v1/tasks/:task_id` until `status` is `completed`, then read the image URLs. Generation returns **1–4 images** (content review may filter some) and is billed **once per request**. ## Endpoint ``` POST https://reapi.ai/api/v1/images/generations # midjourney (image) POST https://reapi.ai/api/v1/videos/generations # midjourney-video GET https://reapi.ai/api/v1/tasks/:task_id ``` | Header | Value | | --------------- | --------------------- | | `Authorization` | `Bearer YOUR_API_KEY` | | `Content-Type` | `application/json` | reAPI accepts only **public http(s) URLs** for every media input (`image_urls`, `cref`, `sref`, `dref`, `mask_url`, …) — never base64 or `data:` URIs. ## Operations — `action` `midjourney` runs one operation per request, selected by `action` (default `imagine`). All share the images endpoint. | `action` | Operation | References a prior task? | | ---------------- | ------------------------------- | ------------------------- | | `imagine` | Text-to-image / image-to-image | — | | `blend` | Fuse 2–4 images | — | | `edits` | Rewrite an image from a prompt | — | | `upscale` | Upscale one tile | yes (`task_id` + `index`) | | `variation` | Variations of one tile | yes | | `high_variation` | Strong variation | yes | | `low_variation` | Subtle variation | yes | | `reroll` | Re-roll the whole grid | yes (`task_id`) | | `zoom` | Zoom out / outpaint | yes | | `pan` | Extend the canvas directionally | yes | | `remix_strong` | Strong reshape (v8.1 / v8.2) | yes (`task_id` + `index`) | | `remix_subtle` | Subtle reshape (v8.1 / v8.2) | yes | The parent-referencing actions take the reAPI `task_id` of a **completed `midjourney` task** plus `index` (1–4) to pick which grid image to act on. reAPI resolves your task id to the upstream reference automatically. ## Generate — `action: "imagine"` | Field | Type | Required | Default | Notes | | ------------ | --------- | -------- | --------- | --------------------------- | | `model` | string | yes | — | `midjourney` | | `action` | string | no | `imagine` | Operation selector | | `prompt` | string | yes | — | Image description | | `image_urls` | string\[] | no | — | Image-to-image reference(s) | | `speed` | string | no | `relax` | `relax` / `fast` / `turbo` | The structured parameters below are the JSON form of Midjourney's native `--flags`. You may also type the flags into `prompt`; a body field overrides the matching flag. Ranges mirror Midjourney exactly. | Field | Flag | Range / values | Notes | | ----------------- | ----------- | ------------------------------------------- | --------------------------------------- | | `size` | `--ar` | e.g. `16:9`, `1:1`, `9:16` | Aspect ratio | | `quality` | `--q` | `0.25` / `0.5` / `1` / `2` | Render quality | | `style` | `--style` | e.g. `raw` | Style preset | | `version` | `--v` | `8.2` / `8.1` / `7` / `6.1` / `5.2` / `5.1` | Model version | | `seed` | `--seed` | integer | Reproducible seed | | `negative_prompt` | `--no` | keywords | What to avoid | | `stylize` | `--s` | 0–1000 | Stylization strength | | `chaos` | `--c` | 0–100 | Grid variety | | `weird` | `--w` | 0–3000 | Unconventional degree | | `tile` | `--tile` | boolean | Seamless tile | | `niji` | `--niji` | boolean | Anime model (pair with `version` 7 / 6) | | `iw` | `--iw` | 0–3 | Image-prompt weight | | `cw` | `--cw` | 0–100 | Character-reference weight | | `sw` | `--sw` | 0–1000 | Style-reference weight | | `cref` | `--cref` | URL | Character reference | | `sref` | `--sref` | URL | Style reference | | `dref` | `--dref` | URL | Depth reference | | `dw` | `--dw` | 0–100 | Depth-reference weight | | `repeat` | `--repeat` | 2–40 | Repeat the prompt | | `raw` | `--raw` | boolean | Raw mode (v5.1+) | | `draft` | `--draft` | boolean | Draft mode (v7+) | | `hd` | `--hd` | boolean | HD (v8.1 / v8.2) | | `stop` | `--stop` | 10–100 | Stop early (v5–6.1 / niji 5–6) | | `extra` | any `--xxx` | string | Appended to the prompt verbatim | | `metadata` | — | object | Opaque, stored with the task | Online-verified versions: `8.2`, `8.1`, `7`, `6.1`, `5.2`, `5.1`, plus niji 7 / niji 6 (set `niji: true` with `version: "7"` or `"6"`). The version does not change the price. ## Follow-up operations All follow-ups share the images endpoint and the async `task_id` lifecycle. Common fields: `task_id` (required, a completed `midjourney` task), `index` (1–4, which grid image), `speed`. | `action` | Extra fields | Notes | | ------------------------------------------------ | ---------------------------- | ---------------------------------------------------------------------------------------------- | | `upscale` | `index` | Upscale one tile | | `variation` / `high_variation` / `low_variation` | `index` | Variation strength differs | | `reroll` | — | Re-rolls the whole grid (no `index`) | | `zoom` | `index`; `zoom_ratio` | Below 2 = 1.5× outpaint, 2 and up = 2× custom zoom | | `pan` | `index`; `direction` | `direction`: `left` / `right` / `up` / `down`; v6+ / niji 6 parents only (v5.x fails upstream) | | `remix_strong` / `remix_subtle` | `index` (required); `prompt` | v8.1 / v8.2 only | `blend` takes `image_urls` (2–4) and an optional aspect ratio: free-form `size` (any `w:h`) or three-step `dimensions` (`SQUARE` / `PORTRAIT` / `LANDSCAPE`); `size` overrides `dimensions`. `edits` takes `prompt` + `image_urls` plus the same structured params as `imagine`. Example — upscale tile 1 of a prior generation: ```json { "model": "midjourney", "action": "upscale", "task_id": "task_xxx", "index": 1 } ``` ## Image-to-video — `midjourney-video` Animate a still — or one image of a completed `midjourney` grid — into a short (\~5 second) clip on the videos endpoint. Supply exactly one of `image_urls` (a start frame; `prompt` required) or `task_id` (a completed `midjourney` task of yours; reAPI resolves it upstream automatically). | Field | Type | Required | Default | Notes | | -------------- | --------- | -------- | ----------------- | ---------------------------------------------------------------- | | `model` | string | yes | — | `midjourney-video` | | `image_urls` | string\[] | one of | — | Start frame (exactly one URL); requires `prompt` | | `task_id` | string | one of | — | Completed `midjourney` task to animate | | `index` | integer | no | — | `0`–`3` — which grid image (`task_id` path) | | `prompt` | string | no | parent prompt | Required with `image_urls`; optional with `task_id` | | `video_type` | string | no | `vid_1.1_i2v_480` | `vid_1.1_i2v_480` / `_720` / `_start_end_480` / `_start_end_720` | | `animate_mode` | string | no | `manual` | `manual` / `auto`; `auto` requires `task_id` + `index` | | `motion` | string | no | `high` | `low` / `high` | | `batch_size` | integer | no | `1` | `1` / `2` / `4` (clips returned) | | `end_url` | string | no | — | End frame (upgrades to a start-end type) | ## Pricing `midjourney` bills **per request** (a 4-image grid for generation; one image for upscale and the like). The bill depends only on: * **Operation tier** — generation vs every other image action. * **Speed** — `relax` / `fast` / `turbo`. The model version never changes the price. `midjourney-video` bills per resolution (480p / 720p) × `batch_size`. Integer credits, `1 credit = $0.001`: ``` credits = ceil(request_price_usd × 1000) # midjourney credits = ceil(clip_price_usd × batch_size × 1000) # midjourney-video ``` See the [model page](https://reapi.ai/models/midjourney-v8) for current rates. ## Output Poll `GET /api/v1/tasks/:task_id`. On `completed`: ```json { "id": "task_xxx", "status": "completed", "output": { "image_urls": ["https://cdn.reapi.ai/.../0.png", "https://cdn.reapi.ai/.../1.png"] } } ``` `output.image_urls` holds 1–4 URLs (content review may filter some). `midjourney-video` returns `output.video_urls`. Save them promptly. ## Errors Customer-facing errors use the standard envelope `{ error: { code, message, request_id } }`. Common cases: | Situation | Code | | ----------------------------------------------------- | -------------------------- | | Prompt rejected by content review | `CONTENT_POLICY_VIOLATION` | | Malformed / out-of-range request | `INVALID_REQUEST` | | Referenced task not found / not yours / not completed | `INVALID_REQUEST` | | Insufficient credits | `INSUFFICIENT_CREDITS` | | Upstream generation failed | `UPSTREAM_ERROR` | See the full catalog at [/docs/api/errors](/docs/api/errors). ## Tips * Generate with `imagine` first, then chain `upscale` / `variation` / `zoom` / `pan` / `remix_strong` off the returned `task_id` — no re-upload needed. * A body field overrides the matching `--flag` in the prompt, so pick one. * `relax` is the cheapest and the default; `fast` / `turbo` only change queue priority and price, not the visual result. * `remix_strong` / `remix_subtle` require a v8.1 / v8.2 parent; use the variation actions for older versions. * All references (`cref` / `sref` / `dref`, blend inputs) must be public http(s) URLs. ## Related * [Model page & live playground](https://reapi.ai/models/midjourney-v8) * [API quickstart](/docs/api/quickstart) * [Error codes](/docs/api/errors) --- # minimax-h3 (https://reapi.ai/docs/minimax-h3) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > MiniMax H3 (also released as Hailuo 03) — a single async video endpoint that > auto-routes between **T2V / I2V / R2V** based on which media fields your > request carries. Up to 2K output with native stereo audio, 4–15 second > clips. See current pricing on the > [model page](https://reapi.ai/models/minimax-h3). Generation is **asynchronous**: the POST returns a task id, then poll [`GET /api/v1/tasks/{id}`](/docs/api/tasks) until `status` is `completed`. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-h3", "prompt": "A cat walking slowly on the beach at sunset, cinematic shot, waves gently lapping the shore", "aspect_ratio": "16:9", "duration": 6 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "minimax-h3", "prompt": "A cat walking slowly on the beach at sunset, cinematic shot", "aspect_ratio": "16:9", "duration": 6, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "minimax-h3", prompt: "A cat walking slowly on the beach at sunset, cinematic shot", aspect_ratio: "16:9", duration: 6, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "minimax-h3", "prompt": "A cat walking slowly on the beach at sunset, cinematic shot", "aspect_ratio": "16:9", "duration": 6, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var out map[string]any json.NewDecoder(resp.Body).Decode(&out) fmt.Println(out) } ``` ## Endpoint ```http POST /api/v1/videos/generations Authorization: Bearer YOUR_API_KEY Content-Type: application/json ``` Submitting returns a task id; poll [`GET /api/v1/tasks/{id}`](/docs/api/tasks) for the result. Polling does not consume credits. ## Parameters | Parameter | Type | Required | Default | Description | | ---------------------- | --------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | — | `minimax-h3` | | `prompt` | string | yes | — | 1–7,000 characters. Describe visuals **and** audio (dialogue, music, ambience, SFX) in the same prompt. | | `first_frame_url` | string | I2V\* | — | First-frame image URL. Presence selects **image-to-video**. JPG/JPEG/PNG/WEBP/HEIC/HEIF, ≤30MB, sides 256–5760px, ratio 0.4–2.5. | | `last_frame_url` | string | I2V\* | — | Last-frame image URL. Same limits as `first_frame_url`. | | `reference_image_urls` | string\[] | R2V\*\* | — | Up to **9** reference image URLs. Presence selects **reference-to-video**. Same image limits as above. First 5 are free; images 6–9 bill per image. | | `reference_video_urls` | string\[] | R2V\*\* | — | Up to **3** reference video URLs. MP4/MOV (H.264/H.265; AAC/MP3 audio), ≤50MB each, each clip 2–15s, **all clips together ≤15s**, sides 256–5760px, ratio 0.4–2.5, 23.976–60 fps. Their probed duration bills on top of the output duration. | | `reference_audio_urls` | string\[] | no | — | Up to **3** reference audio URLs. WAV/MP3, ≤15MB each, each 2–15s, total ≤15s. Free. Cannot be used alone — requires an image or video reference. | | `aspect_ratio` | enum | T2V: yes | R2V: `adaptive` | `21:9` `16:9` `4:3` `1:1` `3:4` `9:16` (+ `adaptive`, reference mode only). Required in T2V (`adaptive` rejected); not accepted in I2V (orientation derives from the source image). | | `duration` | integer | no | `6` | Output length in whole seconds, `4`–`15`. | \* In I2V, provide `first_frame_url`, `last_frame_url`, or both. \*\* In R2V, provide `reference_image_urls` or `reference_video_urls` (audio alone is not accepted). Frames (`first_frame_url` / `last_frame_url`) and reference inputs (`reference_*_urls`) are **mutually exclusive**. All media inputs must be public HTTP(S) URLs — base64 / `data:` URIs are rejected. ## Modes Mode is implicit — selected by which inputs you send: | Mode | Trigger | prompt | aspect\_ratio | | ---------------------------- | ------------------------------------ | -------- | ---------------------------- | | **Text-to-video (T2V)** | no media | required | required, no `adaptive` | | **Image-to-video (I2V)** | `first_frame_url` / `last_frame_url` | required | not accepted (from image) | | **Reference-to-video (R2V)** | `reference_*_urls` | required | optional, default `adaptive` | ```json // I2V — animate between two frames { "model": "minimax-h3", "prompt": "the character turns and smiles, camera pushes in", "first_frame_url": "https://…/first.jpg", "last_frame_url": "https://…/last.jpg", "duration": 6 } // R2V — identity from images, motion from a clip, voice from audio { "model": "minimax-h3", "prompt": "a continuous cinematic scene using the referenced character, motion, and voice", "reference_image_urls": ["https://…/id.jpg"], "reference_video_urls": ["https://…/motion.mp4"], "reference_audio_urls": ["https://…/voice.mp3"], "duration": 8 } ``` ## Pricing Billed **per second** at one flat 2K rate; the routing mode does not change the rate. Three components: * **Output seconds** — the requested `duration`. * **Input video seconds** — the server-probed total duration of `reference_video_urls` is added to the billable seconds (the vendor processes input and output footage alike). * **Extra reference images** — the first 5 are free; images 6–9 bill a flat per-image rate. Audio input is free. See the [model page](https://reapi.ai/models/minimax-h3) for current rates. **Bill formula** (`1 credit = $0.001`): ``` credits = ceil((per_second_usd × (duration + input_video_seconds) + extra_image_usd × max(0, reference_images − 5)) × 1000) ``` If a reference video URL cannot be probed for duration, the request is rejected before any charge — billing never falls back to client-stated values. ## Output On success, `GET /api/v1/tasks/{id}` returns: ```json { "id": "task_…", "model": "minimax-h3", "status": "completed", "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/…/0.mp4"] }, "error": null } ``` The clip includes its native stereo audio track in the MP4. ## Errors | HTTP | `code` | When | | ---- | ----------------- | -------------------------------------------------------------------------------------------------------------------------- | | 400 | `20002` | Missing / invalid parameter (e.g. `aspect_ratio` missing in T2V, frames mixed with references, audio reference used alone) | | 400 | `30002` | Pricing unavailable (e.g. a reference video's duration could not be probed) | | 401 | `10001` – `10005` | Auth missing / invalid / revoked | | 402 | `30001` | Insufficient credits | | 429 | `50001` | Per-user rate limit exceeded | Failed generations are surfaced under `error` in the polling response and are refunded automatically. Full catalog: [Errors](/docs/api/errors). ## Tips * **Direct the audio in the prompt.** MiniMax H3 renders sound with the picture — describe dialogue lines, music mood, ambience, and effect cues alongside the visual action for the tightest sync. * **Assign roles to references.** In R2V, say what each asset controls (identity, motion, camera language, voice); it reduces conflicts between reference materials. * **Watch reference-video length.** Input clips bill their own seconds on top of the output — a 12s reference plus a 10s output bills as 22s. * `aspect_ratio` is rejected in I2V — crop your frames to the orientation you want instead. * Longer `duration` scales the bill linearly; start at the 6s default while iterating. ## Related * [Tasks](/docs/api/tasks) — universal polling endpoint * [Errors](/docs/api/errors) — full error catalog * [seedance-2-0](/docs/seedance-2-0) — sibling multimodal video family * [veo3-1](/docs/veo3-1) — premium video generation with optional audio --- # minimax-m3 (https://reapi.ai/docs/minimax-m3) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > MiniMax M3 is an open-weight model that pairs frontier coding and agentic > benchmarks with a 1M-token context window and native multimodal input — > exposed through api.reapi.ai as a drop-in OpenAI-compatible Chat > Completions endpoint. 1M context, 512K max output, native thinking, image > and video input, prompt caching, and tool use. The wire `model` id is > `minimax/minimax-m3`. Current rates live on the > [model page](https://reapi.ai/models/minimax-m3) and on > [api.reapi.ai/pricing](https://api.reapi.ai/pricing). ## Quick example ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax/minimax-m3", "group": "default", "messages": [ { "role": "user", "content": "Hello" } ], "stream": true, "max_tokens": 4096, "temperature": 1.0 }' ``` ```python from openai import OpenAI client = OpenAI( api_key="YOUR_API_KEY", base_url="https://api.reapi.ai/v1", ) stream = client.chat.completions.create( model="minimax/minimax-m3", messages=[{"role": "user", "content": "Hello"}], stream=True, max_tokens=4096, temperature=1.0, extra_body={"group": "default"}, ) for chunk in stream: delta = chunk.choices[0].delta.content or "" print(delta, end="", flush=True) ``` ```js import OpenAI from "openai"; const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.reapi.ai/v1", }); const stream = await client.chat.completions.create({ model: "minimax/minimax-m3", messages: [{ role: "user", content: "Hello" }], stream: true, max_tokens: 4096, temperature: 1.0, // `group` is an api.reapi.ai-specific extension; pass via extra body. // @ts-expect-error — not part of the OpenAI types group: "default", }); for await (const chunk of stream) { process.stdout.write(chunk.choices[0]?.delta?.content ?? ""); } ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "minimax/minimax-m3", "group": "default", "messages": []map[string]string{ {"role": "user", "content": "Hello"}, }, "stream": true, "max_tokens": 4096, "temperature": 1.0, }) req, _ := http.NewRequest("POST", "https://api.reapi.ai/v1/chat/completions", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Authentication Every request needs a Bearer token. The MiniMax M3 chat workspace lives on the `api.reapi.ai` platform — sign in there to create a key and top up tokens. 1. Open [api.reapi.ai](https://api.reapi.ai/) and sign in (or create an account). 2. Generate an API key under **API Keys**. 3. Top up tokens under **Top Up** (pay-as-you-go, billed in USD per 1M tokens — see [api.reapi.ai/pricing](https://api.reapi.ai/pricing)). ```http Authorization: Bearer YOUR_API_KEY ``` The chat surface (api.reapi.ai) is a **separate workspace** from the image/video/audio task gateway at `reapi.ai/api/v1/*`. Keys and balances do not cross over — a key issued on `reapi.ai/settings/apikeys` will not authenticate against `api.reapi.ai/v1/chat/completions`, and vice versa. *** ## Endpoint ```http POST https://api.reapi.ai/v1/chat/completions ``` Drop-in for the OpenAI SDKs — same request shape, same SSE wire format. Set `base_url` to `https://api.reapi.ai/v1` and `model` to `minimax/minimax-m3`. *** ## Request body ### `model` — string, required Must be `"minimax/minimax-m3"`. Echoed back in the response envelope. ### `messages` — array, required Conversation history as an array of message objects. Same shape as the OpenAI Chat Completions spec, plus content-parts for image and video input: ```json { "role": "system" | "user" | "assistant" | "tool", "content": "string OR content-parts array (text + image_url + video_url parts)" } ``` Multi-turn history is sent in chronological order — the last message is the one the model responds to. Strip a prior turn's reasoning content before re-sending it in `messages`. ### `max_tokens` — integer, default `4096` Upper bound on output tokens for this response, **including the chain-of-thought when MiniMax M3 is thinking**. The synchronous API supports up to **512K** output tokens (128K recommended) — set it generously for long-form or reasoning-heavy outputs. ### `stream` — boolean, default `false` When `true`, the response is streamed as server-sent events (SSE) with `Content-Type: text/event-stream`. Each event is a JSON delta in the OpenAI format, terminated by a `data: [DONE]` line. ### `temperature` — number, default `1` Sampling temperature. Lower values produce more deterministic output. ### `top_p` — number, default `0.95` Nucleus sampling cutoff. ### `tools` / `tool_choice` — optional Standard OpenAI tool-calling parameters. MiniMax M3 is tuned for agentic, multi-step workflows with reliable function calling and JSON output, and it can interleave reasoning with tool calls across a long run. ### `group` — string, default `"default"` api.reapi.ai-specific extension. Selects a token group on the gateway, which routes the request to a specific upstream channel pool. Omit if default routing is fine. *** ## Thinking MiniMax M3 is a native thinking model: it reasons before it answers and can interleave reasoning with tool calls during a multi-step run. Thinking is **adaptive by default** — the model reasons on hard tasks and answers directly on simple ones. When the model thinks, the chain-of-thought is returned in a `reasoning_content` field alongside `content`: ```json { "choices": [ { "index": 0, "message": { "role": "assistant", "reasoning_content": "Let me work through this step by step...", "content": "The final answer." }, "finish_reason": "stop" } ] } ``` For latency-sensitive or simple calls you can disable thinking for faster, cheaper responses. Strip `reasoning_content` from assistant messages before sending them back in a follow-up request — the chain-of-thought from a previous turn is not meant to be re-fed as input. *** ## Multimodal input MiniMax M3 is natively multimodal — send images and video alongside text via OpenAI content-parts: ```json { "model": "minimax/minimax-m3", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "What does this chart show?" }, { "type": "image_url", "image_url": { "url": "https://example.com/chart.png" } } ] } ] } ``` Video frames are passed the same way via `video_url` content-parts. Each image or video counts toward the input token budget based on its resolution and length. *** ## Prompt caching MiniMax M3 caches stable prompt prefixes. When a request reuses a cached prefix, those input tokens bill at a small fraction of the standard input rate — a big saving for agent loops and chatbots that replay long system prompts and tool schemas. The `usage.prompt_tokens_details.cached_tokens` field reports how many input tokens were served from cache. *** ## Response shape ### Non-streaming (`stream: false`) ```json { "id": "chatcmpl-018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "object": "chat.completion", "created": 1735000000, "model": "minimax/minimax-m3", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 12, "completion_tokens": 9, "total_tokens": 21, "prompt_tokens_details": { "cached_tokens": 0 } } } ``` When the model thinks, `message.reasoning_content` carries the chain-of-thought alongside `content`. ### Streaming (`stream: true`) `Content-Type: text/event-stream`. Each `data:` line is a JSON delta in the OpenAI chunk format; the final event before `[DONE]` carries the `finish_reason` (`stop` / `length` / `tool_calls` / `content_filter`). *** ## Pricing MiniMax M3 is billed **pay-as-you-go in USD** against your api.reapi.ai token balance. It bills along three dimensions — input tokens, output tokens, and cache-read tokens. Current rates live on [api.reapi.ai/pricing](https://api.reapi.ai/pricing) and in the pricing card at the top of the [model page](https://reapi.ai/models/minimax-m3). Per-call bill: ``` billable_input = (prompt_tokens - cached_tokens) × input_rate / 1,000,000 cache_read_bill = cached_tokens × cache_read_rate / 1,000,000 output_bill = completion_tokens × output_rate / 1,000,000 ``` Output tokens include the chain-of-thought when the model is thinking. Failed requests are not charged. *** ## Limits | Limit | Value | | ------------------- | ----------- | | Context window | 1M tokens | | Max output per call | 512K tokens | Streams that hit the output cap finish with `finish_reason: "length"`; call again with a continuation message if you need more text. *** ## Errors The error envelope follows the OpenAI shape — HTTP status, plus a JSON body: ```json { "error": { "message": "...", "type": "invalid_request_error", "code": "..." } } ``` Common cases: | Status | When | Notes | | ------ | ------------------------------------------ | -------------------------------------------- | | `400` | Bad request shape, unsupported param combo | Check the `messages` array and `model` id | | `401` | Missing / invalid API key | Re-issue a key at api.reapi.ai | | `402` | Insufficient balance | Top up at api.reapi.ai | | `429` | Per-group rate limit hit | Back off, or move to a different `group` | | `500` | Upstream / gateway error | Safe to retry — failed calls are not charged | api.reapi.ai does **not** internally retry chat requests. Every customer call maps to exactly one upstream POST. If a network error reaches you, that is a one-for-one wire failure and a retry from your side is safe; the gateway will not double-bill. *** ## Recipes ### Minimum request ```json { "model": "minimax/minimax-m3", "max_tokens": 4096, "messages": [ { "role": "user", "content": "Summarise this in three sentences." } ] } ``` ### Tool use (function calling) ```json { "model": "minimax/minimax-m3", "max_tokens": 4096, "messages": [ { "role": "user", "content": "What's the weather in Tokyo today?" } ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Look up the current weather for a city.", "parameters": { "type": "object", "properties": { "city": { "type": "string" } }, "required": ["city"] } } } ], "tool_choice": "auto" } ``` ### Vision ```json { "model": "minimax/minimax-m3", "max_tokens": 4096, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read the error in this screenshot and suggest a fix." }, { "type": "image_url", "image_url": { "url": "https://your-cdn.com/screenshot.png" } } ] } ] } ``` ### Long-context analysis ```json { "model": "minimax/minimax-m3", "max_tokens": 8192, "messages": [ { "role": "system", "content": "" }, { "role": "user", "content": "List every mention of constraint X with line numbers." } ] } ``` Keep the long reference block stable across calls so the cache-read rate applies on subsequent requests. *** ## When to pick MiniMax M3 Pick MiniMax M3 when you want frontier coding and agentic capability at open-weight pricing: * **Long-horizon agentic coding** — multi-file refactors, tool-using agents, and runs that must stay on-task across many steps. * **Million-token analysis** — whole repositories, long research packs, and multi-document review in a single call. * **Multimodal workflows** — tasks that mix screenshots, diagrams, video, and code in one conversation. Route lighter traffic (classification, short replies, tight loops) to a cheaper model on the same key. *** ## Tips * **Set `max_tokens` generously when the task is hard.** The chain-of-thought counts toward the output budget; a low cap can truncate before the final answer. * **Strip `reasoning_content` before the next turn.** Re-feeding a prior turn's chain-of-thought as input is not supported. * **Stream by default for chat UX.** Streaming cuts perceived latency. * **Cache stable prefixes.** Reuse the same system prompt and tool schemas across calls to bill repeated input at the low cache-read rate. * **Disable thinking for simple, latency-sensitive calls.** Adaptive thinking already skips reasoning on easy prompts, but you can force it off when you never need the chain-of-thought. *** ## Related * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Errors catalog](/docs/api/errors) --- # Multistem Splitter API (https://reapi.ai/docs/multistem-splitter) # Multistem Splitter API Use `audio-multistem` to extract up to six supported stems from one public audio URL. ## Endpoint ```http POST /api/v1/audio/generations ``` Poll completion with: ```http GET /api/v1/tasks/{id} ``` ## Example ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "audio-multistem", "audio_url": "https://cdn.example.com/song.wav", "stem_list": ["vocals", "drum", "bass"], "encoder_format": "mp3" }' ``` ## Parameters | Field | Type | Required | Notes | | ------------------ | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Use `audio-multistem`. | | `audio_url` | URL | yes | Public HTTP(S) source audio URL. | | `stem_list` | enum\[] | yes | 1-6 values: `vocals`, `drum`, `piano`, `bass`, `electric_guitar`, `acoustic_guitar`. | | `splitter` | enum | no | `auto`, `andromeda`, `perseus`, `orion`, `phoenix`, `lyra`, or `lynx`. `auto` is omitted upstream so the default engine is used. | | `extraction_level` | enum | no | `deep_extraction` or `clear_cut`. Defaults to `deep_extraction`. | | `dereverb_enabled` | boolean | no | Enable dereverb cleanup. | | `encoder_format` | enum | no | `mp3`, `wav`, `flac`, `aac`, or `ogg`. | ## Output Completed tasks return `output.audio_urls` and, when available, labeled `output.tracks`. Multistem jobs are billed per rounded-up source minute, multiplied by the selected stem count. See current rate on the [Multistem Splitter model page](https://reapi.ai/models/multistem-splitter). --- # Mureka V9 Song API (https://reapi.ai/docs/mureka-v9-song) # Mureka V9 Song API Use `mureka-v9-song` to turn written lyrics into one or more fully produced songs. Each call is asynchronous: submit the task, poll for completion, then fetch the rendered audio from the returned URLs. ## Endpoint ```http POST /api/v1/audio/generations ``` Poll completion with: ```http GET /api/v1/tasks/{id} ``` The task stays in `processing` until the song is rendered; final URLs land in `output.audio_urls` when the status flips to `completed`. ## Example ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mureka-v9-song", "lyrics": "Verse 1...\nChorus...\nVerse 2...", "prompt": "Emotional pop ballad with piano, warm strings, cinematic chorus, expressive female vocal, polished modern production", "number_of_songs": 1, "output_format": "mp3" }' ``` ## Parameters | Field | Type | Required | Notes | | ----------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `mureka-v9-song`. | | `lyrics` | string | yes | Lyrics for the song. Up to 3000 characters. | | `prompt` | string | no | Optional style prompt — genre, mood, instrumentation, vocal tone, tempo, production feel. Up to 1024 characters. | | `number_of_songs` | integer | no | `1`, `2`, or `3`. Defaults to `1`. Each additional song multiplies the per-request cost. | | `output_format` | enum | no | `mp3`, `wav`, or `flac`. Defaults to `mp3`. | | `reference_id` | string | no | Optional Mureka reference-track ID for tighter style guidance. | | `vocal_id` | string | no | Optional Mureka vocal-reference ID. | | `melody_id` | string | no | Optional Mureka melody-reference ID. | The three reference IDs are minted by Mureka's own upload system. ReAPI forwards them verbatim and does not proxy uploads — bring an ID you already have, or omit them entirely for fully generated songs. ## Output Successful tasks return one URL per generated song in `output.audio_urls`. With `number_of_songs: 3` the array contains three URLs, all in the same format selected by `output_format`. ## Pricing Billed per generated song. Only `number_of_songs` affects pricing — `prompt`, `output_format`, and the three reference IDs are free to use. See current rates on the [Mureka V9 model page](https://reapi.ai/models/mureka-v9-song). ## Tips * Structure lyrics with clear `Verse` / `Chorus` / `Bridge` blocks for better arrangement. * Use the style prompt to pin genre, tempo, and vocal character — Mureka follows these strongly. * Set `number_of_songs > 1` when you want quick variations from the same lyrics. * Use a reference ID only when you want the model to track a specific vocal or melody — without one it composes freely from the lyrics + prompt. * Stick with `mp3` while iterating; switch to `wav` or `flac` for final mastering. --- # Music Extractor API (https://reapi.ai/docs/music-extractor) import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; # Music Extractor API Use `audio-music-extractor` to extract the background music (instrumental bed) from a public source audio URL — the inverse of a vocal remover's "vocals" output. Typical uses: karaoke tracks, sampling, replacing a vocal take while keeping the original arrangement, and preparing beds for video. ## Endpoint ```http POST /api/v1/audio/generations ``` Poll completion with: ```http GET /api/v1/tasks/{id} ``` ## Example ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "audio-music-extractor", "audio_url": "https://cdn.example.com/mix.wav", "encoder_format": "mp3" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/audio/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "audio-music-extractor", "audio_url": "https://cdn.example.com/mix.wav", "encoder_format": "mp3", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/audio/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "audio-music-extractor", audio_url: "https://cdn.example.com/mix.wav", encoder_format: "mp3", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "audio-music-extractor", "audio_url": "https://cdn.example.com/mix.wav", "encoder_format": "mp3", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/audio/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ## Parameters | Field | Type | Required | Notes | | ------------------ | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Use `audio-music-extractor`. | | `audio_url` | URL | yes | Public HTTP(S) source audio URL. Base64 / `data:` URIs are rejected platform-wide. | | `splitter` | enum | no | `auto`, `andromeda`, `perseus`, `orion`, `phoenix`, `lyra`, or `lynx`. `auto` is omitted upstream so the default engine is used. | | `dereverb_enabled` | boolean | no | Enable dereverb cleanup. | | `encoder_format` | enum | no | `mp3`, `wav`, `flac`, `aac`, or `ogg`. | Requests are strictly validated: unknown fields are rejected with `400` rather than ignored. ## Output Completed tasks return `output.audio_urls` and, when available, labeled `output.tracks` (each with `type`, `label`, and `url`): ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "status": "completed", "output": { "audio_urls": ["https://cdn.reapi.ai/.../music.mp3"] } } ``` ## Billing Audio jobs are billed per rounded-up source minute — a 2:30 source bills as 3 minutes. Failed jobs refund automatically. See the current per-minute rate on the [Music Extractor model page](https://reapi.ai/models/music-extractor). ## Which audio model do I need? | Goal | Model | Docs | | --------------------------------- | -------------------------------------------- | ---------------------------------------------- | | Keep the music, drop the vocals | `audio-music-extractor` | this page | | Keep the vocals, drop the music | `audio-stem-separator` with `stem: "vocals"` | [Vocal Remover](/docs/vocal-remover) | | Split several instruments at once | `audio-multistem` | [Multistem Splitter](/docs/multistem-splitter) | | Denoise / de-reverb speech | `audio-voice-clean` | [Voice Cleaner](/docs/voice-cleaner) | | Convert vocals to another voice | `audio-voice-change` | [Voice Changer](/docs/voice-changer) | ## Related * [Tasks & polling](/docs/api/tasks) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) --- # music-video-1-0 (https://reapi.ai/docs/music-video-1-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Music Video 1.0 turns a **song** into a **music video**. Pass an audio > track plus **1-7 reference images** (the visual style/model) and the API > returns a video synced to the song. One async endpoint, five aspect ratios, > up to 1080P, optional burned-in subtitles. Billing is per second of the > song's server-probed length. See current pricing on the > [model page](https://reapi.ai/models/music-video-1-0). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "music-video-1-0", "reference_image_urls": ["https://your-cdn.com/style.png"], "audio_url": "https://your-cdn.com/song.mp3", "aspect_ratio": "16:9", "resolution": "540P" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "music-video-1-0", "reference_image_urls": ["https://your-cdn.com/style.png"], "audio_url": "https://your-cdn.com/song.mp3", "aspect_ratio": "16:9", "resolution": "540P", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "music-video-1-0", reference_image_urls: ["https://your-cdn.com/style.png"], audio_url: "https://your-cdn.com/song.mp3", aspect_ratio: "16:9", resolution: "540P", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "music-video-1-0", "reference_image_urls": []string{"https://your-cdn.com/style.png"}, "audio_url": "https://your-cdn.com/song.mp3", "aspect_ratio": "16:9", "resolution": "540P", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "music-video-1-0", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required `string`. Must be `"music-video-1-0"`. ### `reference_image_urls` — required `string[]`. **1 to 7** public HTTP(S) image URLs (JPEG / PNG / WebP). These are the style / model references that fix the visual identity of the music video. **No `data:` URIs.** reApi rejects base64 inputs platform-wide. Upload to public storage (your own CDN, S3, R2…) and pass the URL. ### `audio_url` — required `string`. Public HTTP(S) URL of the **song** (MP3). The audio must be **10 to 300 seconds** (up to 5 minutes). The output music video length tracks the song, and the **billable second count is the song's server-probed duration**, not a client estimate. ### `aspect_ratio` — string, default `"16:9"` Output frame shape. | Value | Orientation | | -------- | ------------------- | | `"1:1"` | Square | | `"16:9"` | Landscape (default) | | `"9:16"` | Portrait | | `"4:3"` | Landscape | | `"3:4"` | Portrait | ### `resolution` — string, default `"540P"` Output clarity. Higher resolutions take longer to render. | Value | Notes | | --------- | ----------------- | | `"540P"` | Fastest (default) | | `"720P"` | Balanced | | `"1080P"` | Highest clarity | ### `name` — string, optional A label for the track. Shown on subtitles when `add_subtitle` is enabled. ### `prompt` — string, optional Up to **3000 characters**. Steers the visual style, mood, and scene direction of the music video. ### `add_subtitle` — boolean, default `false` Burn lyric subtitles into the music video. With `add_subtitle: true` and no `srt_url`, subtitles are generated from the song. ### `subtitle_color` — string, default `"#FFFFFF"` Hex color for burned-in subtitles (e.g. `"#FF0000"`). ### `srt_url` — string, optional Public HTTP(S) URL of a `.srt` subtitle file. Overrides auto-generated subtitles when `add_subtitle` is on. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "music-video-1-0", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ---------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds the MP4 | | `error` | object \| null | Populated on `failed` — `{ code, message }` | *** ## Pricing Flat **per second of the song**. The billable second count is the audio's **server-probed** length — reApi measures the uploaded track server-side rather than trusting a client value. **Bill formula** (1 credit = $0.001): ``` billable_seconds = min(ceil(server_probed_song_seconds), 300) bill_usd = per_second_usd × billable_seconds credits = ceil(bill_usd × 1000) ``` See the current per-second rate on the [model page](https://reapi.ai/models/music-video-1-0). Failed jobs refund automatically. A probe failure returns `400 PRICING_UNAVAILABLE` (code `30002`) with no charge. The playground's draft estimate may show a default before the upload finishes — the authoritative number is computed at submit, after the server probes the song. *** ## Validation errors All cases below return HTTP 400. Pattern-match on `code`, not `message` — message strings carry request-specific context and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------- | ------- | --------------------------------------------------------------- | | `reference_image_urls` missing / empty | `20002` | `reference_image_urls is required` | | More than 7 reference images | `20003` | `reference_image_urls accepts at most 7 items` | | `audio_url` missing | `20002` | `audio_url is required` | | `aspect_ratio` / `resolution` invalid | `20003` | `invalid aspect_ratio (allowed: 1:1 / 16:9 / 9:16 / 4:3 / 3:4)` | | `subtitle_color` not a hex color | `20003` | `subtitle_color must be a hex color like #FFFFFF` | | Any media field carrying a `data:` URI | `20003` | `audio_url must be a public http(s) URL` | | Song probe fails (network / format) | `30002` | `Could not determine source audio duration for billing: …` | | Song length outside the 10-300s window | `80007` | Provider rejected the request as invalid | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Minimum request ```json { "model": "music-video-1-0", "reference_image_urls": ["https://your-cdn.com/style.png"], "audio_url": "https://your-cdn.com/song.mp3", "aspect_ratio": "16:9", "resolution": "540P" } ``` ### Portrait lyric video, 1080P, with subtitles ```json { "model": "music-video-1-0", "reference_image_urls": [ "https://your-cdn.com/style-1.png", "https://your-cdn.com/style-2.png" ], "audio_url": "https://your-cdn.com/song.mp3", "aspect_ratio": "9:16", "resolution": "1080P", "prompt": "Dreamy pastel anime style, soft lighting, visuals shift with each chorus", "add_subtitle": true, "subtitle_color": "#FFE0F0" } ``` ### Bring your own subtitle file ```json { "model": "music-video-1-0", "reference_image_urls": ["https://your-cdn.com/style.png"], "audio_url": "https://your-cdn.com/song.mp3", "aspect_ratio": "16:9", "resolution": "720P", "add_subtitle": true, "srt_url": "https://your-cdn.com/lyrics.srt" } ``` *** ## Tips * **Cost tracks the song.** A 90-second track bills \~90 seconds; trim the audio to control spend. Songs must be 10 to 300 seconds. * **Use reference images to lock the look.** Pass 1-7 style/model images; reuse the same set across tracks for a consistent channel aesthetic. * **Prompt the mood, not just the scene.** Phrasing the energy ("dynamic lights pulsing on the downbeat") sharpens the result. * **Subtitles, three ways.** Leave `add_subtitle` off for a clean cut, on for auto-generated lyrics, or supply your own `srt_url` for exact timing. * **Start at 540P.** Validate the look on the fastest tier, then re-run at 720P / 1080P for the final take. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # nano-banana-2-lite (https://reapi.ai/docs/nano-banana-2-lite) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Google DeepMind's Nano Banana 2 Lite (aka **Gemini 3.1 Flash-Lite Image**) on > reAPI — the speed-focused member of the Nano Banana family: fast **1K > text-to-image** and **prompt-based image editing** with up to 10 reference > images. Submit returns a `task_id`; poll until ready. See current pricing on > the [model page](https://reapi.ai/models/nano-banana-2-lite). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana-2-lite", "prompt": "a pig on the grass, cinematic light", "aspect_ratio": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "nano-banana-2-lite", "prompt": "a pig on the grass, cinematic light", "aspect_ratio": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "nano-banana-2-lite", prompt: "a pig on the grass, cinematic light", aspect_ratio: "16:9", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "nano-banana-2-lite", "prompt": "a pig on the grass, cinematic light", "aspect_ratio": "16:9", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_019f25700fef760e879fc22ad9de512c", "model": "nano-banana-2-lite", "status": "processing", "created_at": 1783039530 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. The generation mode is implicit — there is no `mode` field: * **No `image_urls` (or an empty array)** → text-to-image. * **`image_urls` set** → prompt-based editing / reference-driven generation using up to 10 input images. Each request produces **exactly one 1K image** (no `n` parameter, no resolution control). *** ## Request body ### `model` — string, required Must be `nano-banana-2-lite`. ### `prompt` — string, required Up to **20,000 characters**. For text-to-image, describe subject, scene, style and composition. For editing, state the change you want ("replace the background with…", "make it nighttime, keep the subject unchanged"). ### `image_urls` — string\[], optional Up to **10 public http(s) image URLs** used as edit sources or visual references. Accepted types: JPEG, PNG, WebP; up to 30 MB per image. Omit it (or pass an empty array) for pure text-to-image. Base64 / `data:` URIs are rejected platform-wide — host the image on a public URL first. ### `aspect_ratio` — string, default `auto` One of `1:1`, `1:4`, `1:8`, `2:3`, `3:2`, `3:4`, `4:1`, `4:3`, `4:5`, `5:4`, `8:1`, `9:16`, `16:9`, `21:9`, `auto`. With `auto` the model chooses the ratio itself (for edits it follows the source image). *** ## Pricing Nano Banana 2 Lite bills a flat rate **per generated image**, independent of aspect ratio and mode (text-to-image and editing cost the same). Each request produces one image: ``` credits = ceil(per_image_usd × 1000) ``` where `1 credit = $0.001 USD`. It is one of the lowest per-image rates on the platform. Failed and rejected requests are not charged. The exact per-image credit cost surfaces on the [model page](https://reapi.ai/models/nano-banana-2-lite) and through the playground estimator before submit. *** ## Response The poll envelope returns the image URL in `output.image_urls`: ```json { "id": "task_019f25700fef760e879fc22ad9de512c", "model": "nano-banana-2-lite", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...jpeg" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (prompt over 20,000 characters, more than 10 `image_urls`, an unsupported `aspect_ratio`) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * Nano Banana 2 Lite is the **speed tier** of the Nano Banana family — pick it for drafts, previews and high-volume 1K assets; step up to [Nano Banana 2](/docs/gemini-3-1-flash-image-preview) when you need 2K/4K output or maximum quality. * For edits, reference what should **stay unchanged** ("keep the furniture and composition unchanged") — the model is strong at targeted, consistent edits. * `aspect_ratio: "auto"` follows the source image on edits; set an explicit ratio when you need a fixed canvas (e.g. `16:9` thumbnails). *** ## Related * [Nano Banana 2](/docs/gemini-3-1-flash-image-preview) * [Nano Banana Pro](/docs/gemini-3-pro-image-preview) * [Z-Image](/docs/z-image) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # pixverse-v6 (https://reapi.ai/docs/pixverse-v6) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Pixverse v6 — async video generation. **One model id** (`pixverse-v6`) and > one endpoint cover five modes: **text-to-video**, **image-to-video**, > **first/last-frame** transition, **multi-reference fusion**, and **video > extend**. Mode is implicit — the fields you send pick it. 1–15 second > outputs at 360p / 540p / 720p / 1080p, optional generated audio. See current > pricing on the [model page](https://reapi.ai/models/pixverse-v6). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "pixverse-v6", "prompt": "A neon-lit Tokyo alley at night, light rain, anamorphic flare", "size": "21:9", "resolution": "720p", "duration": 8 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "pixverse-v6", "prompt": "A neon-lit Tokyo alley at night, light rain, anamorphic flare", "size": "21:9", "resolution": "720p", "duration": 8, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "pixverse-v6", prompt: "A neon-lit Tokyo alley at night, light rain, anamorphic flare", size: "21:9", resolution: "720p", duration: 8, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "pixverse-v6", "prompt": "A neon-lit Tokyo alley at night, light rain, anamorphic flare", "size": "21:9", "resolution": "720p", "duration": 8, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "pixverse-v6", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL, valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Mode routing `pixverse-v6` picks its mode from **which fields you send** — there is no `mode` parameter. Matching is by priority; the first satisfied condition wins: | Send | Mode | What it does | | ---------------------------------------- | -------------------- | -------------------------------------------------------- | | `prompt` only | **Text-to-video** | Generate from text. `size` applies. | | `image_urls` | **Image-to-video** | Animate from a single starting frame (first used). | | `first_frame_image` + `last_frame_image` | **First/Last-frame** | Interpolate a transition between two frames. | | `img_references` | **Multi-reference** | Fuse 1–7 reference images into one clip. `size` applies. | | `extend_from_task_id` | **Video extend** | Continue a completed `pixverse-v6` clip. | **Field rules.** * `prompt` is **required** in every mode. * `first_frame_image` and `last_frame_image` must be sent **together**. * `img_references` accepts **1 to 7** entries. * First/Last-frame mode accepts only **5 or 8** second `duration`. * `size` is honored only in text-to-video and multi-reference fusion. *** ## Request body ### `model` — required `string`. Always `"pixverse-v6"`. ### `prompt` — string, required Up to **5,000 characters**. Required in every mode. Empty / whitespace-only prompts are treated as missing. ### `resolution` — string, default `"540p"` One of `360p` / `540p` / `720p` / `1080p`. Drives pricing. ### `duration` — integer, default `5` Output length in seconds. Any integer in `[1, 15]`. First/Last-frame mode accepts only `5` or `8`. Drives pricing linearly: `ceil(per_second_usd × duration × 1000)` credits (1 credit = $0.001). ### `size` — string, default `"16:9"` Output aspect ratio. Honored in **text-to-video** and **multi-reference fusion** only (other modes derive the ratio from the source media). One of: | Value | Shape | | ------ | -------------- | | `16:9` | Landscape | | `4:3` | Landscape 4:3 | | `1:1` | Square | | `3:4` | Portrait 3:4 | | `9:16` | Portrait | | `2:3` | Portrait 2:3 | | `3:2` | Landscape 3:2 | | `21:9` | Cinematic wide | ### `seed` — integer, default `0` Reproducibility hint. Range `[0, 2147483647]`. Same prompt plus seed returns a similar (not bit-for-bit identical) result. ### `negative_prompt` — string Up to **2,048 characters**. Describes content to keep out of the frame. ### `audio` — boolean, default `false` When `true`, the model synthesizes a soundtrack alongside the video. Audio **raises the per-second rate** (see Pricing). Default `false` is silent. ### `watermark` — boolean, default `false` When `true`, adds a watermark to the bottom-right corner. ### `motion_mode` — string `pixverse-v6` supports only `"normal"`. Other values are rejected upstream. ### `generate_multi_clip_switch` — boolean, default `false` When `true`, generates a multi-segment continuous video. Supported in **text-to-video** and **image-to-video** only. ### `image_urls` — string\[] (image-to-video) Public HTTP(S) URL array. The model uses the **first** entry as the starting frame. ### `first_frame_image` / `last_frame_image` — string (first/last-frame) Public HTTP(S) URLs. Must be sent **as a pair**; the model interpolates motion from the first frame to the last over a 5 or 8 second clip. ### `img_references` — string\[] (multi-reference fusion) **1 to 7** public HTTP(S) URLs. The model fuses subjects from each reference into one clip. ### `extend_from_task_id` — string (video extend) The reAPI task id (`task_...`) of one of **your own completed `pixverse-v6`** videos. Do not pass the upstream provider task id — reAPI resolves that internally before sending the extend request. The model continues the scene from where that clip ended. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field on this endpoint must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "pixverse-v6", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | `output.video_urls` URLs are valid for **7 days**. Re-host to your own storage if you need them longer. To extend a clip later, keep the task `id` — pass it as `extend_from_task_id`. *** ## Validation errors All cases below return HTTP 400. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values) and are not a stable contract. | Trigger | Code | Message (illustrative) | | ---------------------------------------------------- | ------- | ------------------------------------------------------------------ | | `prompt` missing / empty | `20002` | `prompt is required` | | `prompt` longer than 5,000 chars | `20007` | `prompt exceeds 5000 characters (got N)` | | Unknown `resolution` | `20003` | `invalid resolution "X" (allowed: 360p / 540p / 720p / 1080p)` | | `duration` outside `[1, 15]` | `20003` | `duration must be 1-15 seconds, got N` | | `duration` not 5/8 in first/last-frame mode | `20003` | `first-last-frame transition supports only 5 or 8 second duration` | | Only one of `first_frame_image` / `last_frame_image` | `20003` | `first_frame_image and last_frame_image must be provided together` | | `img_references` length > 7 | `20003` | `img_references supports at most 7 images, got N` | | `motion_mode` not `normal` | `20003` | `motion_mode must be "normal"` | | A URL field carrying a `data:` URI or non-http(s) | `20003` | `image_urls entries must be public http(s) URLs` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Text-to-video — minimum request ```json { "model": "pixverse-v6", "prompt": "A corgi running through a sunflower field at golden hour" } ``` ### Text-to-video — full parameters ```json { "model": "pixverse-v6", "prompt": "A neon-lit Tokyo alley at night, light rain, anamorphic lens flare", "size": "21:9", "resolution": "720p", "duration": 8, "seed": 42, "audio": true } ``` ### Image-to-video — animate a single frame ```json { "model": "pixverse-v6", "prompt": "Camera slowly zooms in, gentle wind moves the leaves", "image_urls": ["https://your-cdn.com/first_frame.jpg"], "resolution": "540p", "duration": 5 } ``` ### First/Last-frame transition ```json { "model": "pixverse-v6", "prompt": "Transform smoothly from a puppy to a cat", "first_frame_image": "https://your-cdn.com/puppy.jpg", "last_frame_image": "https://your-cdn.com/cat.jpg", "resolution": "540p", "duration": 5 } ``` ### Multi-reference fusion ```json { "model": "pixverse-v6", "prompt": "A girl wearing the outfit from image 2, holding the cat from image 3", "img_references": [ "https://your-cdn.com/character.jpg", "https://your-cdn.com/outfit.jpg", "https://your-cdn.com/cat.jpg" ], "size": "9:16", "resolution": "720p", "duration": 5 } ``` ### Video extend ```json { "model": "pixverse-v6", "prompt": "The character now walks into a forest", "extend_from_task_id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "resolution": "540p", "duration": 5 } ``` *** ## Choosing a mode | Need | Send | | ------------------------------------ | -------------------------------------------------------- | | Generate from text | `prompt` only — `size` applies | | Animate a still | `prompt + image_urls` | | Smooth transition between two frames | `first_frame_image + last_frame_image` (duration 5/8) | | Combine subjects from several images | `prompt + img_references` (1–7) | | Continue an existing clip | `prompt + extend_from_task_id` | | Cut spend | Drop `resolution`, shorten `duration`, leave `audio` off | *** ## Polling pattern The task endpoint behaves identically to other video tasks — the completed `output` carries `video_urls`. A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. *** ## Pricing Per-second × resolution. Turning **audio** on raises the per-second rate at every tier; every other parameter is free. See current rates on the [Pixverse v6 model page](https://reapi.ai/models/pixverse-v6). **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_second_usd × duration × 1000) ``` Failed jobs refund automatically. *** ## Tips * **Prompt motion, not just scene.** "Slow push-in, warm tones, shallow depth of field" outperforms a pure noun-list of what's on screen. * **Keep references on-topic.** Multi-reference fusion works best when each image contributes a distinct, clearly-framed subject (a face, an outfit, a prop) rather than overlapping whole scenes. * **Two frames need to make sense as endpoints.** First/Last interpolation is smoothest when the two frames share enough subject and composition. * **Chain extends one beat at a time.** Build a longer sequence by extending the latest clip's task id repeatedly instead of asking for one long shot. * **Audio is opt-in here.** Leave `audio` off unless you need a soundtrack — it raises the per-second rate. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # qwen-image-2 (https://reapi.ai/docs/qwen-image-2) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Alibaba's Qwen Image 2 on reAPI — one async endpoint for **generation and > editing**. Write a prompt for **text-to-image**, or attach one source image > to **edit it in plain language**. Known for **structured in-image text** > (posters, slides, infographics, comics). Submit returns a `task_id`; poll > until ready. See current pricing on the > [model page](https://reapi.ai/models/qwen-image-2). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "qwen-image-2", "prompt": "a vintage travel poster that reads VISIT MARS in bold retro type", "image_size": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "qwen-image-2", "prompt": "a vintage travel poster that reads VISIT MARS in bold retro type", "image_size": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "qwen-image-2", prompt: "a vintage travel poster that reads VISIT MARS in bold retro type", image_size: "16:9", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "qwen-image-2", "prompt": "a vintage travel poster that reads VISIT MARS in bold retro type", "image_size": "16:9", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "qwen-image-2", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Modes There is no `mode` field — the modality is implicit in the request shape: * **Text-to-image** — no `image_url`. `prompt` is required. * **Image editing** — pass a single `image_url`. `prompt` describes the change (background swap, object edit, restyle, in-frame text rewrite). Each request produces **exactly one image** — there is no `n` parameter. *** ## Request body ### `model` — string, required Must be `qwen-image-2`. ### `prompt` — string, required Up to **800 characters**. Required for both text-to-image and editing. ### `image_url` — string, optional A single source image for editing. **Public HTTPS URL only** — base64 / `data:` URIs are rejected at the gateway. Passing it switches the request to editing mode; omit it for text-to-image. ### `image_size` — string, optional, default `16:9` Output aspect ratio. * **Text-to-image** accepts: `1:1`, `3:4`, `4:3`, `9:16`, `16:9`. * **Editing** additionally accepts: `2:3`, `3:2`, `21:9`. `2:3`, `3:2`, and `21:9` are **editing-only**. Requesting one without an `image_url` (text-to-image) is rejected with `400`. ### `output_format` — string, optional, default `png` One of `png` or `jpeg`. ### `seed` — integer, optional The same seed with the same prompt yields a repeatable result. ### `nsfw_checker` — boolean, optional, default `false` Enables upstream content moderation. Off by default. *** ## Pricing Qwen Image 2 bills a flat rate **per generated image**, independent of modality, resolution, and aspect ratio. Each request produces one image: ``` credits = ceil(per_image_usd × 1000) ``` where `1 credit = $0.001 USD`. Failed and rejected requests are not charged. The exact per-image credit cost surfaces on the [model page](https://reapi.ai/models/qwen-image-2) and through the playground estimator before submit. *** ## Response The poll envelope returns the image URL in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "qwen-image-2", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...png" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (prompt over 800 characters, an editing-only `image_size` in text-to-image, a non-HTTPS `image_url`) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * The modality is decided by your inputs, not a flag — omit `image_url` for generation, include it to edit. * Put the literal text you want rendered **in the prompt** — Qwen Image 2 is tuned for legible in-image typography, so spelling out headline copy works. * For wide layouts, `21:9` is available only when editing (pass an `image_url`). * To produce a set of images, send multiple requests — each is billed as one image. *** ## Related * [Image generation models](/docs/gpt-image-2) * [Wan 2.7 Image](/docs/wan-2-7-image) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # seedance-2-0-mini (https://reapi.ai/docs/seedance-2-0-mini) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > ByteDance Seedance 2.0 **Mini** — the low-cost tier of the Seedance 2.0 > family. A single async video endpoint that auto-routes between > **T2V / I2V / R2V** based on which media field your request carries. > 480p or 720p, 4–15 second outputs. See current pricing on the > [model page](https://reapi.ai/models/seedance-2-0-mini). Generation is **asynchronous**: the POST returns a task id, then poll [`GET /api/v1/tasks/{id}`](/docs/api/tasks) until `status` is `completed`. **URL-only media.** All media inputs must be public `http(s)` URLs. base64 / `data:` URI media is **not accepted** by ReAPI — even where upstream docs show base64 examples. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2.0-mini", "prompt": "A kitten yawning at the camera, soft morning light", "resolution": "720p", "aspect_ratio": "16:9", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "seedance-2.0-mini", "prompt": "A kitten yawning at the camera, soft morning light", "resolution": "720p", "aspect_ratio": "16:9", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "seedance-2.0-mini", prompt: "A kitten yawning at the camera, soft morning light", resolution: "720p", aspect_ratio: "16:9", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "seedance-2.0-mini", "prompt": "A kitten yawning at the camera, soft morning light", "resolution": "720p", "aspect_ratio": "16:9", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() var out map[string]any json.NewDecoder(resp.Body).Decode(&out) fmt.Println(out) } ``` ## Endpoint ```http POST /api/v1/videos/generations Authorization: Bearer rk_live_xxx Content-Type: application/json ``` Submitting returns a task id; poll [`GET /api/v1/tasks/{id}`](/docs/api/tasks) for the result. Polling does not consume credits. ## Parameters Exactly 12 input fields. The mode is implicit — which media fields you set decides text-to-video, image-to-video, or reference-driven generation. | Parameter | Type | Required | Default | Description | | ---------------------- | --------- | ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------ | | `prompt` | string | T2V: yes · I2V / R2V: no | — | Text prompt. Required for text-to-video; optional when a `first_frame_url` or `reference_image_urls` is set. | | `first_frame_url` | string | I2V | — | First-frame image, a single public `http(s)` URL. Presence selects **image-to-video**. | | `last_frame_url` | string | no | — | Optional last-frame image, a public `http(s)` URL. | | `reference_image_urls` | string\[] | R2V | — | **1–9** reference image URLs. Presence selects **reference-to-video**. | | `reference_video_urls` | string\[] | no | — | **Up to 3** reference video URLs. | | `reference_audio_urls` | string\[] | no | — | **Up to 3** reference audio URLs. | | `generate_audio` | boolean | no | `false` | Generate an audio track for the output video. | | `resolution` | enum | no | `720p` | `480p` · `720p`. | | `aspect_ratio` | enum | no | `16:9` | `16:9` `9:16` `1:1` `4:3` `3:4` `21:9` `adaptive`. | | `duration` | integer | no | `5` | Output length in seconds, `4`–`15`. | | `web_search` | boolean | no | `false` | Allow the model to ground the prompt with web search. | | `nsfw_checker` | boolean | no | `true` | Run the upstream NSFW content check. | All media inputs (`first_frame_url`, `last_frame_url`, `reference_image_urls`, `reference_video_urls`, `reference_audio_urls`) must be public HTTP(S) URLs — base64 / `data:` URIs are rejected. ## Modes Mode is implicit — selected by which inputs you send: | Mode | Trigger | prompt | | ---------------------------- | ----------------------------------------------- | -------- | | **Text-to-video (T2V)** | no media | required | | **Image-to-video (I2V)** | `first_frame_url` (optionally `last_frame_url`) | optional | | **Reference-to-video (R2V)** | `reference_image_urls` (1–9) | optional | ```json // I2V — animate a first frame { "model": "seedance-2.0-mini", "first_frame_url": "https://…/frame.jpg", "resolution": "720p", "duration": 5 } // R2V — keep subjects consistent across the clip { "model": "seedance-2.0-mini", "prompt": "the woman walks through the plaza", "reference_image_urls": ["https://…/a.jpg", "https://…/b.jpg"], "resolution": "720p", "duration": 5 } ``` ## More examples ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2.0-mini", "first_frame_url": "https://example.com/frame.jpg", "resolution": "720p", "duration": 5 }' ``` ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2.0-mini", "prompt": "the subject walks through a neon-lit street at night", "reference_image_urls": [ "https://example.com/a.jpg", "https://example.com/b.jpg" ], "resolution": "720p", "duration": 5 }' ``` ## Pricing Per-second, billed by **resolution × whether a reference video is uploaded**. A request that carries `reference_video_urls` bills at a cheaper reference tier. See current 480p / 720p rates on the [model page](https://reapi.ai/models/seedance-2-0-mini). **Bill formula** (1 credit = $0.001): | Input | Billable seconds | | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | No `reference_video_urls` (text / image / first-last-frame / reference-image) | `duration` you sent (default 5) | | With `reference_video_urls` | `duration` + `ceil(sum of source video seconds)` — the vendor processes the input clip(s) AND produces the output; both are billable. Failed probe → `400 PRICING_UNAVAILABLE`, no charge. | Final bill: `ceil(per_second_usd × billable_seconds × 1000)` credits. Failed jobs refund automatically. ## Output On success, `GET /api/v1/tasks/{id}` returns: ```json { "id": "task_…", "model": "seedance-2.0-mini", "status": "completed", "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/…/0.mp4"] }, "error": null } ``` ## Errors | HTTP | `code` | When | | ---- | ----------------- | ----------------------------------------------------------------------------- | | 400 | `20002` | Missing / invalid parameter (e.g. prompt required in T2V, value out of range) | | 400 | `80007` | Upstream content rejection (e.g. a flagged source image) | | 401 | `10001` – `10005` | Auth missing / invalid / revoked | | 402 | `30001` | Insufficient credits | | 429 | `50001` | Per-user rate limit exceeded | Pattern-match on the numeric `code`, not the message string. Failed generations are surfaced under `error` in the polling response and are refunded automatically. Full catalog: [Errors](/docs/api/errors). ## Tips * **Pick the mode by inputs, not a flag.** Sending `reference_image_urls` switches to R2V; sending `first_frame_url` switches to I2V; neither → T2V. * Seedance 2.0 Mini is the low-cost tier — for higher resolutions (1080p / 4k) use [`seedance-2-0`](/docs/seedance-2-0) or its [official channel](/docs/seedance-2-0-official). * Longer `duration` scales the bill linearly; start at 5s while iterating. ## Related * [`seedance-2-0` — full reference](/docs/seedance-2-0) * [`seedance-2-0-official` — Official channel](/docs/seedance-2-0-official) * [Tasks](/docs/api/tasks) — universal polling endpoint * [Errors](/docs/api/errors) — full error catalog --- # doubao-seedance-2.0-official (https://reapi.ai/docs/seedance-2-0-official) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Doubao Seedance 2.0 **Official Channel** — direct first-party routing, > distinct from the standard [`doubao-seedance-2.0`](/docs/seedance-2-0) > channel. Two model ids: `doubao-seedance-2.0-official` (480p / 720p / > 1080p / 4k) and `doubao-seedance-2.0-fast-official` (480p / 720p only). Same > async endpoint, same parameter shape as the standard channel — pick the > channel via the `model` id. **Official channel, ReAPI boundary.** The upstream is the model vendor's first-party platform. Media inputs must still be public `http(s)` URLs; base64 / data URI media is not accepted by ReAPI even where upstream docs show base64 examples. **No real-person inputs.** This channel rejects source images / videos that appear to contain a real person (upstream privacy policy) — the request fails with `400` (code `80007`). For real-person uploads use a Face variant on the standard channel (`doubao-seedance-2.0-face` / `-fast-face`). **Tip — synthetic faces pass.** The filter blocks only real persons, not AI-generated faces. A portrait generated with [Seedream 5.0](/docs/seedream-5-0-lite) (a face-bearing synthetic image) is accepted as a source image on this channel. ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.0-official", "prompt": "A kitten yawning at the camera, soft morning light", "size": "16:9", "resolution": "720p", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "doubao-seedance-2.0-official", "prompt": "A kitten yawning at the camera, soft morning light", "size": "16:9", "resolution": "720p", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "doubao-seedance-2.0-official", prompt: "A kitten yawning at the camera, soft morning light", size: "16:9", resolution: "720p", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "doubao-seedance-2.0-official", "prompt": "A kitten yawning at the camera, soft morning light", "size": "16:9", "resolution": "720p", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` *** ## Request surface The public endpoint and async response envelope are identical to the standard channel: ```txt POST /api/v1/videos/generations ``` Mode is implicit — which media fields you set decides text-to-video, image-to-video, first/last-frame, or reference-driven generation: | Field | Official-channel behavior | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | `"doubao-seedance-2.0-official"` or `"doubao-seedance-2.0-fast-official"` | | `prompt` | Required on every request (min 3 chars). | | `size` | `"16:9"`, `"9:16"`, `"1:1"`, `"4:3"`, `"3:4"`, `"21:9"`, `"adaptive"`. Default `"adaptive"`. | | `resolution` | `"480p"`, `"720p"`, `"1080p"`, `"4k"`. Default `"720p"`. `4k` is `doubao-seedance-2.0-official` only; `-fast-official` rejects `1080p` / `4k` (480p / 720p only). | | `duration` | 4–15 seconds. Default `5`. | | `generate_audio` | Boolean. Default `true`. | | `return_last_frame` | Boolean. Default `false`. | | `tools` | `[{"type": "web_search"}]` to enable web search. | | `image_urls` | Public `http(s)` URLs, up to 9. Mutually exclusive with `image_with_roles`. | | `image_with_roles` | First / last-frame slots (`role`: `first_frame` or `last_frame`). Cannot combine with `video_urls` or `audio_urls`. | | `video_urls` | Public `http(s)` URLs, up to 3. Presence switches billing to the cheaper reference tier (see Pricing). | | `audio_urls` | Public `http(s)` URLs, up to 3. Must be used together with `image_urls` or `video_urls`. | reAPI never silently substitutes one variant for another. Sending `resolution: "1080p"` to `doubao-seedance-2.0-fast-official` returns `400` (code `20003`), never an auto-downgraded clip. ## Differences from `doubao-seedance-2.0` | Aspect | `doubao-seedance-2.0` (standard) | `doubao-seedance-2.0-official` | | ----------------------- | ----------------------------------------- | ------------------------------------------------- | | Upstream channel | Standard | Vendor first-party official | | Wire `model` value | `doubao-seedance-2.0-face` / `-fast-face` | `doubao-seedance-2.0-official` / `-fast-official` | | Real-person inputs | Accepted only on Face variants | Not accepted (no Face variant) | | Per-second rate | Baseline | Lower — direct official pricing | | Validation error prefix | `seedance:` | `seedance-official:` | *** ## Pricing Per-second × resolution, with a cheaper reference tier when a source video is uploaded. The official channel is priced **below** the standard channel at the same resolution. See current 480p / 720p / 1080p rates on the [Seedance 2.0 model page](https://reapi.ai/models/seedance-2-0). **Bill formula** (1 credit = $0.001): | Input | Billable seconds | | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | No `video_urls` (text / image / first-last-frame / audio reference) | `duration` you sent (default 5) | | With `video_urls` | `duration` + `ceil(sum of source video seconds)` — the vendor processes the input clip(s) AND produces the output; both are billable. Failed probe → `400 PRICING_UNAVAILABLE`, no charge. | Final bill: `ceil(per_second_usd × billable_seconds × 1000)` credits. Failed jobs refund automatically. *** ## Validation errors The response envelope and numeric error-code system match the standard channel. Official-channel validation messages use the `seedance-official:` prefix. Upstream content rejections (e.g. a real-person source image) surface as `400` with code `80007`. Pattern-match on the numeric `code`, not the message string. *** ## When to pick which channel | Need | Channel | | ---------------------------------- | ---------------------------------------------------- | | Lowest unit price | `doubao-seedance-2.0-official` / `-fast-official` | | Official first-party direct route | `doubao-seedance-2.0-official` / `-fast-official` | | Real-person source images / videos | `doubao-seedance-2.0-face` / `-fast-face` (standard) | Switching channels = changing the `model` string in your request body. The response envelope and polling flow are shared; provider-specific validation and pricing differ as documented above. *** ## Related * [`doubao-seedance-2.0` — full reference](/docs/seedance-2-0) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) --- # doubao-seedance-2.0 (https://reapi.ai/docs/seedance-2-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > ByteDance's async video model on reAPI. **Four variants** share one > endpoint and one parameter shape — pick the variant via `model`. Mode > is implicit: which media fields you set (`prompt`, `image_urls`, > `image_with_roles`, `video_urls`, `audio_urls`) decides whether the > request runs as text-to-video, image-to-video, first/last-frame > transition, or reference-driven generation. 4–15 second outputs at > 480p / 720p / 1080p / 4k. See current pricing on the > [model page](https://reapi.ai/models/seedance-2-0). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.0-face", "prompt": "A kitten yawning at the camera, cinematic warm tones", "resolution": "720p", "size": "16:9", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "doubao-seedance-2.0-face", "prompt": "A kitten yawning at the camera, cinematic warm tones", "resolution": "720p", "size": "16:9", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "doubao-seedance-2.0", prompt: "A kitten yawning at the camera, cinematic warm tones", resolution: "720p", size: "16:9", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "doubao-seedance-2.0-face", "prompt": "A kitten yawning at the camera, cinematic warm tones", "resolution": "720p", "size": "16:9", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "doubao-seedance-2.0-face", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL, valid for 7 days. `output.last_frame_url` is present when the request set `return_last_frame: true`. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Variants `doubao-seedance-2.0` is a family of two variants sharing one parameter shape. Pick via `model`: | Variant | Speed | 1080p / 4k | Real-person uploads | | ------------------------------- | -------- | :------------------: | :-----------------: | | `doubao-seedance-2.0-face` | standard | ✅ | ✅ | | `doubao-seedance-2.0-fast-face` | faster | ❌ (480p / 720p only) | ✅ | reAPI never silently substitutes one variant for another. Sending `resolution: "1080p"` to the Fast variant returns `400`, never an auto-downgraded clip. **Real-person uploads** — both variants accept real-person source images / videos. *** ## Channels The variants above ship across two channels — same async endpoint, selected by the `model` id you send: | Channel | Model ids | Notes | | ------------ | ------------------------------------------------------------------- | --------------------------------------------------------------------------- | | **Standard** | `doubao-seedance-2.0-face`, `doubao-seedance-2.0-fast-face` | Face variants accept real-person inputs. | | **Official** | `doubao-seedance-2.0-official`, `doubao-seedance-2.0-fast-official` | Official direct channel — lower price. Real-person inputs are not accepted. | Standard and Official share the parameter shape documented below. *** ## Mode routing `doubao-seedance-2.0` picks its mode from which media fields you set — there is no `mode` parameter: | Fields you send | Mode | What it does | | ----------------------------------------------------------------------- | ---------- | ---------------------------------------- | | `prompt` only | **T2V** | Generate from text | | `prompt` + `image_urls` (1–9) | **I2V** | Animate / extend from reference images | | `prompt` + `image_with_roles` (1–2 frames) | **FRAMES** | First / last frame transition | | `prompt` + `video_urls` and / or `audio_urls` (+ optional `image_urls`) | **REF** | Reference-driven, optionally multi-modal | **Mutex rules.** Most field combinations are illegal. The single legal multi-field shape is `image_urls + video_urls + audio_urls` (REF mode, multi-modal). Any other combination is rejected with `400` (code `20003`). * `prompt` is required on every request (all four modes carry it) * `image_urls` ⊕ `image_with_roles` — never together * `image_with_roles` cannot be combined with `video_urls` or `audio_urls` * `audio_urls` requires `image_urls` or `video_urls` *** ## Request body ### `model` — required `string`. One of the four variants in the table above. ### `prompt` — string, required **Required on every request**, min **3** characters, up to **20,000** (≤ **500 recommended** — quality drops past \~500 chars on the upstream model). Applies to all modes — T2V, I2V, FRAMES, REF. Best results come from naming, in order, the **subject**, the **action**, the **camera move**, and the **style**. e.g. `"A kitten, yawning into the camera, slow push-in, cinematic warm tones"`. **Failure modes.** * Missing / empty → `400` (code `20002`). * Shorter than 3 chars → `400` (code `20003`). * Longer than 20,000 chars → `400` (code `20003`). ### `duration` — integer, default `5` Output length in seconds. Any integer in `[4, 15]`. Out-of-range → `400`. **Billable seconds = `sum(video_urls clip lengths)` + `duration`.** The input reference clips and the generated output both contribute to cost. Image and audio references don't carry a billable time component — only `video_urls` adds. reAPI probes `video_urls` server-side via ffmpeg metadata; the value reported by your client is never trusted for billing. See [Pricing](#pricing) for the full formula. ### `size` — string, default `"adaptive"` Output ratio. One of: | Value | Shape | | ---------- | ------------------------------------- | | `16:9` | Landscape | | `9:16` | Portrait | | `1:1` | Square | | `4:3` | Traditional landscape | | `3:4` | Traditional portrait | | `21:9` | Cinematic ultrawide | | `adaptive` | Match the input image / video's ratio | Invalid values → `400` (no silent fallback). ### `resolution` — string, default `"720p"` `480p` / `720p` / `1080p` / `4k` — lowercase only. Drives pricing. Uppercase forms like `1080P` are rejected with `400`. **`1080p` and `4k` are variant-gated.** Only `doubao-seedance-2.0` and `doubao-seedance-2.0-face` accept `1080p` / `4k`. The Fast variants (`-fast`, `-fast-face`) cap at 720p — sending a higher resolution returns `400 resolution= is not supported by ` (code `20003`), no auto-downgrade. ### `generate_audio` — boolean, default `true` When `true` (the default), the model synthesizes an audio track that plays alongside the generated video; pass `false` to get a silent clip. Independent of `audio_urls` (which is a **reference** for the model to align with — not a synthesis toggle). ### `return_last_frame` — boolean, default `false` When `true`, the completed task carries an extra `output.last_frame_url` holding the final frame as a still image. Pass it as `image_urls` of the next request to chain continuous video without prompt drift. ### `tools` — object\[] Per-tool capability list. Today only one type is recognized: ```json "tools": [{ "type": "web_search" }] ``` `web_search` lets the model query the web during generation — useful for current events or named brands. Unknown `type` values are rejected with `400 tools[i].type must be "web_search"`. ### `nsfw_checker` — boolean, default `true` Safety checking is enabled by default. Direct API callers can pass `"nsfw_checker": false` on the Standard model ids in this page: ```json { "model": "doubao-seedance-2.0-face", "prompt": "Your prompt", "resolution": "720p", "size": "16:9", "duration": 5, "nsfw_checker": false } ``` When set to `false`, reAPI sends the task directly through the Flexible channel when that channel is available and compatible with the request, and does not attach fallback to that task. If no compatible Flexible channel is available, reAPI silently uses the selected Standard channel instead; Standard channel generation remains safety-checked. In both cases, no fallback is attached for that request. ### `image_urls` — string\[] Array of public HTTP(S) URLs. Up to **9** entries. Triggers I2V (when sent without other media fields) or augments REF (when combined with `video_urls` / `audio_urls`). Mutually exclusive with `image_with_roles`. Sending more than 9 is rejected with `400 at most 9 image_urls allowed`. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field on this endpoint must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. ### `image_with_roles` — object\[] First / last frame interpolation. Each entry is a `{url, role}` object: ```json "image_with_roles": [ { "url": "https://your-cdn.com/day.jpg", "role": "first_frame" }, { "url": "https://your-cdn.com/night.jpg", "role": "last_frame" } ] ``` `role` is one of `first_frame` / `last_frame`. Up to **9** entries (typical use: 1 or 2 — one first frame and one last frame). **Cannot be combined** with `image_urls`, `video_urls`, or `audio_urls` — these modes are exclusive. ### `video_urls` — string\[] Reference video clips for REF mode. Up to **3** entries; each clip **2–15 s** long, **combined ≤ 15 s**. Each clip's frame must be **300–6000 px** on each side, **0.41–8.3 MP** total, aspect ratio **0.4–2.5**. Public HTTP(S) URLs only. **No real people on standard / fast variants.** Use the Face variants (`-face`, `-fast-face`) when the reference clip features identifiable real people — the non-Face variants reject them upstream. reAPI probes each clip's resolution and duration server-side via ffmpeg metadata. Out-of-spec assets surface as a `400`: * Frame outside 300–6000 px/side, 0.41–8.3 MP, or aspect 0.4–2.5 → `400 video_urls[i] resolution WxH is out of range` (code `20003`) * Each clip outside 2–15s, or combined > 15s → `400 video_urls total duration X.XXs exceeds the 15s limit` (code `20003`) * Probe failure (network / format) → `400 Could not determine source video duration for billing` (code `30002`) — no charge Mutually exclusive with `image_with_roles`. ### `audio_urls` — string\[] Reference audio for REF mode. Up to **3** entries; **combined duration ≤ 15 seconds**. Public HTTP(S) URLs only. **Must accompany `image_urls` OR `video_urls`** — a request with `audio_urls` and no visual reference is rejected with `400 audio_urls must be used together with image_urls or video_urls`. Mutually exclusive with `image_with_roles`. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "doubao-seedance-2.0-face", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"], "last_frame_url": "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png" }, "error": null } ``` | Field | Type | Notes | | ----------------------- | -------------- | ----------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` (the variant you picked) | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion | | `output.video_urls` | string\[] | Generated MP4 URL(s) — valid for 7 days | | `output.last_frame_url` | string \| null | Present only when the request set `return_last_frame: true` | | `error` | object \| null | Populated on `failed` — `{ code, message }` | *** ## Validation errors All cases below return HTTP 400 with the noted code. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values) and are not a stable contract. | Trigger | Code | Message | | ------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------ | | Missing `prompt` | `20002` | `prompt: Invalid input: expected string, received undefined` | | `prompt` shorter than 3 chars | `20003` | `prompt: Too small: expected string to have >=3 characters` | | `prompt` longer than 20,000 chars | `20003` | `prompt: Too big: expected string to have <=20000 characters` | | `image_urls` and `image_with_roles` together | `20003` | `image_urls and image_with_roles cannot be used simultaneously` | | `image_with_roles` + `video_urls` or `audio_urls` | `20003` | `image_with_roles cannot be combined with video_urls or audio_urls` | | `audio_urls` without visual reference | `20003` | `audio_urls must be used together with image_urls or video_urls` | | `image_urls` > 9 | `20003` | `at most 9 image_urls allowed, got N` | | `image_with_roles` > 9 | `20003` | `at most 9 image_with_roles allowed, got N` | | `image_with_roles[i].role` invalid | `20003` | `image_with_roles[i].role must be first_frame or last_frame, got "..."` | | `video_urls` > 3 | `20003` | `at most 3 video_urls allowed, got N` | | `video_urls` clip frame out of range (300–6000px / 0.41–8.3MP / aspect 0.4–2.5) | `20003` | `video_urls[i] resolution WxH is out of range` | | `video_urls` combined > 15s | `20003` | `video_urls total duration X.XXs exceeds the 15s limit` | | `audio_urls` > 3 | `20003` | `at most 3 audio_urls allowed, got N` | | `audio_urls` combined > 15s | `20003` | `audio_urls total duration X.XXs exceeds the 15s limit` | | `duration` outside 4–15 | `20003` | `duration must be 4-15 seconds, got N` | | Invalid `size` value | `20005` | `invalid size "..." (allowed: 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 21:9 / adaptive)` | | Invalid `resolution` value | `20003` | `invalid resolution "..." (allowed: 480p / 720p / 1080p / 4k)` | | `1080p` on Fast variant | `20003` | `resolution=1080p is not supported by (use doubao-seedance-2.0 or doubao-seedance-2.0-face)` | | `tools[i].type` not `web_search` | `20003` | `tools[i].type must be "web_search", got "..."` | | Any URL field carrying a `data:` URI | `20003` | ` entries must be public URLs; base64 data URIs are not supported` | | Reference video probe fails | `30002` | `Could not determine source video duration for billing: ...` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for wire format and request\_id correlation. *** ## Recipes ### T2V — text-to-video ```json { "model": "doubao-seedance-2.0-face", "prompt": "A kitten yawning at the camera, slow push-in, warm tones", "resolution": "720p", "size": "16:9", "duration": 5, "fallback": { "enabled": false } } ``` ### I2V — single reference image ```json { "model": "doubao-seedance-2.0-face", "prompt": "The kitten stands up and walks toward the camera", "image_urls": ["https://your-cdn.com/cat.jpg"], "duration": 5 } ``` ### FRAMES — first / last frame transition ```json { "model": "doubao-seedance-2.0-face", "prompt": "Smooth transition from day to night", "image_with_roles": [ { "url": "https://your-cdn.com/day.jpg", "role": "first_frame" }, { "url": "https://your-cdn.com/night.jpg", "role": "last_frame" } ], "duration": 5 } ``` ### REF — reference video (style transfer) ```json { "model": "doubao-seedance-2.0-face", "prompt": "Restylize the reference clip into anime aesthetics", "video_urls": ["https://your-cdn.com/reference.mp4"] } ``` ### REF — reference video + reference audio ```json { "model": "doubao-seedance-2.0-face", "prompt": "A scene of a person speaking", "video_urls": ["https://your-cdn.com/reference.mp4"], "audio_urls": ["https://your-cdn.com/speech.wav"], "size": "16:9", "duration": 11 } ``` ### Voiced video (synthesized audio) ```json { "model": "doubao-seedance-2.0-face", "prompt": "A man calls out to a woman: \"Remember — never point at the moon with your finger.\"", "generate_audio": true } ``` ### Continuous video chain Step 1 — produce a 5s clip and ask for the last-frame URL: ```json { "model": "doubao-seedance-2.0-face", "prompt": "The kitten approaches the camera", "image_urls": ["https://your-cdn.com/kitten-start.png"], "return_last_frame": true } ``` Step 2 — feed `output.last_frame_url` as `image_urls` of the next call: ```json { "model": "doubao-seedance-2.0-face", "prompt": "The kitten turns and walks away", "image_urls": [""] } ``` ### Fast variant — quick timelapse ```json { "model": "doubao-seedance-2.0-fast-face", "prompt": "City nightscape timelapse", "size": "21:9", "duration": 8 } ``` ### Multi-modal — images + reference video + reference audio The full REF surface — combine all three reference types for tightly directed product / brand spots. ```json { "model": "doubao-seedance-2.0-face", "prompt": "First-person POV product ad with dynamic camera moves", "image_urls": [ "https://your-cdn.com/product-1.jpg", "https://your-cdn.com/product-2.jpg" ], "video_urls": ["https://your-cdn.com/style-ref.mp4"], "audio_urls": ["https://your-cdn.com/bgm.mp3"], "generate_audio": true, "size": "16:9", "duration": 11 } ``` *** ## Choosing a variant | Need | Pick | | -------------------------------------- | ------------------------------- | | Highest quality, full resolution range | `doubao-seedance-2.0-face` | | Cheaper / faster, 720p ceiling | `doubao-seedance-2.0-fast-face` | Variants are independent products — reAPI never rewrites your selected `model` on the primary attempt. Standard variants can still use the `fallback` policy above after an eligible generation-side failure. *** ## Polling pattern The task endpoint behaves identically to image tasks — only the completed `output` shape differs (`video_urls` / `last_frame_url` instead of `image_urls`). A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. A single generation attempt can run for up to **48 hours**; when fallback is enabled, the overall task window can cover two generation attempts. *** ## Pricing Per-second × **billable seconds**, where: ``` billable_seconds = sum(video_urls clip lengths, server-probed) + duration ``` `video_urls` clip lengths are measured server-side via ffmpeg metadata — **client-stated values are never trusted for billing**. Image and audio references don't add to billable time. T2V / I2V / FRAMES requests (no `video_urls`) bill on `duration` alone. The **per-second rate** depends on three axes: * **Variant** (2 options) * **Resolution** (`480p` / `720p` / `1080p` / `4k`) * **Mode** — `text` (no media references) vs. `ref` (any of `image_urls`, `image_with_roles`, `video_urls`, `audio_urls` is set) REF rates are lower than text rates at every cell. See live numbers on the [model page](https://reapi.ai/models/seedance-2-0#pricing) — that table is dynamic and always reflects the current rate. **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_second_usd × billable_seconds × 1000) ``` Charge on submit; refund automatically on `failed`. Probe failures (unreachable / unreadable `video_urls`) return `400 PRICING_UNAVAILABLE` with no charge. When fallback is enabled, reAPI reserves the larger of the primary and fallback attempt prices. The final successful task is settled to the winning attempt's price and the difference is refunded automatically. If both attempts fail, the full reserve is refunded. **Worked example.** `doubao-seedance-2.0` at `720p`, REF mode, with a 5-second reference video and `duration: 6`: * `billable_seconds = 5 + 6 = 11` * `credits = ceil(per_second_usd × 11 × 1000)` The same `duration: 6` request without `video_urls` would bill 6 seconds at the (higher) text rate. *** ## Tips * **Prompt motion, not just scene.** "Slow push-in, warm tones, shallow depth of field" outperforms a noun-list of what's on screen. * **Sweet-spot duration: 5–10 seconds.** Below 5s motion looks choppy; above 10s generation time grows fast. * **Trim reference clips before upload.** Both their actual length AND your `duration` count toward the bill. A 2-second style snippet is usually enough to convey style — there's no quality bonus for uploading a 15s reference. * **Pick `doubao-seedance-2.0-fast` for iteration.** Fast variants cost noticeably less and miss only the 1080p tier — perfect for prompt-tuning loops where final quality comes later. * **Real people → Face variants.** The non-Face variants reject identifiable real-person assets during generation; switching is a one-character change to `model`. * **Chain continuous video with `return_last_frame`.** Pass the returned URL as `image_urls` of the next request. No prompt drift between segments. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Pricing — Seedance 2.0](https://reapi.ai/models/seedance-2-0#pricing) --- # doubao-seedance-2.5-face (https://reapi.ai/docs/seedance-2-5) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > ByteDance's next-generation async video model, live on reAPI. Seedance 2.5 > turns text, photos, clips, or audio into video up to 30 seconds long, with > generated speech, sound effects and music. Like the rest of the Seedance > family, mode is implicit: which media fields you set (`prompt`, > `image_urls`, `image_with_roles`, `video_urls`, `audio_urls`) decides whether > the request runs as text-to-video, image-to-video, first/last-frame > transition, or reference-driven generation. See pricing on the > [model page](https://reapi.ai/models/seedance-2-5). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.5-face", "prompt": "A kitten yawning at the camera, cinematic warm tones", "resolution": "720p", "size": "16:9", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "doubao-seedance-2.5-face", "prompt": "A kitten yawning at the camera, cinematic warm tones", "resolution": "720p", "size": "16:9", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "doubao-seedance-2.5-face", prompt: "A kitten yawning at the camera, cinematic warm tones", resolution: "720p", size: "16:9", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "doubao-seedance-2.5-face", "prompt": "A kitten yawning at the camera, cinematic warm tones", "resolution": "720p", "size": "16:9", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. ## Request body Mode is implicit — which media fields you set decides text-to-video, image-to-video, first/last-frame, or reference-driven generation. Audio-only reference (just `audio_urls`) is supported, and reference images / videos may contain real people. | Field | Type | Default | Notes | | ------------------- | --------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | — | `doubao-seedance-2.5-face`. **Required.** | | `prompt` | string | — | Describe the video, up to 20000 chars. **Optional when any reference material is present**; required for pure text-to-video. Wrap spoken lines in double quotes to steer the generated speech. | | `duration` | integer | `5` | Output length in seconds: `4`–`30`, or `-1` to let the model pick the best length (**required for video-edit prompts** — see [Task types](#task-types-and-constraints)). `-1` reserves credits at the 30 s cap and settles to the actual output length once the video is ready — the difference is refunded automatically. | | `size` | string | `adaptive` | `16:9` / `9:16` / `1:1` / `4:3` / `3:4` / `21:9` / `adaptive`. **With `image_with_roles` only `adaptive` (or omitted) is accepted** — first/last-frame output follows the first frame image; other values are rejected at submit. | | `resolution` | string | `720p` | `480p` / `720p`. | | `generate_audio` | boolean | `true` | Generate synced speech, sound effects and background music (mono). | | `output_format` | string | `mp4` | `mp4` / `mov`. `mov` uses high color-precision encoding for pro post-production; some players can't play it. | | `return_last_frame` | boolean | `false` | Return `output.last_frame_url` for continuous chaining. | | `seed` | integer | — | Random seed for near-reproducible results. Omitted → random. | | `tools` | object\[] | — | `[{ "type": "web_search" }]` to let the model query the web. | | `image_urls` | string\[] | — | Up to 30 reference images (jpeg / png / webp / bmp / tiff / gif / heic / heif, each \< 30 MB). Public HTTP(S) URLs. | | `image_with_roles` | object\[] | — | First frame alone, or first + last frame (`{ url, role }`, role `first_frame` / `last_frame`, ≤ 2; the two images may be identical). | | `video_urls` | string\[] | — | Up to 10 reference clips (mp4 / mov, 480p–4K, each ≤ 200 MB), each 2–30 s, combined ≤ 30 s. | | `audio_urls` | string\[] | — | Up to 10 reference audio tracks (wav / mp3, each ≤ 15 MB), each 2–30 s, combined ≤ 30 s. | | `nsfw_checker` | boolean | `true` | Safety checking. Set `false` to run the task on the Flexible channel — see [`nsfw_checker`](#nsfw_checker) below. | Constraints enforced before submit: at least one of `prompt` or a reference field must be present; `image_urls` and `image_with_roles` are mutually exclusive; `image_with_roles` cannot be combined with `video_urls` or `audio_urls`, and restricts `size` to `adaptive`. ### `nsfw_checker` Safety checking is enabled by default. Direct API callers can pass `"nsfw_checker": false` to run the task on the Flexible channel: ```json { "model": "doubao-seedance-2.5-face", "prompt": "Your prompt", "resolution": "720p", "size": "16:9", "duration": 5, "nsfw_checker": false } ``` Two things to know about that path: * **No fallback is attached.** The task runs as a single attempt. If it fails, the reserve is refunded in full and retrying is up to you — reAPI will not re-run it on another channel. * **Pricing is identical.** The same request costs the same credits on either channel; `nsfw_checker` selects where the task runs, not a price tier. The field is a reAPI routing control, not an upstream model parameter — it is never forwarded to the generation endpoint. ## Task types and constraints Seedance 2.5 classifies every request into one of five task types based on which reference fields are set **and the intent of the prompt**. Two of them carry hard parameter rules that are judged asynchronously — the task is accepted, then fails after it starts if the rules are violated. Know them before writing prompts: | Task type | Triggered by | Hard rules | | ------------------ | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Text-to-video | prompt only | none | | Reference-to-video | reference material + a descriptive prompt | none — but **avoid edit/extend wording** (see below) or the model may reclassify the task | | Video edit | reference material + prompt containing edit intent (e.g. "edit the video", "add/remove/replace/change X") | **set `duration: -1`** (the output follows the input video's length, ±0.4 s) and keep `size` at `adaptive`/omitted; any fixed duration fails asynchronously with the upstream parameter error | | Video extend | reference material + prompt containing extend intent ("extend", "continue the video", …) | `size` must be `adaptive` | | First/last frame | `image_with_roles` set | `size` must be `adaptive` (enforced synchronously at submit) | The edit/extend classification is decided by the model from your prompt wording — it cannot be validated upfront (the upstream itself only reports these violations asynchronously). If your request fails with a `duration`/`ratio` parameter error you did not expect, remove edit/extend phrasing from the prompt or restructure the request accordingly. Failed tasks are fully refunded. ## Troubleshooting | Failure | What it means | What to do | | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | Synchronous 400 on submit | A field violates the schema (bad resolution, `size` with first/last frames, missing prompt on text-to-video, …) | The error names the field — fix and resubmit; nothing was charged | | Task fails with a parameter error after starting | The model classified your prompt as a video edit/extend task and the parameters don't match its rules (see the table above) | Set `duration: -1` for edits, keep `size` adaptive, or remove edit/extend wording; the reserve is fully refunded | | Task fails citing sensitive content | Reference material or the generated output was rejected by moderation | Fully refunded. Real-person references are supported and reviewed automatically — persistent rejections mean the material itself violates content policy | | `402` on submit | Not enough credits for the reserve (auto-duration reserves at the 30 s cap before settling down) | Top up, or set an explicit shorter `duration` | | Task stays `processing` | Normal for up to a few minutes — generation averages 2–5 min depending on length and references | Keep polling; tasks that can never finish are failed and refunded automatically | **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "doubao-seedance-2.5-face", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/.../0.mp4"], "last_frame_url": "https://cdn.reapi.ai/media/tasks/.../0.png" }, "error": null } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. `output.video_urls` holds the generated video URL (mp4, or mov when `output_format: "mov"` was set). `output.last_frame_url` is present when the request set `return_last_frame: true`. ## Pricing Seedance 2.5 bills per-second, scaled by resolution and reference mode — the same dimensions as the rest of the Seedance family: ``` credits = ceil(per_second_usd × billable_seconds × 1000) ``` where `1 credit = $0.001`. Two rate tiers exist per resolution: the base tier, and a lower per-second tier that applies when the request uploads reference videos (`video_urls`). On that tier `billable_seconds` covers the source clips as well as the output — reAPI probes the real duration of every reference video server-side, and the provider enforces a minimum billable window of `⌈5/3 × duration⌉` seconds for video-input requests, whichever is larger. Image and audio references don't add billable seconds. Current per-second rates are published on the [model page](https://reapi.ai/models/seedance-2-5) — that table is dynamic and always reflects the current rate. Failed jobs are refunded automatically. ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Seedance 2.0 — available now](/docs/seedance-2-0) --- # doubao-seedream-5-0-lite (https://reapi.ai/docs/seedream-5-0-lite) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > ByteDance Doubao's lean image model on reAPI. **2K and 3K** resolution > tiers, **nine aspect ratios**, **image-to-image** via reference URLs, > and **batch generation** of up to four variations per call. Async-first: > submit returns a `task_id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/seedream-5-0-lite). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedream-5-0-lite", "prompt": "a kitten yawning into the camera, cinematic warm tones", "size": "16:9", "resolution": "2K", "n": 1 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "doubao-seedream-5-0-lite", "prompt": "a kitten yawning into the camera, cinematic warm tones", "size": "16:9", "resolution": "2K", "n": 1, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "doubao-seedream-5-0-lite", prompt: "a kitten yawning into the camera, cinematic warm tones", size: "16:9", resolution: "2K", n: 1, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "doubao-seedream-5-0-lite", "prompt": "a kitten yawning into the camera, cinematic warm tones", "size": "16:9", "resolution": "2K", "n": 1, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "doubao-seedream-5-0-lite", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URLs, valid for **72 hours**. Mirror to your own storage if you need them longer. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required `string`. Must be `doubao-seedream-5-0-lite` exactly. The dotted / capitalized aliases the upstream model card mentions are not accepted at this gateway — send the canonical hyphen-only id. ### `prompt` — string, required Up to **4,000 characters**. Free-form text describing the image. Detailed prompts that name the **subject**, the **composition**, the **lighting**, and the **style** consistently produce better results. ### `size` — string, default `"1:1"` Output aspect ratio. One of: | Value | Shape | | ------ | --------------------------------------------------------------- | | `1:1` | Square | | `4:3` | Traditional landscape | | `3:4` | Traditional portrait | | `16:9` | Widescreen landscape | | `9:16` | Widescreen portrait | | `3:2` | Photo landscape | | `2:3` | Photo portrait | | `21:9` | Cinematic ultrawide | | `auto` | Match the first reference image's ratio (requires `image_urls`) | **`9:21` is not supported** on Seedream 5.0 Lite. Sending it returns `400` — use `21:9` for ultrawide framing instead. ### `resolution` — string, default `"2K"` Detail tier. Case-insensitive — `"2K"` and `"2k"` are equivalent. | Value | 1:1 example | 16:9 example | | ----- | ----------- | ------------ | | `2K` | 2048 × 2048 | 2848 × 1600 | | `3K` | 3072 × 3072 | 4096 × 2304 | `1K` and `4K` are not supported on this model — only the two tiers above. ### `n` — integer, default `1` How many images to return per call. Range `[1, 4]`. When `n > 1`, the upstream automatically promotes `sequential_image_generation` to `"auto"` so the call returns a consistent batch in one shot. You don't need to set the field yourself unless you want to override the default. ### `image_urls` — array, optional Reference images for image-to-image / multi-ref fusion. **Public HTTPS URLs only** — base64 / `data:` URIs are rejected at the gateway. Per-image constraints (from the upstream vendor doc): * Format: jpeg or png * Aspect ratio per image must be in `[1/3, 3]` * Each image ≤ 10 MB; total pixels ≤ 6000 × 6000 Upload to your own R2 / S3 / OSS / equivalent first, then pass the public URL. ### `output_format` — string, default `"jpeg"` Encoding for the returned files. * `jpeg` — small files, good for general use * `png` — needed for transparent backgrounds ### `sequential_image_generation` — string, default `"disabled"` Group-mode toggle. Two values: * `disabled` — single-image mode * `auto` — multi-image series mode When `n > 1`, the upstream auto-sets this to `"auto"`. Most callers should leave the field unset and let `n` drive the behavior. ### `sequential_image_generation_options` — object, optional Tuning for group mode. Only meaningful under `"auto"`. | Field | Type | Description | | ------------ | ------- | ----------------------------------------- | | `max_images` | integer | Cap on the number of images in the series | Example: ```json { "sequential_image_generation": "auto", "sequential_image_generation_options": { "max_images": 4 } } ``` ### `watermark` — boolean, default `false` Set `true` to add a Doubao watermark to the output. Off by default. *** ## Pricing Seedream 5.0 Lite charges a flat per-image rate at 2K and 3K. Multiply the per-image credit cost by `n` to size a batch. Failed and moderated requests are refunded automatically. The exact credit cost surfaces on the [model page](https://reapi.ai/models/seedream-5-0-lite) and through the estimator before submit. *** ## Response The poll envelope returns image URLs in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "doubao-seedream-5-0-lite", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...png" ] } } ``` URLs are valid for **72 hours**. Mirror to your own storage for longer retention. --- # Seedream 5.0 Pro (https://reapi.ai/docs/seedream-5-0-pro) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > ByteDance's flagship Doubao Seedream image model on reAPI. **1K and 2K** > resolution tiers, **text-to-image**, **single and multi-reference > image-to-image** (up to 10 reference images), and dependable **text > rendering** for posters, covers, and ad creative. Async-first: submit > returns a `task_id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/seedream-5-0-pro). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedream-5-0-pro", "prompt": "a scarlet macaw on a mossy branch, cinematic god rays, magazine cover titled WILD BEAUTY", "aspect_ratio": "16:9", "quality": "high" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "doubao-seedream-5-0-pro", "prompt": "a scarlet macaw on a mossy branch, cinematic god rays", "aspect_ratio": "16:9", "quality": "high", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "doubao-seedream-5-0-pro", prompt: "a scarlet macaw on a mossy branch, cinematic god rays", aspect_ratio: "16:9", quality: "high", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "doubao-seedream-5-0-pro", "prompt": "a scarlet macaw on a mossy branch, cinematic god rays", "aspect_ratio": "16:9", "quality": "high", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "doubao-seedream-5-0-pro", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URL, valid for **72 hours**. Mirror to your own storage if you need it longer. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required `string`. Must be `doubao-seedream-5-0-pro` exactly. ### `prompt` — string, required Up to **4,000 characters**. Free-form text describing the image. Detailed prompts that name the **subject**, **composition**, **lighting**, and **style** consistently produce better results. Seedream 5.0 Pro renders in-image text well — put headline or logo copy directly in the prompt. ### `aspect_ratio` — string, required Output aspect ratio. Accepted values: * `1:1` * `4:3` * `3:4` * `16:9` * `9:16` * `2:3` * `3:2` ### `quality` — string, required Output resolution tier: * `basic` — 1K output * `high` — 2K output Seedream 5.0 Pro does not expose a 4K tier. Generated images do not include a visible watermark by default. ### `image_urls` — array, optional Reference images for image-to-image (1 image) or multi-reference fusion (up to **10** images). **Public HTTP(S) URLs only** — base64 / `data:` URIs are rejected at the gateway. Upload to your own R2 / S3 / OSS / equivalent first, then pass the public URL. ### `nsfw_checker` — boolean, optional Controls the final-image NSFW output check and defaults to `true`. Direct API requests may pass `false` to skip this additional check. The hosted Playground always keeps it enabled. When enabled, a flagged image is hidden and the task returns a content-policy error. Because the upstream generation already completed, that generation is still charged. Avoid submitting NSFW prompts when using the Playground. Seedream 5.0 Pro always returns **exactly one image** per call — there is no `n` parameter. Send multiple requests when you need multiple images. Group-image, web-search, and streaming options are not available on this model. *** ## Pricing Seedream 5.0 Pro charges the official **per-output-image rate**, banded by `quality` — the `high`/2K band costs more than `basic`/1K. For reference-image requests, the first input image is included and each additional input image (2nd through 10th) adds the official **¥0.02** reference surcharge (converted at the configured 6.8 RMB/USD rate). Provider failures and requests rejected before an image is generated are refunded. An image blocked by the final output check is still charged because generation already completed. ``` credits = ceil((output_price_usd + additional_reference_price_usd) × 1000) ``` where `1 credit = $0.001`. The exact per-image credit cost surfaces on the [model page](https://reapi.ai/models/seedream-5-0-pro) and reflects the current rate. There is no per-token or subscription component. *** ## Response The poll envelope returns the image URL in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "doubao-seedream-5-0-pro", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...jpg" ] } } ``` URLs are valid for **72 hours**. Mirror to your own storage for longer retention. *** ## Errors Failures use the standard envelope `{ error: { code, message, request_id } }`. See the [errors catalog](/docs/api/errors) for the full code list. Common cases: * Invalid parameters (bad `aspect_ratio` / `quality`, oversize `image_urls`) → `4xx` invalid-input. * A prompt or reference rejected before generation → content-policy error; the task is refunded. * A generated image blocked by the enabled output check → content-policy error (`80006`); the image is hidden and the completed generation remains charged. *** ## Tips * Choose `aspect_ratio` explicitly instead of relying on ratio wording in the prompt. * Multi-reference fusion keeps a character consistent — pass the same face / wardrobe references across a series. * Lean on Seedream 5.0 Pro's text rendering for posters, covers, and UI mockups; spell the exact words you want in quotes inside the prompt. *** ## Related * [Seedream 5.0 Lite](/docs/seedream-5-0-lite) — the lean, lower-cost tier * [Tasks reference](/docs/api/tasks) * [Errors catalog](/docs/api/errors) --- # Suno API (https://reapi.ai/docs/suno) import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; # Suno API The `suno-*` model family exposes the complete Suno music toolchain through one endpoint. Generate a song from a text idea or exact lyrics, then keep working on it: extend it, re-cover an uploaded track, layer vocals or instrumentals, mash two songs together, replace a section, separate stems, convert to WAV, extract MIDI, render a music video, or clone a singing voice. Current pricing for every operation is on the [Suno model page](/models/suno). ## Endpoints All 18 asynchronous operations share the audio task endpoint — the `model` field picks the operation: ```http POST /api/v1/audio/generations ``` Poll completion with: ```http GET /api/v1/tasks/{id} ``` Four synchronous helpers answer inline (no task lifecycle): ```http POST /api/v1/audio/suno/boost-style POST /api/v1/audio/suno/timestamped-lyrics POST /api/v1/audio/suno/persona POST /api/v1/audio/suno/check-voice ``` ## Quick example — generate a song ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-music", "customMode": false, "instrumental": false, "version": "V5", "prompt": "A dreamy synthwave track about driving through a neon city at midnight" }' ``` ```python import requests, time headers = {"Authorization": "Bearer YOUR_API_KEY"} task = requests.post( "https://reapi.ai/api/v1/audio/generations", headers=headers, json={ "model": "suno-music", "customMode": False, "instrumental": False, "version": "V5", "prompt": "A dreamy synthwave track about driving through a neon city at midnight", }, ).json() while True: r = requests.get( f"https://reapi.ai/api/v1/tasks/{task['id']}", headers=headers ).json() if r["status"] in ("completed", "failed"): break time.sleep(5) print(r["output"]["tracks"]) ``` ```javascript const headers = { Authorization: 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json', }; const task = await fetch('https://reapi.ai/api/v1/audio/generations', { method: 'POST', headers, body: JSON.stringify({ model: 'suno-music', customMode: false, instrumental: false, version: 'V5', prompt: 'A dreamy synthwave track about driving through a neon city at midnight', }), }).then((r) => r.json()); let result; do { await new Promise((r) => setTimeout(r, 5000)); result = await fetch(`https://reapi.ai/api/v1/tasks/${task.id}`, { headers, }).then((r) => r.json()); } while (result.status === 'processing'); console.log(result.output.tracks); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "net/http" "time" ) const key = "YOUR_API_KEY" func main() { body, _ := json.Marshal(map[string]any{ "model": "suno-music", "customMode": false, "instrumental": false, "version": "V5", "prompt": "A dreamy synthwave track about driving through a neon city at midnight", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/audio/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer "+key) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() var task struct { ID string `json:"id"` } json.NewDecoder(resp.Body).Decode(&task) for { time.Sleep(5 * time.Second) poll, _ := http.NewRequest("GET", "https://reapi.ai/api/v1/tasks/"+task.ID, nil) poll.Header.Set("Authorization", "Bearer "+key) pr, err := http.DefaultClient.Do(poll) if err != nil { panic(err) } var result struct { Status string `json:"status"` Output struct { Tracks []struct { ID string `json:"id"` URL string `json:"url"` Title string `json:"title"` } `json:"tracks"` } `json:"output"` } json.NewDecoder(pr.Body).Decode(&result) pr.Body.Close() if result.Status != "processing" { fmt.Printf("%+v\n", result.Output.Tracks) return } } } ``` One generation request returns **two tracks**. Each track carries an `id` you reuse as `audioId` in every track-referencing operation below. ## Modes: inspiration vs custom Generation-class operations (`suno-music`, `suno-upload-cover`, `suno-mashup`) run in one of two modes: * **`customMode: false` (inspiration)** — `prompt` (max 500 characters) describes the song idea; Suno writes the lyrics. * **`customMode: true` (custom)** — `prompt` is used **strictly as lyrics**; `style` and `title` become required. With `instrumental: true`, `prompt` is not needed. Character caps scale with `version`: `prompt` 3000 (V4) / 5000 (others), `style` 200 (V4) / 1000 (others), `title` 80 (100 on some extend variants). ## Versions `version` is required on generation-class operations: `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. `suno-add-vocals` / `suno-add-instrumental` accept `V4_5PLUS` / `V5` / `V5_5` (default `V4_5PLUS`); `suno-sounds` accepts `V5` / `V5_5`. ## Referencing earlier work: `taskId` + `audioId` Operations that act on an existing song take: * `taskId` — **your reAPI task id** (`task_...`) of the source task. It must be your own completed task; reAPI resolves it internally. * `audioId` — the track id from that task's `output.tracks[].id`. Media inputs (`uploadUrl`, `uploadUrlList`, `voiceUrl`, `verifyUrl`) accept public HTTP(S) URLs only — no base64 / data URIs. ## Operation reference Every asynchronous operation posts to `/api/v1/audio/generations` and is selected by the `model` field; poll `/api/v1/tasks/{id}` for the result. The four synchronous helpers have their own routes and answer inline. ## Create ### Generate a song `POST /api/v1/audio/generations` · `model: "suno-music"` Generates a song from a text description — either a short idea the model turns into lyrics, or your own lyrics, style and title — and returns multiple finished audio variations. **Request** | Field | Type | Required | Notes | | --------------------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-music`. | | `customMode` | boolean | yes | `false` = inspiration mode (describe an idea, the model writes the lyrics). `true` = custom mode (you supply style, title and — for vocal tracks — the exact lyrics). | | `instrumental` | boolean | yes | `true` generates a track with no lyrics. In custom mode it decides whether `prompt` is required; in inspiration mode it does not change which fields are required. | | `version` | string | yes | Model version. One of `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. `V4` caps a track at \~4 min and the `V4_5*` line at \~8 min; `V5` / `V5_5` publish no length cap. Also selects the `prompt` / `style` character limits below. | | `prompt` | string | conditional | Inspiration mode: the core idea, max 500 characters — required, and the lyrics are written from it rather than matching it word for word. Custom mode: used verbatim as the sung lyrics; required when `instrumental` is `false`; max 3000 characters on `V4`, 5000 on every other version. | | `style` | string | conditional | Genre, mood or artistic direction (e.g. `Classical`, `Jazz, upbeat`). Required in custom mode; max 200 characters on `V4`, 1000 on every other version. Ignored in inspiration mode. | | `title` | string | conditional | Track title. Required in custom mode; max 80 characters on all versions. Ignored in inspiration mode. | | `negativeTags` | string | no | Comma-separated styles or traits to steer away from, e.g. `Heavy Metal, Upbeat Drums`. | | `vocalGender` | string | no | `m` or `f`. Only effective when `customMode` is `true`, and it biases the voice rather than guaranteeing it. | | `styleWeight` | number | no | How strictly the result adheres to `style`. `0`–`1`, up to 2 decimal places. | | `weirdnessConstraint` | number | no | How far the result may deviate creatively. `0`–`1`, up to 2 decimal places. | | `audioWeight` | number | no | Balance of audio features against the other inputs. `0`–`1`, up to 2 decimal places. | | `personaId` | string | no | Persona id or voice id to apply to the generated music. Only available when `customMode` is `true`. Persona ids come from `POST /api/v1/audio/suno/persona`; voice ids come from `suno-voice-generate`. | | `personaModel` | string | no | `style_persona` or `voice_persona` — which kind of persona `personaId` refers to. Only available on `V5` and `V5_5`. | **Response** — on completion, `output.audio_urls[]` holds one URL per generated variation (usually two). `output.tracks[]` carries the same items with metadata, index-aligned with `audio_urls`: `type` (`audio`), `url`, `id` (the track's audio id — pass it as `audioId` to extend, WAV, stem-separation, MIDI, music-video and timestamped-lyrics operations), `title`, `duration` in seconds, `tags` (comma-separated style tags), `lyrics` and `image_url` (cover art, rehosted alongside the audio). Only `url` is guaranteed — metadata keys are omitted when upstream returns them empty. **Notes** — the two modes have different required sets, and the API enforces them. Inspiration mode (`customMode: false`) needs only `prompt`, capped at 500 characters; `style` and `title` are ignored. Custom mode (`customMode: true`) always requires `style` and `title`, and additionally requires `prompt` when `instrumental` is `false` — an instrumental custom request is valid with just `style` and `title`. Character caps move with `version`: `prompt` 3000 on `V4` and 5000 elsewhere, `style` 200 on `V4` and 1000 elsewhere; `title` is 80 on every version. Pricing per generation is listed at [https://reapi.ai/models/suno](https://reapi.ai/models/suno). ### Generate lyrics `POST /api/v1/audio/generations` · `model: "suno-lyrics"` Writes song lyrics from a theme description and returns them as structured text — no audio is produced. **Request** | Field | Type | Required | Notes | | -------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | yes | Must be `suno-lyrics`. | | `prompt` | string | yes | Description of the lyrics you want — theme, mood, style or story elements. Max 200 characters. More specific prompts yield more targeted lyrics. | **Response** — this task returns text, not audio: there is no `audio_urls` or `tracks`. On completion `output.result.lyrics[]` holds the generated variations (typically 2–3), each an object with `title` and `text`. The `text` body is formatted with standard section markers (`[Verse]`, `[Chorus]`, `[Bridge]`, …), so it can be passed straight into `suno-music` as `prompt` in custom mode. ```json { "output": { "result": { "lyrics": [ { "title": "Small Town Lights", "text": "[Verse]\n...\n\n[Chorus]\n..." }, { "title": "Back Then", "text": "[Verse]\n...\n\n[Chorus]\n..." } ] } } } ``` **Notes** — variations that the upstream model failed to produce are dropped rather than returned as empty entries, so `lyrics[]` can be shorter than the usual 2–3 items. If none survive, the task fails and the reservation is refunded. ### Generate a sound `POST /api/v1/audio/generations` · `model: "suno-sounds"` Generates a short sound or sound bed — background music, ambience, game SFX — with optional looping, tempo and key control, and returns audio. **Request** | Field | Type | Required | Notes | | ------------ | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-sounds`. | | `prompt` | string | yes | Description of the sound to generate. Max 500 characters. | | `version` | string | yes | Model version. `V5` or `V5_5` only — the older versions do not support sound generation. | | `soundLoop` | boolean | no | Generate the result as a seamless loop, for background music and ambient beds. Defaults to `false`. | | `soundTempo` | integer | no | Target tempo in BPM, `1`–`300`. Omit to let the model choose. | | `soundKey` | string | no | Musical key: `Cm`, `C#m`, `Dm`, `D#m`, `Em`, `Fm`, `F#m`, `Gm`, `G#m`, `Am`, `A#m`, `Bm`, `C`, `C#`, `D`, `D#`, `E`, `F`, `F#`, `G`, `G#`, `A`, `A#`, `B`. Omit for any key. | | `grabLyrics` | boolean | no | Capture lyric subtitles for the generated audio. Defaults to `false`. | **Response** — same shape as a song: `output.audio_urls[]` with one URL per generated variation, and `output.tracks[]` index-aligned with it, each entry carrying the same per-track fields — `type` (`audio`), `url`, `id`, `title`, `duration` in seconds, `tags`, `lyrics` and `image_url` (cover art) — with the empty ones omitted. ## Extend & rework ### Extend a track `POST /api/v1/audio/generations` · `model: "suno-extend"` Continues an existing track from a chosen time point, producing a new set of audio variants that keep the source track's style. **Request** | Field | Type | Required | Notes | | --------------------- | ------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-extend`. | | `defaultParamFlag` | boolean | yes | `true` — extend using the parameters in this request (`prompt`, `style`, `title`, `continueAt` all become required). `false` — inherit the source track's parameters; only `audioId` and `version` are needed. | | `audioId` | string | yes | The track to extend. Take it from the parent task's `output.tracks[].id`. | | `version` | enum | yes | One of `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. Must match the source track's version. | | `prompt` | string | conditional | Required when `defaultParamFlag` is `true`. Describes how the music should continue or change across the extension. Max 3000 chars on `V4`, 5000 on every other version. | | `style` | string | conditional | Required when `defaultParamFlag` is `true`. Style of the extended audio; align it with the source track's style for the most consistent result. Max 200 chars on `V4`, 1000 on every other version. | | `title` | string | conditional | Required when `defaultParamFlag` is `true`. Title of the extended track. Max 80 chars on `V4` and `V4_5ALL`, 100 on every other version. | | `continueAt` | number | conditional | Required when `defaultParamFlag` is `true`. Seconds into the source track where the extension begins. Must be greater than 0 and less than the source track's duration (the upper bound is checked upstream). | | `negativeTags` | string | no | Styles or traits to keep out of the extension, e.g. `Heavy Metal, Upbeat Drums`. | | `vocalGender` | enum | no | `m` or `f`. Raises the probability of that vocal gender; it is not a guarantee. | | `styleWeight` | number | no | 0–1, up to 2 decimal places. Strength of adherence to `style`. | | `weirdnessConstraint` | number | no | 0–1, up to 2 decimal places. Controls experimental/creative deviation. | | `audioWeight` | number | no | 0–1, up to 2 decimal places. Balance of audio features against the other inputs. | | `personaId` | string | no | Persona ID or Voice ID to apply. Only takes effect when `defaultParamFlag` is `true`. | | `personaModel` | enum | no | `style_persona` or `voice_persona`. Only available on `V5` and `V5_5`. | **Response** — on completion, `output.audio_urls` holds the generated audio URLs and `output.tracks[]` carries one index-aligned entry per variant, each with `id` (pass this back as `audioId` in follow-up operations), `url`, `type` (`audio`), `title`, `duration` in seconds, `tags` (comma-separated style tags), `lyrics` and `image_url` (cover art). **Notes** — the `defaultParamFlag` matrix is strict: with `true`, all four of `prompt`, `style`, `title` and `continueAt` must be present, and the per-version character caps above apply; with `false`, everything except `audioId` and `version` is inherited from the source track. `continueAt` must be greater than 0. ### Cover an uploaded track `POST /api/v1/audio/generations` · `model: "suno-upload-cover"` Re-records audio you supply in a new style while keeping its core melody, returning the reworked variants. **Request** | Field | Type | Required | Notes | | --------------------- | ------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | yes | Must be `suno-upload-cover`. | | `uploadUrl` | string | yes | Public `http(s)` URL of the source audio. Maximum 8 minutes. Base64 and `data:` URIs are rejected. | | `customMode` | boolean | yes | `true` — supply your own `style`/`title` (and `prompt` when the result has vocals). `false` — only `prompt` is used and lyrics are generated from it. | | `instrumental` | boolean | yes | `true` produces a track with no lyrics. In custom mode it decides whether `prompt` is required; in non-custom mode it does not change which fields are required. | | `version` | enum | yes | One of `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. | | `prompt` | string | conditional | Required in custom mode when `instrumental` is `false`, where it is used verbatim as the lyrics (max 3000 chars on `V4`, 5000 on every other version). Required in non-custom mode, where it is the core idea lyrics are written from (max 500 chars). | | `style` | string | conditional | Required in custom mode; the genre or style of the cover, e.g. `Jazz`, `Classical`. Max 200 chars on `V4`, 1000 on every other version. Leave empty in non-custom mode. | | `title` | string | conditional | Required in custom mode. Max 80 chars on `V4` and `V4_5ALL`, 100 on every other version. Leave empty in non-custom mode. | | `negativeTags` | string | no | Styles or traits to exclude from the cover. | | `vocalGender` | enum | no | `m` or `f`. Only effective when `customMode` is `true`, and only raises the probability of that vocal gender. | | `styleWeight` | number | no | 0–1, up to 2 decimal places. Strength of adherence to `style`. | | `weirdnessConstraint` | number | no | 0–1, up to 2 decimal places. Controls experimental/creative deviation. | | `audioWeight` | number | no | 0–1, up to 2 decimal places. Balance of audio features against the other inputs. | | `personaId` | string | no | Persona ID or Voice ID to apply. Only available when `customMode` is `true`. | | `personaModel` | enum | no | `style_persona` or `voice_persona`. Only available on `V5` and `V5_5`. | **Response** — on completion, `output.audio_urls` holds the cover's audio URLs and `output.tracks[]` carries one index-aligned entry per variant, each with `id`, `url`, `type` (`audio`), `title`, `duration` in seconds, `tags`, `lyrics` and `image_url` (cover art). **Notes** — the requirement matrix is `customMode` × `instrumental`: custom + instrumental needs `style` and `title`; custom + vocals needs `style`, `title` and `prompt`; non-custom needs only `prompt` (capped at 500 characters) regardless of `instrumental`, and `style`/`title` should be left empty. `uploadUrl` is always required and the audio behind it must not exceed 8 minutes. ### Extend an uploaded track `POST /api/v1/audio/generations` · `model: "suno-upload-extend"` Continues audio you supply from a chosen time point, returning a longer track that carries on the uploaded material's style. **Request** | Field | Type | Required | Notes | | --------------------- | ------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-upload-extend`. | | `uploadUrl` | string | yes | Public `http(s)` URL of the source audio. Maximum 8 minutes. Base64 and `data:` URIs are rejected. | | `defaultParamFlag` | boolean | yes | `true` — extend using the parameters in this request (`style`, `title` and `continueAt` become required, plus `prompt` when `instrumental` is `false`). `false` — reuse the uploaded audio's own parameters; on top of the always-required `uploadUrl`, `instrumental` and `version`, only `prompt` is needed. | | `instrumental` | boolean | yes | `true` extends without lyrics. When `defaultParamFlag` is `true` it decides whether `prompt` is required; when `false` it does not change which fields are required. | | `version` | enum | yes | One of `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. Must match the source music's version. | | `continueAt` | number | conditional | Required when `defaultParamFlag` is `true`. Seconds into the uploaded audio where the extension begins. Must be greater than 0 and less than the uploaded audio's duration (the upper bound is checked upstream). | | `prompt` | string | conditional | Required when `defaultParamFlag` is `true` and `instrumental` is `false`, where it is used verbatim as the lyrics; also required when `defaultParamFlag` is `false`, where lyrics are generated from it. Max 3000 chars on `V4`, 5000 on every other version. | | `style` | string | conditional | Required when `defaultParamFlag` is `true`; e.g. `Jazz`, `Classical`, `Electronic`. Max 200 chars on `V4`, 1000 on every other version. | | `title` | string | conditional | Required when `defaultParamFlag` is `true`. Max 80 chars on `V4` and `V4_5ALL`, 100 on every other version. | | `negativeTags` | string | no | Styles to exclude from the extension. | | `vocalGender` | enum | no | `m` or `f`. Raises the probability of that vocal gender; it is not a guarantee. | | `styleWeight` | number | no | 0–1, up to 2 decimal places. Strength of adherence to `style`. | | `weirdnessConstraint` | number | no | 0–1, up to 2 decimal places. Controls experimental/creative deviation. | | `audioWeight` | number | no | 0–1, up to 2 decimal places. Balance of audio features against the other inputs. | | `personaId` | string | no | Persona ID or Voice ID to apply. Only available when `defaultParamFlag` is `true`. | | `personaModel` | enum | no | `style_persona` or `voice_persona`. Only available on `V5` and `V5_5`. | **Response** — on completion, `output.audio_urls` holds the extended audio URLs and `output.tracks[]` carries one index-aligned entry per variant, each with `id`, `url`, `type` (`audio`), `title`, `duration` in seconds, `tags`, `lyrics` and `image_url` (cover art). **Notes** — the requirement matrix is `defaultParamFlag` × `instrumental`: flag `true` + instrumental needs `style`, `title` and `continueAt`; flag `true` + vocals needs `style`, `title`, `prompt` and `continueAt`; flag `false` needs only `prompt` beyond the always-required `uploadUrl`, `instrumental` and `version` (everything else is taken from the uploaded audio). `continueAt` must be greater than 0, and unlike the cover operation there is no 500-character short-prompt mode — the per-version caps apply in both modes. ## Layer & combine ### Add vocals to a track `POST /api/v1/audio/generations` · `model: "suno-add-vocals"` Takes an audio file you host and sings a new vocal line over it, returning the layered tracks as audio URLs. **Request** | Field | Type | Required | Notes | | --------------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-add-vocals`. | | `uploadUrl` | string | yes | Public HTTP(S) URL of the source audio to add vocals to. Base64 and `data:` URIs are rejected. | | `prompt` | string | yes | Lyric content and singing style to guide the vocal. Min 1 character. | | `style` | string | yes | Musical style for the vocal, e.g. `Jazz`. Min 1 character. | | `title` | string | yes | Track title, shown in players and used for the file name. Min 1 character. | | `negativeTags` | string | yes | Comma-separated styles or elements to keep out of the result, e.g. `heavy metal, strong drum beats`. Min 1 character. | | `version` | string | no | One of `V4_5PLUS`, `V5`, `V5_5`. Defaults to `V4_5PLUS`. | | `vocalGender` | string | no | `m` or `f`. Biases the voice; it raises the probability rather than guaranteeing the gender. | | `styleWeight` | number | no | Adherence to `style`. 0–1, up to 2 decimal places. | | `weirdnessConstraint` | number | no | Experimental / creative deviation. 0–1, up to 2 decimal places. | | `audioWeight` | number | no | Relative weight of the source audio's elements. 0–1, up to 2 decimal places. | **Response** — on completion, `output.audio_urls[]` holds the generated audio URLs and `output.tracks[]` carries one entry per track with `id`, `url`, `type` (`audio`), `title`, `duration` (seconds), `tags` (comma-separated style tags), `lyrics` and `image_url` (cover art). The two arrays are index-aligned, one entry per generated variant. `tracks[].id` is the `audioId` you pass to track-referencing operations. **Notes** — unlike the generate/extend operations, all five content fields (`prompt`, `style`, `title`, `negativeTags`, `uploadUrl`) are unconditionally required, and `version` is restricted to the three newest models: `V4`, `V4_5` and `V4_5ALL` are rejected. Pricing: [reapi.ai/models/suno](https://reapi.ai/models/suno). ```bash curl -X POST https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-add-vocals", "uploadUrl": "https://example.com/music.mp3", "prompt": "A calm and relaxing piano track.", "style": "Jazz", "title": "Relaxing Piano", "negativeTags": "heavy metal, strong drum beats", "version": "V4_5PLUS" }' ``` ### Add instrumental to a track `POST /api/v1/audio/generations` · `model: "suno-add-instrumental"` Takes an audio file you host and generates an instrumental accompaniment for it, returning the layered tracks as audio URLs. **Request** | Field | Type | Required | Notes | | --------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-add-instrumental`. | | `uploadUrl` | string | yes | Public HTTP(S) URL of the source audio to accompany. Base64 and `data:` URIs are rejected. | | `tags` | string | yes | Styles to include, e.g. `relaxing, piano, soothing`. Defines the character of the accompaniment. Min 1 character. | | `title` | string | yes | Track title, shown in players and used for the file name. Min 1 character. | | `negativeTags` | string | yes | Comma-separated styles or elements to keep out of the result. Min 1 character. | | `version` | string | no | One of `V4_5PLUS`, `V5`, `V5_5`. Defaults to `V4_5PLUS`. | | `vocalGender` | string | no | `m` or `f`. Biases the voice; it raises the probability rather than guaranteeing the gender. | | `styleWeight` | number | no | Adherence to the requested style. 0–1, up to 2 decimal places. | | `weirdnessConstraint` | number | no | Experimental / creative deviation. 0–1, up to 2 decimal places. | | `audioWeight` | number | no | Relative weight of the source audio's elements. 0–1, up to 2 decimal places. | **Response** — same shape as add-vocals: `output.audio_urls[]` plus `output.tracks[]` with `id`, `url`, `type`, `title`, `duration`, `tags` and `lyrics` per track. **Notes** — this operation names the style field `tags`, not `style`; sending `style` is rejected. All four of `uploadUrl`, `tags`, `title` and `negativeTags` are unconditionally required, and `version` accepts only `V4_5PLUS`, `V5` and `V5_5`. Pricing: [reapi.ai/models/suno](https://reapi.ai/models/suno). ```bash curl -X POST https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-add-instrumental", "uploadUrl": "https://example.com/music.mp3", "tags": "relaxing, piano, soothing", "title": "Relaxing Piano", "negativeTags": "heavy metal, strong drum beats", "version": "V4_5PLUS" }' ``` ### Mash up two tracks `POST /api/v1/audio/generations` · `model: "suno-mashup"` Combines exactly two audio files you host into one new piece, returning the remixed tracks as audio URLs. **Request** | Field | Type | Required | Notes | | --------------------- | --------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `model` | string | yes | Must be `suno-mashup`. | | `uploadUrlList` | string\[] | yes | Exactly 2 public HTTP(S) audio URLs. Fewer or more is rejected; base64 and `data:` URIs are rejected. | | `customMode` | boolean | yes | `true` unlocks the detailed controls (`style`, `title`, lyrics); `false` is the simple mode driven by `prompt` alone. | | `version` | string | yes | One of `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. | | `instrumental` | boolean | no | Generate the mashup without lyrics. In custom mode it decides whether `prompt` is required; in non-custom mode it has no effect on required fields. | | `prompt` | string | no | Conditionally required — see Notes. In custom mode it is used verbatim as the lyrics; in non-custom mode it is the core idea and lyrics are written from it. | | `style` | string | conditional | Required in custom mode, ignored otherwise. Genre, mood or artistic direction. | | `title` | string | conditional | Required in custom mode, ignored otherwise. Max 80 characters on every version. | | `vocalGender` | string | no | `m` or `f`. Only takes effect when `customMode` is `true`. | | `styleWeight` | number | no | Adherence to `style`. 0–1, up to 2 decimal places. Only takes effect when `customMode` is `true`. | | `weirdnessConstraint` | number | no | Creative deviation. 0–1, up to 2 decimal places. Only takes effect when `customMode` is `true`. | | `audioWeight` | number | no | Weight of the source audio elements. 0–1, up to 2 decimal places. Only takes effect when `customMode` is `true`. | **Response** — `output.audio_urls[]` plus `output.tracks[]`, each track carrying `id`, `url`, `type`, `title`, `duration`, `tags` and `lyrics`. **Notes** — `uploadUrlList` must contain exactly two URLs. With `customMode: true`, `style` and `title` become required, and `prompt` is required too unless `instrumental` is `true`; the caps then depend on `version` — `prompt` up to 3000 characters on `V4` and 5000 on every other version, `style` up to 200 on `V4` and 1000 elsewhere, `title` 80 throughout. With `customMode: false`, `prompt` is optional but capped at 500 characters and the other content fields are ignored. Pricing: [reapi.ai/models/suno](https://reapi.ai/models/suno). ```bash curl -X POST https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-mashup", "uploadUrlList": [ "https://example.com/audio1.mp3", "https://example.com/audio2.mp3" ], "customMode": true, "instrumental": false, "version": "V4_5PLUS", "prompt": "A calm and relaxing piano track with soft melodies", "style": "Jazz", "title": "Relaxing Piano" }' ``` ## Section editing ### Replace a section `POST /api/v1/audio/generations` · `model: "suno-replace-section"` Regenerates one time window inside an existing song from a new prompt and style, blending the replacement into the material before and after it, and returns the re-rendered track(s). **Request** | Field | Type | Required | Notes | | -------------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-replace-section`. | | `taskId` | string | conditional | Variant A. The reAPI task id (`task_...`) of the song you are editing. Required together with `audioId`; see Notes. | | `audioId` | string | conditional | Variant A. Identifies which track of that task to edit — take it from the parent task's `output.tracks[].id`. Required together with `taskId`. | | `uploadUrl` | string | conditional | Variant B. Public `http(s)` URL of your own audio file. Required together with `version`. Base64 / `data:` URIs are rejected. | | `version` | enum | conditional | Variant B. Model version used to render the replacement: `V4`, `V4_5`, `V4_5PLUS`, `V4_5ALL`, `V5`, `V5_5`. Required together with `uploadUrl`. | | `prompt` | string | yes | Lyrics for the replaced segment. Min 1 char. | | `tags` | string | yes | Style tags for the replaced segment, e.g. `Jazz`. Min 1 char. | | `title` | string | yes | Title of the resulting song. Min 1 char. | | `negativeTags` | string | no | Styles to keep out of the replaced segment, e.g. `Rock`. Min 1 char. | | `infillStartS` | number | yes | Start of the replacement window, in seconds from the beginning of the track. `>= 0`. Must be less than `infillEndS`. Values are interpreted to 2-decimal precision (e.g. `10.50`). | | `infillEndS` | number | yes | End of the replacement window, in seconds. `>= 0`. Must be greater than `infillStartS`, and `infillEndS - infillStartS` must be between 6 and 60 seconds. | | `fullLyrics` | string | yes | The COMPLETE lyrics of the song after the edit — untouched sections plus the rewritten one — not just the replaced part. Min 1 char. | **Response** — on completion, `output.audio_urls[]` holds the URL of each rendered track. `output.tracks[]` carries the same audio index-aligned with per-track metadata: `type` (`"audio"`), `url`, `id` (pass this back as `audioId` in later track-referencing operations), `title`, `duration` (seconds), `tags`, and `lyrics`. **Notes** — the source is specified by exactly one of two mutually exclusive variants: **(A)** `taskId` + `audioId` to edit a track generated on reAPI, or **(B)** `uploadUrl` + `version` to edit audio you supply. Both halves of a variant must be present together, and mixing fields from the two variants in one request is rejected with a validation error — so is sending neither. `version` belongs to variant B only — sending it alongside `taskId` / `audioId` is what makes a request "mixed", so variant A must omit it and the replacement is rendered with the source track's own model. Two further limits apply to the window: it must span at least 6 and at most 60 seconds, and upstream additionally refuses a replacement longer than 50% of the original track's total duration. `fullLyrics` is what the whole song is re-rendered against, so passing only the new lines will drop the rest of the lyrics. ## Track assets These operations act on a track you already generated: they take the reapi `taskId` of a completed Suno task plus (usually) the `audioId` of one track inside it, and return a derived asset. Per-operation pricing: [https://reapi.ai/models/suno](https://reapi.ai/models/suno). ### Separate vocals and instrument stems `POST /api/v1/audio/generations` · `model: "suno-vocal-separation"` Splits one generated track into vocal/accompaniment or per-instrument stems and returns one audio URL per stem. **Request** | Field | Type | Required | Notes | | ---------- | ------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-vocal-separation`. | | `taskId` | string | yes | reapi task id (`task_...`) of a completed Suno task that produced the track. Min length 1. | | `audioId` | string | yes | The track inside that task to process. Copy it from the parent task's `output.tracks[].id`. Min length 1. | | `type` | enum | no | Separation mode. `separate_vocal` (default) splits into 2 stems — vocals + instrumental. `split_stem` splits into up to 12 stems (vocals, backing vocals, drums, bass, guitar, keyboard, strings, brass, woodwinds, percussion, synth, FX/other). `split_stem_advanced` does multi-stem separation and can target one specific instrument via `stemName`. | | `stemName` | enum | conditional | The single instrument track to extract. Only meaningful with `type: "split_stem_advanced"`, where it is required. 98 accepted values covering vocals, drums, guitars, keys, strings, brass, woodwinds, percussion and synths — e.g. `Lead Vocal`, `Backing Vocals`, `Drum Kit`, `Kick`, `Bass`, `Piano`, `Electric Guitar`, `Synth Pad`, `Brass Section`, `Violin`, `Flute`, `808`. | **Response** `output.audio_urls` holds one URL per separated stem, index-aligned with `output.tracks[]`. Each entry in `output.tracks[]` carries `type: "audio"`, `url`, and `label` naming the stem. When upstream returns per-stem records, `label` is the upstream stem group name and the track also carries `id` and `duration`; otherwise `label` comes from the fixed set `origin`, `instrumental`, `vocals`, `backing_vocals`, `drums`, `bass`, `guitar`, `piano`, `keyboard`, `percussion`, `strings`, `synth`, `fx`, `brass`, `woodwinds`. Stems that upstream did not produce are simply absent — the array length varies with the mode and the source material. **Notes** — `stemName` is rejected as missing only when `type` is `split_stem_advanced`; the other two modes ignore it. Separation quality depends on the mix: cleanly separated AI mixes yield the best stems. The per-stem `id` values returned here are what you pass as `audioId` to `suno-midi`. ### Convert a track to WAV `POST /api/v1/audio/generations` · `model: "suno-wav"` Re-renders one generated track as an uncompressed WAV file for professional editing. **Request** | Field | Type | Required | Notes | | --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-wav`. | | `taskId` | string | yes | reapi task id (`task_...`) of the completed Suno task that produced the track. Min length 1. | | `audioId` | string | yes | Which track in that task to convert. Copy it from the parent task's `output.tracks[].id`. Min length 1. | **Response** `output.audio_urls` holds a single URL pointing at the WAV file. No `output.tracks[]` is emitted for this operation. **Notes** — WAV files are typically 5–10× larger than the MP3 equivalent, and processing time scales with the length of the source track. ### Generate MIDI from separated stems `POST /api/v1/audio/generations` · `model: "suno-midi"` Transcribes separated audio into structured MIDI note data (pitch, timing, velocity) per detected instrument. **Request** | Field | Type | Required | Notes | | --------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-midi`. | | `taskId` | string | yes | reapi task id (`task_...`) of a completed **vocal-separation** task — not a music-generation task. Min length 1. | | `audioId` | string | no | Restricts transcription to one separated stem; take the value from that separation task's `output.tracks[].id`. Omit to transcribe all separated stems. Min length 1. | **Response** A structured text result, not audio: there is no `audio_urls` or `tracks`. On completion `output.result.midi` holds a `state` string and an `instruments[]` array. Each instrument has a `name` and a `notes[]` array whose entries carry `pitch` (MIDI note number, 0–127), `start` and `end` (seconds), and `velocity` (0–1). **Notes** — Separation must run first; passing the task id of a plain music-generation task is not valid input for this operation. Not every instrument is detected — the result reflects what is actually present in the source stems, and upstream notes that separations run with `type: "split_stem"` can yield no note data at all. If upstream completes with no note data, the task is reported as failed rather than completing with an empty result. ### Create a music video `POST /api/v1/audio/generations` · `model: "suno-music-video"` Renders one generated track into an MP4 with visualizations plus optional artist and brand attribution. **Request** | Field | Type | Required | Notes | | ------------ | ------ | -------- | --------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-music-video`. | | `taskId` | string | yes | reapi task id (`task_...`) of the completed Suno task that produced the track. Min length 1. | | `audioId` | string | yes | Which track in that task to visualize. Copy it from the parent task's `output.tracks[].id`. Min length 1. | | `author` | string | no | Artist or creator name shown as a signature on the video cover. 1–50 characters. | | `domainName` | string | no | Website or brand shown as a watermark at the bottom of the video. 1–50 characters. | **Response** `output.video_urls` holds a single URL pointing at the rendered MP4. **Notes** — Render time varies with the length of the source track. ### Generate cover art `POST /api/v1/audio/generations` · `model: "suno-cover-image"` Generates cover images for a completed music task; usually returns two stylistic variants to choose from. **Request** | Field | Type | Required | Notes | | -------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-cover-image`. | | `taskId` | string | yes | reapi task id (`task_...`) of the completed music-generation task to illustrate. Min length 1. Note this operation targets the task as a whole — there is no `audioId`. | **Response** `output.image_urls` holds the generated cover images, typically two. **Notes** — A cover can be generated only once per source task; a second request for the same `taskId` is rejected upstream rather than producing new images. Submit it after the music task has completed. ## Voice cloning Cloning a singing voice is a three-step chain, and each step is its own billable task (see [pricing](https://reapi.ai/models/suno)): 1. **`suno-voice-validate`** — submit the source recording and the vocal segment to analyse. The completed task returns a *validation phrase*. 2. **`suno-voice-generate`** — have the person record themselves reading (ideally singing) that phrase, host the recording at a public URL, and submit it as `verifyUrl` together with the reapi `taskId` of the step-1 task. The completed task returns a `voiceId`. 3. **`suno-voice-regenerate`** — only needed when a validation phrase failed or expired. The `voiceId` from step 2 is then used in the generation operations that accept a persona: pass it as `personaId` with `personaModel: "voice_persona"`. ### Step 1 — Generate a validation phrase `POST /api/v1/audio/generations` · `model: "suno-voice-validate"` Analyses the vocal segment of a source recording and returns the phrase the speaker must read aloud to verify the voice. **Request** | Field | Type | Required | Notes | | ------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-voice-validate`. | | `voiceUrl` | string | yes | Public `http(s)` URL of the source recording. Base64 / `data:` payloads are rejected. | | `vocalStartS` | integer | yes | Start time, in seconds, of the vocal segment to extract. `0` or greater. | | `vocalEndS` | integer | yes | End time, in seconds, of the vocal segment. Must be greater than `vocalStartS`. | | `language` | string | no | Language of the generated phrase. Upstream documents `en`, `zh`, `es`, `fr`, `pt`, `de`, `ja`, `ko`, `hi`, `ru`. | ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-voice-validate", "voiceUrl": "https://example.com/audio/source_voice.mp3", "vocalStartS": 0, "vocalEndS": 10, "language": "en" }' ``` **Response** — a structured text result. When the task completes, `output.result.validateInfo` holds the phrase text to be read, and `output.result.status` holds the upstream state that made it terminal (`wait_validating` while the phrase awaits the reader, `success` once the whole flow has finished). **Notes** — `vocalEndS` must be strictly greater than `vocalStartS`; equal or inverted values are rejected before the task is created. Keep the reapi task id (`task_...`) returned by this call: step 2 references it, and it is the only handle you have on the phrase — the upstream phrase id is never exposed. ### Step 2 — Create the custom voice `POST /api/v1/audio/generations` · `model: "suno-voice-generate"` Submits the reader's verification recording against a completed validation task and produces a reusable custom voice. **Request** | Field | Type | Required | Notes | | ------------------ | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-voice-generate`. | | `taskId` | string | yes | Your reapi task id (`task_...`) from step 1 (or from a step-3 regeneration). Must be your own task, in `completed` status, from the same surface, and from the voice flow. | | `verifyUrl` | string | yes | Public `http(s)` URL of the recording of the person reading the `validateInfo` phrase. Singing the phrase rather than speaking it produces a more accurate voice profile. Base64 / `data:` payloads are rejected. | | `voiceName` | string | no | Display name for the voice. | | `description` | string | no | Free-text description of the voice. | | `style` | string | no | Voice style, e.g. `Pop, Female Vocal`. | | `singerSkillLevel` | enum | no | One of `beginner`, `intermediate`, `advanced`, `professional`. Upstream default is `beginner`. | ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-voice-generate", "taskId": "task_abc123", "verifyUrl": "https://example.com/audio/verify_read.mp3", "voiceName": "My Voice", "description": "created from uploaded voice", "style": "Pop, Female Vocal", "singerSkillLevel": "beginner" }' ``` **Response** — a structured text result: `output.result.voiceId`, the identifier of the finished custom voice. **Notes** — feed `voiceId` back into a generation call as `personaId`, together with `personaModel: "voice_persona"`. The persona fields only apply in custom mode (`customMode: true`), and `personaModel` is only available on `V5` and `V5_5`. The `taskId` reference is resolved and rejected before any charge, so a bad or unfinished parent task costs nothing. A clean a-cappella take of the verification recording gives the most accurate voice profile. ### Step 3 — Regenerate the validation phrase `POST /api/v1/audio/generations` · `model: "suno-voice-regenerate"` Asks upstream for a fresh validation phrase on an existing voice task, for when the previous phrase failed or expired. **Request** | Field | Type | Required | Notes | | -------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Must be `suno-voice-regenerate`. | | `taskId` | string | yes | Your reapi task id (`task_...`) of an earlier voice-flow task. Same ownership / `completed` / voice-family checks as step 2. | ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-voice-regenerate", "taskId": "task_abc123" }' ``` **Response** — a structured text result carrying the NEW phrase: the task completes with `output.result.validateInfo` (and its `status`), the same shape step 1 returns. **Notes** — this reissues the validation phrase, it does not produce a voice. Record yourself reading the new phrase and send that recording to step 2 (`suno-voice-generate`) with this task's id as `taskId`. Use it when the earlier phrase expired or the reading was rejected. ## Synchronous helpers These four operations do not run on `/api/v1/audio/generations` and have no task lifecycle — they answer inline on the same HTTP response, so there is nothing to poll. Each has its own route, accepts only the fields listed below (unknown fields are rejected), and returns `id` (the audit task id recording this call, `task_...`), `credits` (the credits charged), plus its result fields. A failed call is refunded in full. Pricing: [reapi.ai/models/suno](https://reapi.ai/models/suno). ```bash curl -X POST https://reapi.ai/api/v1/audio/suno/boost-style \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"content":"Pop, Mysterious"}' ``` ### Boost music style `POST /api/v1/audio/suno/boost-style` Expands a short style description into a richer, generation-ready style prompt and returns the enhanced text inline. **Request** | Field | Type | Required | Notes | | --------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `content` | string | yes | Style description to enhance, min 1 character. Describe the music style you expect in concise, clear language — e.g. `Pop, Mysterious`. | **Response** — `result`: the enhanced style text. Feed it into the `style` field of a generation request. ### Timestamped lyrics `POST /api/v1/audio/suno/timestamped-lyrics` Returns word-level time-aligned lyrics for one track of a completed song task. **Request** | Field | Type | Required | Notes | | --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------- | | `taskId` | string | yes | Your reapi task id (`task_...`) of the completed song task the track belongs to, min 1 character. | | `audioId` | string | yes | Identifier of the specific track, min 1 character. Take it from the parent task's `output.tracks[].id`. | **Response** * `alignedWords`: array of aligned words, each with `word` (the lyric token), `success` (boolean, whether that token aligned), `startS` / `endS` (word start and end time in seconds), and `palign` (alignment parameter). * `waveformData`: array of numbers for audio visualisation, or `null` when upstream omits it. * `hootCer`: lyrics alignment accuracy score, or `null`. * `isStreamed`: whether the source is streaming audio, or `null`. **Notes** — `taskId` must name a Suno-family task you own that has reached `completed`; a task that is still running, or one from outside the Suno family, is rejected before any charge. Which Suno operation produced it is not gated here — upstream expects a music-generating parent (song or extend) and answers for the rest. `waveformData` is delivered inline only — it is deliberately not kept in the audit row, so a later `GET /api/v1/tasks/{id}` on this call's `id` returns the other three fields plus `waveform_omitted: true`. ### Generate persona `POST /api/v1/audio/suno/persona` Analyses a segment of an existing track and creates a reusable persona, returning its `personaId`. **Request** | Field | Type | Required | Notes | | ------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `taskId` | string | yes | Your reapi task id (`task_...`) of the completed song task to analyse, min 1 character. | | `audioId` | string | yes | Identifier of the track to build the persona from, min 1 character. Take it from the parent task's `output.tracks[].id`. | | `name` | string | yes | Name for the persona, min 1 character — something that captures the musical style or character, e.g. `Electronic Pop Singer`. | | `description` | string | yes | Description of the persona's musical characteristics, style and personality, min 1 character. Be specific about genre, mood, instrumentation and vocal qualities. | | `vocalStart` | number | no | Start of the analysis segment in seconds, `>= 0`. Defaults to `0`. | | `vocalEnd` | number | no | End of the analysis segment in seconds, `>= 0`. Defaults to `30`. | | `style` | string | no | Supplementary style tag for the persona, min 1 character — e.g. `Electronic Pop`, `Jazz Trio`. | **Response** — `personaId`: the persona identifier, reusable in the `personaId` field of the song, extend, upload-cover and upload-extend operations. `name` and `description` echo the request (each `null` if upstream omits it). **Notes** — the analysis window is validated before charging: `vocalEnd - vocalStart` must be between 10 and 30 seconds inclusive, using the defaults `0` and `30` for whichever bound you omit. Setting only `vocalStart: 25` therefore fails (window is 5s), while `vocalStart: 25, vocalEnd: 40` succeeds. `taskId` must name a completed Suno task you own. ### Check voice availability `POST /api/v1/audio/suno/check-voice` Reports whether a custom voice produced by a completed voice task is ready to use. **Request** | Field | Type | Required | Notes | | --------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `task_id` | string | yes | Your reapi task id (`task_...`) of the completed voice task to check, min 1 character. This endpoint's field is snake\_case `task_id` — the rest of the surface is camelCase. | **Response** — `isAvailable`: boolean, whether the generated voice is available. **Notes** — `task_id` must resolve to a completed **voice-family** task you own — in practice the `suno-voice-generate` or `suno-voice-regenerate` task that produced the voice; a song task is rejected before any charge. ## Output schema Asynchronous results land on `GET /api/v1/tasks/{id}`: ```json { "id": "task_...", "status": "completed", "output": { "audio_urls": ["https://..."], "tracks": [ { "id": "track id — reuse as audioId", "url": "https://...", "title": "Midnight Drive", "duration": 128.5, "tags": "synthwave, dreamy", "lyrics": "..." } ] }, "error": null } ``` Music videos populate `output.video_urls`, cover art `output.image_urls`; lyric / MIDI / voice tasks return a structured text `output` (e.g. `{ "lyrics": [...] }`, `{ "midi": ... }`, `{ "voiceId": "..." }`, `{ "validateInfo": "..." }`). ## Pricing dimensions Every operation bills a flat rate per request — nothing scales with duration or output length. Generation-class operations (music, extend, covers, vocals, mashup) share one rate covering both returned tracks; section replacement, stem separation (three tiers by `type`), music video, sound effects, lyrics, WAV conversion, and the utility operations each have their own flat rate. Bill formula: `credits = price_usd × 1000` (1 credit = $0.001). Current rates: [Suno model page](/models/suno). ## Errors Failures use the standard envelope `{ "error": { "code", "message", "request_id" } }` — see the [error catalog](/docs/api/errors). Notable cases: content flagged by moderation returns a policy error (80006); malformed parameter combinations surface 80007 with the upstream reason; upstream generation failures (80003) are refunded automatically. ## Tips * Start in inspiration mode (`customMode: false`) — one prompt line is enough. Switch to custom mode when you need exact lyrics. * `style` reads best as comma-separated genre + mood + vocal tags (`"synthwave, dreamy, female vocal"`). Use the boost-style helper to expand a rough idea. * Save `output.tracks[].id` — every downstream operation needs it. * For extensions, pick `continueAt` a beat before the natural end of the source so the transition lands cleanly. * Instrumental-only? Set `instrumental: true` and skip lyrics entirely. ## Related * [Mureka V9 Song](/docs/mureka-v9-song) — lyrics-first song generation * [Music Video 1.0](/docs/music-video-1-0) — song + images → MV * [Vocal Remover](/docs/vocal-remover) — standalone stem separation --- # topaz-video-upscaler (https://reapi.ai/docs/topaz-video-upscaler) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Topaz Video Upscaler upscales and enhances a **source video** — restoring > detail and pushing resolution toward 4K. One async endpoint, two parameters: > a `video_url` and an `upscale_factor` (`"1"` / `"2"` / `"4"`). Billing is per > second of the source clip's server-probed length × the upscale tier. See > current pricing on the > [model page](https://reapi.ai/models/topaz-video-upscaler). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "topaz-video-upscaler", "video_url": "https://your-cdn.com/source-480p.mp4", "upscale_factor": "2" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "topaz-video-upscaler", "video_url": "https://your-cdn.com/source-480p.mp4", "upscale_factor": "2", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "topaz-video-upscaler", video_url: "https://your-cdn.com/source-480p.mp4", upscale_factor: "2", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "topaz-video-upscaler", "video_url": "https://your-cdn.com/source-480p.mp4", "upscale_factor": "2", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "topaz-video-upscaler", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the upscaled MP4 URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Request body ### `model` — required `string`. Must be `"topaz-video-upscaler"`. ### `video_url` — required `string`. Public HTTP(S) URL of the **source video** to upscale — MP4, MOV, or MKV, up to 50MB. The output preserves the source clip's duration and frame timing. The **billable second count is the source video's server-probed duration**, not a client estimate. **No `data:` URIs.** reApi rejects base64 inputs platform-wide. Upload to public storage (your own CDN, S3, R2…) and pass the URL. ### `upscale_factor` — string, default `"2"` How much each frame is enlarged. The factor also selects the per-second pricing tier. | Value | Behavior | Tier | | ----- | ----------------------------------------------- | ----------- | | `"1"` | Clean and restore detail at the same resolution | `1×` / `2×` | | `"2"` | Double each dimension (default) | `1×` / `2×` | | `"4"` | Enlarge 4× toward 4K | `4×` | `"1"` and `"2"` share one per-second rate; `"4"` is a higher tier. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "topaz-video-upscaler", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | *** ## Pricing Per-second × upscale tier. The billable second count is the source video's **server-probed** length — reApi measures the uploaded clip server-side rather than trusting a client value. The `1×` / `2×` factors share one per-second rate; `4×` is a higher tier. **Bill formula** (1 credit = $0.001): ``` billable_seconds = ceil(server_probed_source_seconds) bill_usd = per_second_usd(tier) × billable_seconds // tier from upscale_factor credits = ceil(bill_usd × 1000) ``` See current per-second rates for each tier on the [model page](https://reapi.ai/models/topaz-video-upscaler). Failed jobs refund automatically. A probe failure returns `400 PRICING_UNAVAILABLE` (code `30002`) with no charge. The playground's draft estimate may show a default before the upload finishes — the authoritative number is computed at submit, after the server probes the file. *** ## Validation errors All cases below return HTTP 400. Pattern-match on `code`, not `message` — message strings carry request-specific context and are not a stable contract. | Trigger | Code | Message (illustrative) | | ------------------------------------------------ | ------- | --------------------------------------------------------------- | | `video_url` missing | `20002` | `topaz-video-upscaler: video_url is required` | | `video_url` carrying a `data:` URI / non-public | `20003` | `topaz-video-upscaler: video_url must be a public http(s) URL` | | `upscale_factor` not one of `1` / `2` / `4` | `20003` | `topaz-video-upscaler: invalid upscale_factor (allowed: 1/2/4)` | | Source video probe fails (network / format) | `30002` | `Could not determine source video duration for billing: …` | | Source video too large / unsupported by upstream | `80007` | Provider rejected the request as invalid | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Minimum request (2× default) ```json { "model": "topaz-video-upscaler", "video_url": "https://your-cdn.com/source-480p.mp4" } ``` ### Same-size cleanup (1×) ```json { "model": "topaz-video-upscaler", "video_url": "https://your-cdn.com/source-1080p-grainy.mp4", "upscale_factor": "1" } ``` ### Push to 4K (4×) ```json { "model": "topaz-video-upscaler", "video_url": "https://your-cdn.com/source-540p.mp4", "upscale_factor": "4" } ``` *** ## Tips * **Cost tracks the source clip.** A 6s source bills \~6 seconds; trim or compress long footage before submitting to cap spend. * **Pick the factor by need.** `1×` restores detail at the same size, `2×` is the balanced default, `4×` targets 4K from low-resolution sources. * **Mind the 50MB input cap.** Re-encode or split oversized clips; the upstream rejects files over the limit (`80007`), refunded automatically. * **Length is preserved.** Upscaling changes resolution and detail, not duration — a 10s input returns a 10s output. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) --- # Veo 3.1 (https://reapi.ai/docs/veo3-1) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Google's VEO 3.1 video model on reAPI. **Five channels** share one > endpoint and submit shape — pick the channel via `model`. > > | Channel | Bills | Notes | > | ------------------------- | -------------- | ------------------------------------- | > | `veo3.1-fast` | per generation | Image-to-video (≤ 3 refs), remix-able | > | `veo3.1-quality` | per generation | Frame-mode I2V only, remix-able | > | `veo3.1-lite` | per generation | Prompt-only — no images | > | `veo3.1-fast-official` | per second | First/last-frame I2V, audio, 4K | > | `veo3.1-quality-official` | per second | Premium per-second tier | > > 8-second outputs on alt channels (4 / 6 / 8 seconds on official) at > 720p / 1080p / 4K. Use the [remix endpoint](#remix) to extend Fast > or Quality clips to 15 seconds. See current pricing on the > [model page](https://reapi.ai/models/veo3-1). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "veo3.1-fast", "prompt": "A dolphin leaping through cobalt ocean waves at sunrise", "aspect_ratio": "16:9", "resolution": "720p" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "veo3.1-fast", "prompt": "A dolphin leaping through cobalt ocean waves at sunrise", "aspect_ratio": "16:9", "resolution": "720p", }, ) task_id = resp.json()["data"][0]["task_id"] ``` ```js const res = await fetch('https://reapi.ai/api/v1/videos/generations', { method: 'POST', headers: { Authorization: 'Bearer rk_live_xxx', 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'veo3.1-fast', prompt: 'A dolphin leaping through cobalt ocean waves at sunrise', aspect_ratio: '16:9', resolution: '720p', }), }); const { data } = await res.json(); const taskId = data[0].task_id; ``` ```go package main import ( "bytes" "encoding/json" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "veo3.1-fast", "prompt": "A dolphin leaping through cobalt ocean waves at sunrise", "aspect_ratio": "16:9", "resolution": "720p", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) _ = out } ``` ## Endpoint `POST /api/v1/videos/generations` Returns a `task_id` immediately. Poll `GET /api/v1/tasks/{task_id}` until `status` is `completed` to retrieve the video URL. ## Request fields ### Common (every channel) | Field | Type | Required | Notes | | -------------- | ------ | -------- | ------------------------------------ | | `model` | string | yes | One of the five channel ids above | | `prompt` | string | yes | ≤ 4000 chars; English recommended | | `aspect_ratio` | enum | no | `16:9` (default landscape) or `9:16` | | `resolution` | enum | no | `720p` (default), `1080p`, or `4k` | ### Alt channels (`veo3.1-fast`, `veo3.1-quality`, `veo3.1-lite`) | Field | Type | Notes | | ----------------- | --------- | ------------------------------------------------------ | | `duration` | int | Fixed at `8` upstream | | `image_urls` | string\[] | Up to 3 public http(s) URLs (Fast / Quality only) | | `generation_type` | enum | `frame` or `reference` (Quality channel: `frame` only) | | `enable_gif` | bool | Output GIF instead of mp4. Mutex with `1080p` / `4k` | `veo3.1-lite` rejects `image_urls` and `generation_type`. Send only `prompt` + the common fields. ### Official channels (`veo3.1-fast-official`, `veo3.1-quality-official`) | Field | Type | Notes | | ------------------- | ------ | -------------------------------------------------------------- | | `duration` | int | `4`, `6`, or `8` (default `8`). Billed per second × `duration` | | `negative_prompt` | string | What to avoid | | `first_frame_image` | string | Public http(s) URL — anchors opening frame | | `last_frame_image` | string | Requires `first_frame_image`; interpolation target | | `seed` | int | `0`–`4294967295` | | `generate_audio` | bool | Adds synthesized audio (audio pricing tier) | | `person_generation` | enum | `allow_adult` (default) or `disallow` | | `resize_mode` | enum | `pad` (default) or `crop` | | `enhance_prompt` | bool | Must be `true` if sent — omit to disable | **Image inputs are URLs only.** Every reference image / frame field rejects base64 and `data:` URIs at the gateway. Upload the image to any public HTTPS host first. ## Image-to-video — alt channel ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "veo3.1-fast", "prompt": "The cat slowly walks forward and looks around", "image_urls": ["https://example.com/cat.png"], "generation_type": "frame", "aspect_ratio": "16:9", "resolution": "720p" }' ``` ## Image-to-video — official channel (first / last frame) ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "veo3.1-quality-official", "prompt": "Smooth cinematic transition from the first frame to the last frame", "first_frame_image": "https://example.com/start.png", "last_frame_image": "https://example.com/end.png", "aspect_ratio": "16:9", "resolution": "1080p", "duration": 8, "generate_audio": true }' ``` ## Remix — extend an 8s clip to 15s `POST /api/v1/videos/{task_id}/remix` Available on `veo3.1-fast` and `veo3.1-quality` only. The path `task_id` is the reApi task id returned by the original generation; the source task must be in `completed` status. The `model` in the body must match the source task's model. ```bash curl https://reapi.ai/api/v1/videos/{TASK_ID}/remix \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "veo3.1-fast", "prompt": "The dolphin dives back into the wave and surfaces a moment later", "raw": false, "aspect_ratio": "16:9", "resolution": "720p" }' ``` | Field | Type | Notes | | -------------- | ------ | -------------------------------------------------------------------------------------- | | `model` | enum | `veo3.1-fast` or `veo3.1-quality` — must equal source | | `prompt` | string | Continuation prompt; ≤ 4000 chars | | `raw` | bool | `true` returns only the extension segment; `false` (default) returns the combined clip | | `aspect_ratio` | enum | Optional — same set as generations | | `resolution` | enum | Optional — same set as generations | The remix endpoint returns a fresh `task_id`. Poll `GET /api/v1/tasks/{task_id}` exactly like a generation. ## Polling ```bash curl https://reapi.ai/api/v1/tasks/{TASK_ID} \ -H "Authorization: Bearer rk_live_xxx" ``` Response while in flight: ```json { "code": 200, "data": { "id": "task_…", "status": "processing", "progress": 47 } } ``` Response on success: ```json { "code": 200, "data": { "id": "task_…", "status": "completed", "result": { "videos": [{ "url": ["https://cdn.reapi.ai/…/video.mp4"] }] } } } ``` Generated video URLs are rehosted to reApi's CDN — they don't expire with the upstream signed-URL window. --- # viduq3 (https://reapi.ai/docs/viduq3) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Vidu Q3 — async video generation. **Two variants** (`viduq3-pro`, > `viduq3-turbo`) share one endpoint and one parameter shape. Mode is > implicit: the number of `image_urls` you send picks **T2V**, **I2V**, or > **first/last-frame** transition. 1–16 second outputs at 540p / 720p / > 1080p, audio-on by default. See current pricing on the > [model page](https://reapi.ai/models/viduq3). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "viduq3-pro", "prompt": "A kitten playing piano, slow camera push-in", "duration": 8, "resolution": "1080p", "aspect_ratio": "16:9" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "viduq3-pro", "prompt": "A kitten playing piano, slow camera push-in", "duration": 8, "resolution": "1080p", "aspect_ratio": "16:9", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "viduq3-pro", prompt: "A kitten playing piano, slow camera push-in", duration: 8, resolution: "1080p", aspect_ratio: "16:9", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "viduq3-pro", "prompt": "A kitten playing piano, slow camera push-in", "duration": 8, "resolution": "1080p", "aspect_ratio": "16:9", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "viduq3-pro", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URL, valid for 7 days. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` Keys carry the active workspace's billing scope — there is no separate project header. *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Variants Both variants share one parameter shape; pick via `model`: | Variant | Speed | Resolutions | Notes | | -------------- | -------- | ------------------- | --------------------- | | `viduq3-pro` | standard | 540p / 720p / 1080p | Highest fidelity | | `viduq3-turbo` | faster | 540p / 720p / 1080p | Lower per-second cost | reAPI never silently substitutes one variant for another — what you send in `model` is what gets billed and forwarded. *** ## Mode routing `viduq3` picks its mode from the **count of `image_urls`** you send — there is no `mode` parameter: | `image_urls` count | Mode | What it does | | ------------------ | -------------- | --------------------------------------------- | | `0` (or omitted) | **T2V** | Generate from text. `aspect_ratio` allowed. | | `1` | **I2V** | Animate from a single starting frame. | | `2` | **First/Last** | Transition between two frames (first → last). | **Mutex rules.** * In T2V (no `image_urls`), `prompt` is **required**. * When `image_urls` is set (1 or 2 entries), `aspect_ratio` is **rejected** with `400` — the source frame's ratio decides the output ratio. * More than 2 `image_urls` is rejected with `400 image_urls accepts at most 2 entries`. *** ## Request body ### `model` — required `string`. One of `"viduq3-pro"` or `"viduq3-turbo"`. ### `prompt` — string, conditional Up to **2,000 characters**. Required in T2V (when `image_urls` is empty); optional in I2V and First/Last when at least one image is provided. Empty / whitespace-only prompts are treated as missing. **Failure modes.** * Empty / missing in T2V → `400 prompt is required when image_urls is empty (text-to-video)` (code `20002`). * Longer than 2,000 chars → `400 prompt exceeds 2000 characters (got N)` (code `20007`). ### `duration` — integer, default `5` Output length in seconds. Any integer in `[1, 16]`. Out-of-range → `400`. Drives pricing linearly: `ceil(per_second_usd × duration × 1000)` credits (1 credit = $0.001). ### `resolution` — string, default `"720p"` `540p` / `720p` / `1080p`. Drives pricing. Lowercase is canonical; uppercase forms (`"1080P"`) are accepted and normalized. ### `aspect_ratio` — string, T2V only Output ratio in T2V mode. One of: | Value | Shape | | ------ | --------------------- | | `16:9` | Landscape | | `9:16` | Portrait | | `4:3` | Traditional landscape | | `3:4` | Traditional portrait | | `1:1` | Square | **Only valid when `image_urls` is empty.** In I2V and First/Last modes the upstream derives the ratio from the source frame and rejects this field with `400 aspect_ratio is only allowed in text-to-video mode` (code `20003`). ### `image_urls` — string\[] Array of public HTTP(S) URLs. **0 to 2 entries**: * **0 entries** — pure text-to-video. * **1 entry** — image-to-video; the image is treated as the first frame. * **2 entries** — first/last-frame transition. The first URL is the starting frame; the second URL is the ending frame. **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field on this endpoint must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. ### `audio` — boolean, default `true` When `true`, the model synthesizes an audio track (dialogue, sound effects) that plays alongside the generated video. Set to `false` for silent output. Audio generation does not change the per-second rate. ### `seed` — integer Reproducibility hint. Range `[-1, 4294967295]`. Same seed plus an otherwise identical request returns a similar (not bit-for-bit identical) result. Use `-1` (or omit) for full randomness. *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "viduq3-pro", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | `output.video_urls` URLs are valid for **7 days**. Re-host to your own storage if you need them longer. *** ## Validation errors All cases below return HTTP 400 with code `20003` unless noted. Pattern-match on `code`, not `message` — message strings carry request-specific context (field names, observed values, etc.) and are not a stable contract. | Trigger | Code | Message (illustrative) | | -------------------------------------------------- | ------- | --------------------------------------------------------------------------------------- | | `prompt` missing in T2V | `20002` | `viduq3: prompt is required when image_urls is empty (text-to-video)` | | `prompt` longer than 2,000 chars | `20007` | `viduq3: prompt exceeds 2000 characters (got N)` | | `image_urls` length > 2 | `20003` | `viduq3: image_urls accepts at most 2 entries, got N` | | `aspect_ratio` set with `image_urls` non-empty | `20003` | `viduq3: aspect_ratio is only allowed in text-to-video mode (image_urls must be empty)` | | `duration` outside `[1, 16]` | `20003` | `viduq3: duration must be 1-16 seconds, got N` | | Unknown `resolution` | `20003` | `viduq3: invalid resolution "X" (allowed: 540p / 720p / 1080p)` | | Unknown `aspect_ratio` | `20003` | `viduq3: invalid aspect_ratio "X" (allowed: 16:9 / 9:16 / 4:3 / 3:4 / 1:1)` | | `seed` outside `[-1, 4294967295]` | `20003` | `viduq3: seed must be in [-1, 4294967295], got N` | | `image_urls` carrying a `data:` URI or non-http(s) | `20003` | `viduq3: image_urls entries must be public http(s) URLs` | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### T2V — minimum request ```json { "model": "viduq3-pro", "prompt": "A little girl walking down a sunset coastal road" } ``` ### T2V — full parameters ```json { "model": "viduq3-pro", "prompt": "A kitten playing piano, slow camera push-in, cinematic warm tones", "duration": 8, "resolution": "1080p", "aspect_ratio": "16:9", "audio": true, "seed": 42 } ``` ### I2V — animate a single frame ```json { "model": "viduq3-pro", "prompt": "Bring the scene to life with a gentle camera dolly forward", "image_urls": ["https://your-cdn.com/first_frame.jpg"], "duration": 5, "resolution": "1080p" } ``` ### First/Last-frame transition ```json { "model": "viduq3-pro", "prompt": "Smooth motion from standing to seated", "image_urls": [ "https://your-cdn.com/standing.jpg", "https://your-cdn.com/seated.jpg" ], "duration": 8 } ``` ### Silent video — disable audio ```json { "model": "viduq3-pro", "prompt": "Sunset timelapse over the ocean", "duration": 10, "resolution": "1080p", "audio": false } ``` ### Turbo — cost-conscious ```json { "model": "viduq3-turbo", "prompt": "Waves crashing on a beach at sunset, wide shot", "duration": 5, "resolution": "720p" } ``` *** ## Choosing a mode | Need | Send | | ------------------------------------ | ---------------------------------------------------------------- | | Generate from text | `prompt` only (T2V) — `aspect_ratio` allowed | | Animate a still | `prompt + image_urls` (1 entry) (I2V) | | Smooth transition between two frames | `image_urls` (2 entries) (First/Last) | | Cut spend | Switch to `viduq3-turbo` or drop `resolution` to `720p` / `540p` | *** ## Polling pattern The task endpoint behaves identically to other video tasks — the only difference is the completed `output` shape (`video_urls` instead of `image_urls`). A pragmatic schedule: ``` 0–5 minutes: poll every 5s 5 min – 1 h: back off gradually toward 1 min ≥ 1 h: cap at 3 min between polls ``` A typical task completes in a few minutes. The worker's wall-clock cap is **48 hours**, comfortably above any realistic queue. *** ## Pricing Per-second × resolution. Mode does **not** change the rate. Turbo undercuts Pro at every tier. See current rates on the [Vidu Q3 model page](https://reapi.ai/models/viduq3). **Bill formula** (1 credit = $0.001): ``` credits = ceil(per_second_usd × duration × 1000) ``` Failed jobs refund automatically. *** ## Tips * **Prompt motion, not just scene.** "Slow push-in, warm tones, shallow depth of field" outperforms a pure noun-list of what's on screen. * **Sweet-spot duration: 5–10 seconds.** Below 5s motion looks choppy; above 10s the upstream wall-time grows fast. * **First-frame quality matters.** Subject centered, clear composition, no heavy filters — I2V output quality tracks input quality directly. * **Two frames need to make sense as endpoints.** First/Last works best when the two frames share enough subject and composition that the model can interpolate motion between them — wildly different shots produce abrupt transitions. * **Pick Turbo first if you're iterating.** It's roughly half the cost per second; lock the prompt on Turbo, then re-render the keeper on Pro at the resolution you'll ship. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # Vocal Remover API (https://reapi.ai/docs/vocal-remover) import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; # Vocal Remover API Use `audio-stem-separator` with `stem: "vocals"` to isolate the vocal track from a mixed song and receive downloadable audio through the universal task flow. Typical uses: acapellas for remixing, vocal analysis, cleaning a reference vocal before a [voice conversion](/docs/voice-changer) pass. ## Endpoint ```http POST /api/v1/audio/generations ``` Poll the returned task: ```http GET /api/v1/tasks/{id} ``` ## Example ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "audio-stem-separator", "audio_url": "https://cdn.example.com/song.wav", "stem": "vocals", "encoder_format": "mp3" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/audio/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "audio-stem-separator", "audio_url": "https://cdn.example.com/song.wav", "stem": "vocals", "encoder_format": "mp3", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/audio/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "audio-stem-separator", audio_url: "https://cdn.example.com/song.wav", stem: "vocals", encoder_format: "mp3", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "audio-stem-separator", "audio_url": "https://cdn.example.com/song.wav", "stem": "vocals", "encoder_format": "mp3", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/audio/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ## Parameters | Field | Type | Required | Notes | | ------------------ | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Use `audio-stem-separator`. | | `audio_url` | URL | yes | Public HTTP(S) source audio URL. Base64 / `data:` URIs are rejected platform-wide. | | `stem` | enum | yes | Use `vocals` for this API page. Other stems: `drum`, `piano`, `bass`, `electric_guitar`, `acoustic_guitar`, `synthesizer`, `strings`, `wind`. | | `splitter` | enum | no | `auto`, `andromeda`, `perseus`, `orion`, `phoenix`, `lyra`, or `lynx`. `auto` is omitted upstream so the default engine is used. `synthesizer` / `strings` / `wind` stems require `phoenix`. | | `extraction_level` | enum | no | `deep_extraction` or `clear_cut`. Defaults to `deep_extraction`. | | `multivocal` | string | no | `lead_back`. Only valid with `stem: "vocals"` — separates lead from backing vocals. | | `dereverb_enabled` | boolean | no | Enable dereverb cleanup. | | `encoder_format` | enum | no | `mp3`, `wav`, `flac`, `aac`, or `ogg`. | Requests are strictly validated: unknown fields are rejected with `400` rather than ignored. ## Output Completed tasks return `output.audio_urls`. When labels are available, `output.tracks` includes `type`, `label`, and `url` for each track: ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "status": "completed", "output": { "audio_urls": ["https://cdn.reapi.ai/.../vocals.mp3"] } } ``` ## Billing Audio jobs are billed per rounded-up source minute — a 2:30 source bills as 3 minutes. Failed jobs refund automatically. See the current per-minute rate on the [Vocal Remover model page](https://reapi.ai/models/vocal-remover). ## Which audio model do I need? | Goal | Model | Docs | | --------------------------------- | -------------------------------------------- | ---------------------------------------------- | | Keep the vocals, drop the music | `audio-stem-separator` with `stem: "vocals"` | this page | | Keep the music, drop the vocals | `audio-music-extractor` | [Music Extractor](/docs/music-extractor) | | Split several instruments at once | `audio-multistem` | [Multistem Splitter](/docs/multistem-splitter) | | Denoise / de-reverb speech | `audio-voice-clean` | [Voice Cleaner](/docs/voice-cleaner) | | Convert vocals to another voice | `audio-voice-change` | [Voice Changer](/docs/voice-changer) | ## Related * [Tasks & polling](/docs/api/tasks) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) --- # Voice Changer API (https://reapi.ai/docs/voice-changer) # Voice Changer API Use `audio-voice-change` to convert vocals with a configured voice pack. ## Endpoint ```http POST /api/v1/audio/generations ``` Poll completion with: ```http GET /api/v1/tasks/{id} ``` ## Example ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "audio-voice-change", "audio_url": "https://cdn.example.com/source-vocal.wav", "voice_pack_id": "voice_pack_id_here", "accent": 1, "encoder_format": "mp3" }' ``` ## Parameters | Field | Type | Required | Notes | | -------------------- | ------- | -------- | --------------------------------------------------------- | | `model` | string | yes | Use `audio-voice-change`. | | `audio_url` | URL | yes | Public HTTP(S) source vocal URL. | | `voice_pack_id` | string | yes | Target voice pack id. | | `accent` | number | no | 0 to 1. Defaults to `1`. | | `tonality_reference` | enum | no | `source_file` or `voice_pack`. Defaults to `source_file`. | | `dereverb_enabled` | boolean | no | Enable dereverb cleanup. | | `encoder_format` | enum | no | `mp3`, `wav`, `flac`, `aac`, or `ogg`. | ## Output Completed tasks return `output.audio_urls` and, when available, labeled `output.tracks`. Audio jobs are billed per rounded-up source minute. See current rate on the [Voice Changer model page](https://reapi.ai/models/voice-changer). --- # Voice Cleaner API (https://reapi.ai/docs/voice-cleaner) import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; # Voice Cleaner API Use `audio-voice-clean` for speech cleanup before publishing, transcription, voiceover preparation, or downstream editing. It reduces background noise at three selectable strengths and can additionally reduce room reverb. ## Endpoint ```http POST /api/v1/audio/generations ``` Poll completion with: ```http GET /api/v1/tasks/{id} ``` ## Example ```bash curl https://reapi.ai/api/v1/audio/generations \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "audio-voice-clean", "audio_url": "https://cdn.example.com/podcast.wav", "noise_cancelling_level": 1, "encoder_format": "mp3" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/audio/generations", headers={ "Authorization": "Bearer rk_live_xxx", "Content-Type": "application/json", }, json={ "model": "audio-voice-clean", "audio_url": "https://cdn.example.com/podcast.wav", "noise_cancelling_level": 1, "encoder_format": "mp3", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/audio/generations", { method: "POST", headers: { Authorization: "Bearer rk_live_xxx", "Content-Type": "application/json", }, body: JSON.stringify({ model: "audio-voice-clean", audio_url: "https://cdn.example.com/podcast.wav", noise_cancelling_level: 1, encoder_format: "mp3", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "audio-voice-clean", "audio_url": "https://cdn.example.com/podcast.wav", "noise_cancelling_level": 1, "encoder_format": "mp3", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/audio/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer rk_live_xxx") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ## Parameters | Field | Type | Required | Notes | | ------------------------ | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- | | `model` | string | yes | Use `audio-voice-clean`. | | `audio_url` | URL | yes | Public HTTP(S) source audio URL. Base64 / `data:` URIs are rejected platform-wide. | | `noise_cancelling_level` | integer | no | `0`, `1`, or `2` — off, moderate, strongest. Defaults to `0`. | | `splitter` | enum | no | `auto`, `andromeda`, `perseus`, `orion`, `phoenix`, `lyra`, or `lynx`. `auto` is omitted upstream so the default engine is used. | | `dereverb_enabled` | boolean | no | Additionally reduce room reverb. | | `encoder_format` | enum | no | `mp3`, `wav`, `flac`, `aac`, or `ogg`. | Requests are strictly validated: unknown fields are rejected with `400` rather than ignored. ## Output Completed tasks return `output.audio_urls` and, when available, labeled `output.tracks`: ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "status": "completed", "output": { "audio_urls": ["https://cdn.reapi.ai/.../clean.mp3"] } } ``` ## Billing Audio jobs are billed per rounded-up source minute — a 2:30 source bills as 3 minutes. Failed jobs refund automatically. See the current per-minute rate on the [Voice Cleaner model page](https://reapi.ai/models/voice-cleaner). ## Which audio model do I need? | Goal | Model | Docs | | --------------------------------- | -------------------------------------------- | ---------------------------------------------- | | Denoise / de-reverb speech | `audio-voice-clean` | this page | | Keep the vocals, drop the music | `audio-stem-separator` with `stem: "vocals"` | [Vocal Remover](/docs/vocal-remover) | | Keep the music, drop the vocals | `audio-music-extractor` | [Music Extractor](/docs/music-extractor) | | Split several instruments at once | `audio-multistem` | [Multistem Splitter](/docs/multistem-splitter) | | Convert vocals to another voice | `audio-voice-change` | [Voice Changer](/docs/voice-changer) | ## Related * [Tasks & polling](/docs/api/tasks) * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) --- # wan-2-7-image (https://reapi.ai/docs/wan-2-7-image) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Alibaba's Wan image model on reAPI — one async endpoint for **generation and > editing**. Text-to-image, **image editing**, **multi-image reference fusion**, > **interactive region edits** (`bbox_list`), and **group series**. Two tiers: > `wan2.7-image` (1K / 2K) and `wan2.7-image-pro` (text-to-image up to **4K**). > Submit returns a `task_id`; poll until ready. See current pricing on the > [model page](https://reapi.ai/models/wan-2-7-image). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-image-pro", "prompt": "a flower shop with delicate windows and a beautiful wooden door, blossoms out front", "size": "16:9", "resolution": "2K", "n": 1 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "wan2.7-image-pro", "prompt": "a flower shop with delicate windows and a beautiful wooden door, blossoms out front", "size": "16:9", "resolution": "2K", "n": 1, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "wan2.7-image-pro", prompt: "a flower shop with delicate windows and a beautiful wooden door, blossoms out front", size: "16:9", resolution: "2K", n: 1, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "wan2.7-image-pro", "prompt": "a flower shop with delicate windows and a beautiful wooden door, blossoms out front", "size": "16:9", "resolution": "2K", "n": 1, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "wan2.7-image-pro", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URLs. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Tiers Two model ids share one parameter shape: | Model id | Tier | Resolution | | ------------------ | -------- | -------------------------------------------------------- | | `wan2.7-image` | Standard | 1K / 2K (all modes) | | `wan2.7-image-pro` | Pro | text-to-image up to 4K; editing and group modes up to 2K | Pick Pro for hero / print-grade detail and 4K; Standard for fast everyday work. ## Modes There is no `mode` field — the mode is implicit in the request shape: * **Text-to-image** — no `image_urls`. `prompt` is required. * **Editing / multi-image reference** — pass `image_urls`. `prompt` is optional (recommended). The output aspect ratio follows the **last** input image. * **Interactive region editing** — add `bbox_list` to target exact regions. * **Group series** — set `enable_sequential: true` for a consistent connected set; raises the `n` cap to 12. *** ## Request body ### `model` — string, required One of `wan2.7-image` or `wan2.7-image-pro`. ### `prompt` — string Up to **5,000 characters**. Required for text-to-image (no `image_urls`); optional but recommended in editing mode. ### `image_urls` — array, optional Reference images for editing / multi-image fusion. **Public HTTPS URLs only** — base64 / `data:` URIs are rejected at the gateway. Up to **9** images. Passing any image switches the request to editing mode. ### `n` — integer, default `1` Images per call. Range `[1, 4]` normally; up to `[1, 12]` when `enable_sequential` is `true`. Billed per generated image. ### `size` — string Output sizing. Polymorphic per the model: * a gear keyword — `1K` / `2K` / `4K` * an aspect ratio — `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3` * a pixel value — `1024x1024` Pair an aspect ratio here with the quality gear in `resolution`. ### `resolution` — string Quality gear: `1K` / `2K` / `4K` (case-insensitive). **4K is `wan2.7-image-pro` text-to-image only.** In editing and group modes, and on the `wan2.7-image` (standard) tier, the maximum is 2K. ### `negative_prompt` — string, optional What to keep out of the image, e.g. `"blurry, distorted, low quality"`. ### `watermark` — boolean, default `false` Set `true` to add an AI-generated watermark to the bottom-right corner. ### `seed` — integer, optional Range `[0, 2147483647]`. The same seed with the same parameters yields a similar, stable result. ### `thinking_mode` — boolean, default `true` Enables extra reasoning for higher image quality. Only effective for text-to-image with no reference image and outside group mode; ignored otherwise. ### `enable_sequential` — boolean, default `false` Turns on group mode — a consistent, connected series in one call. Raises the `n` cap to 12. In group mode `thinking_mode` and `color_palette` do not apply. ### `bbox_list` — array, optional Interactive-edit regions. A list parallel to `image_urls` — one entry per input image — where each entry is a list of up to two boxes, and each box is `[x1, y1, x2, y2]` in absolute pixels with origin at the top-left. Use `[]` for an image you are not boxing. ```json { "image_urls": [ "https://example.com/clock.webp", "https://example.com/desk.webp" ], "bbox_list": [ [], [[989, 515, 1138, 681]] ] } ``` ### `color_palette` — array, optional Steer the image toward a custom palette. 3-10 items of `{ hex, ratio }` where `ratio` is a percentage string and all ratios sum to `100.00%`. Non-group mode only. ```json { "color_palette": [ { "hex": "#C2D1E6", "ratio": "23.51%" }, { "hex": "#636574", "ratio": "76.49%" } ] } ``` *** ## Pricing Wan 2.7 Image bills a flat rate **per successfully generated image**, independent of resolution and aspect ratio. Total charge is the per-image rate times `n`: ``` credits = ceil(per_image_usd × n × 1000) ``` where `1 credit = $0.001 USD`. The Pro tier carries a higher per-image rate than Standard. Failed and rejected requests are not charged. The exact per-image credit cost for each tier surfaces on the [model page](https://reapi.ai/models/wan-2-7-image) and through the playground estimator before submit. *** ## Response The poll envelope returns image URLs in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "wan2.7-image-pro", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...png" ] } } ``` For a group-mode request (`enable_sequential: true`, `n > 1`), `image_urls` holds the full series in order. Mirror the URLs to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (out-of-range `n`, 4K requested in edit/group mode, a `bbox_list` whose length does not match `image_urls`, a non-HTTPS media URL) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * The mode is decided by your inputs, not a flag — omit `image_urls` for pure generation, include it to edit. * For precise edits, prefer `bbox_list` over describing the location in the prompt — boxed regions composite with matched lighting and perspective. * For storyboards and comic panels, use group mode (`enable_sequential: true`) so the series stays on-model in one call instead of stitching separate requests. * Reach for `wan2.7-image-pro` at `resolution: "4K"` (text-to-image) when the asset goes to print or a retina display; use `wan2.7-image` for fast drafts. *** ## Related * [Image generation models](/docs/gpt-image-2) * [Seedream 5.0 Lite](/docs/seedream-5-0-lite) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # wan-2-7-video (https://reapi.ai/docs/wan-2-7-video) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Wan 2.7 Video is a single umbrella model (`wan2.7-video`) that auto-routes by > request shape into **text-to-video**, **image-to-video**, > **reference-to-video**, and **video editing**. One async endpoint, 720P or > 1080P output, billed per second. See current pricing on the > [model page](https://reapi.ai/models/wan-2-7-video). ## Quick example ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-video", "prompt": "a paper boat drifting down a rain-soaked street at dusk, neon reflections, slow dolly-in, cinematic", "resolution": "1080P", "duration": 5 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "wan2.7-video", "prompt": "a paper boat drifting down a rain-soaked street at dusk", "resolution": "1080P", "duration": 5, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "wan2.7-video", prompt: "a paper boat drifting down a rain-soaked street at dusk", resolution: "1080P", duration: 5, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "wan2.7-video", "prompt": "a paper boat drifting down a rain-soaked street at dusk", "resolution": "1080P", "duration": 5, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "wan2.7-video", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.video_urls` holds the generated MP4 URLs. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. *** ## Modes There is no `mode` field. The umbrella model `wan2.7-video` infers the mode from **which inputs you send**: | Mode | Trigger | Notes | | ------------------ | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- | | Text-to-video | `prompt` only | A prompt alone renders a clip. | | Image-to-video | `image_urls` / `image_with_roles` / `video_urls` (and `audio_url`) | Animate a still, set first/last frame, continue a clip, or drive motion with audio. | | Reference-to-video | `reference_image_urls` and/or `reference_video_urls` | Keeps your subjects while following a referenced performance; `reference_voice_urls` add per-subject audio. | | Video editing | `video_url` (the source clip) | Re-renders the source against the prompt; `audio_setting` controls the soundtrack. | The fields valid in each mode are mutually exclusive — sending, e.g., a reference field together with a `video_url` edit source is rejected as invalid. *** ## Parameters | Field | Type | Required | Default | Notes | | ---------------------- | --------- | -------- | ------- | ------------------------------------------------------------------------------- | | `model` | string | yes | — | Must be `"wan2.7-video"`. | | `prompt` | string | cond. | — | Up to 5000 chars. Required for text-to-video and reference-to-video. | | `negative_prompt` | string | no | — | Up to 500 chars. What to avoid. | | `image_urls` | string\[] | no | — | Public image URLs. 1 animates a still; 2 set first/last frame. Max 4. | | `image_with_roles` | object\[] | no | — | `[{ url, role }]` where role is `first_frame` or `last_frame`. Max 2. | | `video_urls` | string\[] | no | — | Continuation source. Public video URL. Max 1. | | `audio_url` | string | no | — | Public audio URL. Drives motion with an image input. | | `reference_image_urls` | string\[] | no | — | Reference subjects. Public image URLs. Up to 5. | | `reference_video_urls` | string\[] | no | — | Reference motion/action. Public video URLs. Up to 5. | | `reference_voice_urls` | string\[] | no | — | Per-subject voices. Public audio URLs. Count must equal `reference_image_urls`. | | `video_url` | string | no | — | Edit source. Public video URL. Routes to video editing. | | `audio_setting` | enum | no | — | Video editing only. `auto` or `origin`. | | `size` | enum | no | `16:9` | Aspect ratio: `16:9`, `9:16`, `1:1`, `4:3`, `3:4`. | | `resolution` | enum | no | `1080P` | `720P` or `1080P`. Scales the per-second rate. | | `duration` | integer | no | `5` | Seconds. Base modes 2–15; reference/edit modes cap lower (see below). | | `prompt_extend` | boolean | no | `true` | Expand a short prompt into a richer description before rendering. | | `watermark` | boolean | no | `false` | Add a watermark to the output. | | `seed` | integer | no | — | `>= 0`. Fixes the random seed for reproducible output. | **No `data:` URIs.** reApi rejects base64 inputs platform-wide. Upload media to public storage (your own CDN, S3, R2…) and pass the URL. ### Duration limits by mode | Mode | Allowed `duration` | | -------------------------------- | -------------------------------- | | Text-to-video / image-to-video | 2 – 15 seconds | | Reference-to-video (images only) | 2 – 15 seconds | | Reference-to-video (with videos) | 2 – 10 seconds | | Video editing | 0 (full source length) or 2 – 10 | *** ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "wan2.7-video", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.mp4"] }, "error": null } ``` | Field | Type | Notes | | ------------ | -------------- | ------------------------------------------------------- | | `id` | string | Task identifier — keep it for polling and audit | | `model` | string | Echo of the submitted `model` | | `status` | string | `processing` / `completed` / `failed` | | `created_at` | integer | Submission unix timestamp | | `output` | object \| null | `null` until completion. `output.video_urls` holds MP4s | | `error` | object \| null | Populated on `failed` — `{ code, message }` | *** ## Pricing Per-second × `resolution`. The mode does **not** change the rate — only the resolution does. `1080P` costs more per second than `720P`. For the input-billed modes (reference-to-video and video editing) reApi probes the uploaded clip **server-side** and folds input + output into the billable second count, rather than trusting a client value. Base text/image modes bill the requested output `duration`. **Bill formula** (1 credit = $0.001): ``` billable_seconds = ceil(server_probed_or_output_seconds) bill_usd = per_second_usd(resolution) × billable_seconds credits = ceil(per_second_usd × billable_seconds × 1000) ``` See current per-second rates for `720P` and `1080P` on the [model page](https://reapi.ai/models/wan-2-7-video). Failed jobs refund automatically. A probe failure on an input-billed mode returns `400 PRICING_UNAVAILABLE` (code `30002`) with no charge. The playground's draft estimate may show a default before an uploaded clip is probed — the authoritative number is computed at submit, after the server measures the file. *** ## Validation errors All cases below return HTTP 400. Pattern-match on `code`, not `message` — message strings carry request-specific context and are not a stable contract. | Trigger | Code | Message (illustrative) | | ------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------- | | `prompt` missing for text-to-video / reference-to-video | `20002` | `wan-2-7-video: prompt is required` | | Field invalid for the inferred mode | `20003` | `wan-2-7-video: video_urls is not valid in video editing` | | `duration` outside the mode's allowed range | `20003` | `wan-2-7-video: duration must be 2-15 seconds` | | `reference_voice_urls` count != `reference_image_urls` | `20003` | `wan-2-7-video: reference_voice_urls length must equal reference_image_urls length` | | A media field carrying a `data:` URI | `20003` | `wan-2-7-video: must be a public http(s) URL` | | Source clip probe fails (network / format) | `30002` | `Could not determine source video duration for billing: …` | | Provider rejected the request as invalid | `80007` | Provider rejected the request as invalid | The full envelope is `{ "error": { "code", "message", "request_id" } }` — see [Errors catalog](/docs/api/errors) for the wire format and request\_id correlation tips. *** ## Recipes ### Text-to-video ```json { "model": "wan2.7-video", "prompt": "a paper boat drifting down a rain-soaked street at dusk", "resolution": "1080P", "duration": 5 } ``` ### Image-to-video (animate a still) ```json { "model": "wan2.7-video", "prompt": "the subject turns to camera and smiles softly", "image_urls": ["https://your-cdn.com/portrait.png"], "resolution": "1080P", "duration": 5 } ``` ### Reference-to-video ```json { "model": "wan2.7-video", "prompt": "apply the reference choreography to the new character", "reference_image_urls": ["https://your-cdn.com/subject.png"], "reference_video_urls": ["https://your-cdn.com/dance-6s.mp4"], "resolution": "1080P", "duration": 6 } ``` ### Video editing ```json { "model": "wan2.7-video", "prompt": "restyle the clip with warm cinematic color grading", "video_url": "https://your-cdn.com/source-8s.mp4", "audio_setting": "origin", "duration": 0 } ``` *** ## Tips * **Let the inputs pick the mode.** There is no `mode` flag — send a prompt for text-to-video, add `image_urls` for image-to-video, `reference_*` for reference-to-video, or `video_url` to edit. Don't mix fields across modes. * **Match `duration` to the mode.** Base modes allow 2–15s; reference-with-video and editing cap at 10s, and editing accepts `0` for the full source length. * **Resolution drives cost.** `720P` is the cheaper run; switch to `1080P` for the final take. The mode does not change the per-second rate. * **Keep `reference_voice_urls` aligned.** Their count must equal the number of `reference_image_urls`, one voice per subject. * **Prompt the motion, not just the scene.** Describing the action ("turns and waves, smooth and continuous") sharpens text-to-video and image-to-video results. *** ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) --- # Wan 3.0 (https://reapi.ai/docs/wan-3-0) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; **Coming soon.** The Wan 3.0 API is not available yet. Wan 3.0 opened public beta on Alibaba's own surfaces on August 6, 2026, and the vendor API is announced to open fully soon. The endpoint, parameters, and pricing below are a **preview** seeded from the current Wan generation and may change when the model ships. Watch the [model page](https://reapi.ai/models/wan-3-0) for launch. > Alibaba's next-generation video model, coming to reAPI. Wan 3.0 is announced > to generate up to 30 seconds of video in a single pass from text, images, > audio, video — and, new to the family, documents (doc, xls, ppt, pdf, md). > Reference generation extends to fine-grained control over characters, props, > voices, spatial relations, and style, and editing reaches visuals, plot, and > dialogue. See pricing on the [model page](https://reapi.ai/models/wan-3-0). ## Status Wan 3.0 is **coming soon**. This documentation is a preview so you can plan an integration ahead of launch. When the model ships: * The `model` id, full parameter set, constraints, and per-second rates are finalized here. * The playground on the [model page](https://reapi.ai/models/wan-3-0) becomes live. * This banner is removed. The shape below mirrors the current Wan generation (`wan2.7-video`), adjusted to the announced Wan 3.0 facts (30-second single-pass maximum, three resolution tiers). Treat every field as provisional until launch. ## Quick example (preview) ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan3.0", "prompt": "A lighthouse keeper climbing a spiral staircase at dawn", "resolution": "1080P", "duration": 10 }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/videos/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "wan3.0", "prompt": "A lighthouse keeper climbing a spiral staircase at dawn", "resolution": "1080P", "duration": 10, }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/videos/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "wan3.0", prompt: "A lighthouse keeper climbing a spiral staircase at dawn", resolution: "1080P", duration: 10, }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "wan3.0", "prompt": "A lighthouse keeper climbing a spiral staircase at dawn", "resolution": "1080P", "duration": 10, }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` These calls will return `404 model not found` until Wan 3.0 launches. ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` ## Endpoint ```http POST /api/v1/videos/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. ## Modes (preview) Like the current Wan generation, mode is expected to be implicit — which media fields you set decides how the request routes: | Mode | Trigger | | ------------------ | ------------------------------------------------------------------------- | | Text-to-video | `prompt` alone | | Image-to-video | `image_urls` / `image_with_roles` / `video_urls` (+ optional `audio_url`) | | Reference-to-video | `reference_image_urls` / `reference_video_urls` / `reference_voice_urls` | | Video editing | `video_url` — announced to reach visuals, plot, and dialogue | **Document input** (doc, xls, ppt, pdf, md — single file ≤ 100 MB, ≤ 50 pages) is announced for Wan 3.0 but has no published API shape yet, so it has no field in this preview. It is added here the moment the vendor documents it. ## Request body (preview) Seeded from the current Wan generation, adjusted to announced Wan 3.0 facts. Every field is provisional until launch. | Field | Type | Default | Notes | | ---------------------- | --------- | ------- | -------------------------------------------------------------------------------------- | | `model` | string | — | `wan3.0` (provisional id, confirmed at launch). **Required.** | | `prompt` | string | — | Scene, motion, camera, story beats. Required for text- and reference-to-video. | | `negative_prompt` | string | — | What to avoid. | | `image_urls` | string\[] | — | Images to animate — one still, or two for first + last frame. Public HTTP(S) URLs. | | `image_with_roles` | object\[] | — | Explicit `first_frame` / `last_frame` roles. | | `video_urls` | string\[] | — | A source clip to continue from (max 1). | | `audio_url` | string | — | Driving audio for an animated image. | | `reference_image_urls` | string\[] | — | Subjects to keep consistent (max 5). | | `reference_video_urls` | string\[] | — | Reference performances (max 5). | | `reference_voice_urls` | string\[] | — | Per-subject voices (max 5). | | `video_url` | string | — | Editing source clip. | | `audio_setting` | string | — | `auto` / `origin` — soundtrack handling when editing. | | `size` | string | `16:9` | `16:9` / `9:16` / `1:1` / `4:3` / `3:4`. | | `resolution` | string | `1080P` | `480P` / `720P` / `1080P` — the three announced tiers. | | `duration` | integer | `5` | Output seconds, `2`–`30`. Wan 3.0 is announced to render up to 30 seconds in one pass. | | `prompt_extend` | boolean | `true` | Let the model expand short prompts. | | `watermark` | boolean | `false` | Watermark the output. | | `seed` | integer | — | Reproducibility hint, ≥ 0. | **No `data:` URIs.** reAPI rejects base64 inputs platform-wide — every URL field must be a public HTTP(S) URL. Upload to your own object storage (S3, R2, OSS, …) and pass the URL. ## Response envelope Submit and poll share the same shape — only `status` and `output` fill in over time. ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "wan3.0", "status": "completed", "created_at": 1735000000, "output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/.../0.mp4"] }, "error": null } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. `output.video_urls` holds the generated MP4 URL. ## Pricing Wan 3.0 is expected to bill per second of output, scaled by resolution — the same dimensions as the current Wan generation, with a third (480P) tier: ``` credits = ceil(per_second_usd × duration × 1000) ``` where `1 credit = $0.001`. Final per-second rates are published on the [model page](https://reapi.ai/models/wan-3-0) at launch — that table is dynamic and always reflects the current rate. Failed jobs are refunded automatically. ## Related * [Errors catalog](/docs/api/errors) * [Authentication](/docs/api/authentication) * [Quickstart](/docs/api/quickstart) * [Wan 2.7 Video — available now](/docs/wan-2-7-video) * [Wan 2.7 Image](/docs/wan-2-7-image) --- # z-image (https://reapi.ai/docs/z-image) import { Callout } from 'fumadocs-ui/components/callout'; import { Tab, Tabs } from 'fumadocs-ui/components/tabs'; > Alibaba's Tongyi Z-Image-Turbo on reAPI — fast, low-cost **text-to-image** > with accurate **bilingual (English + Chinese) text rendering** and > photorealistic output. Submit returns a `task_id`; poll until ready. See > current pricing on the [model page](https://reapi.ai/models/z-image). ## Quick example ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "z-image", "prompt": "a poster that reads OPENING SOON in bold type, warm tones", "aspect_ratio": "3:4" }' ``` ```python import requests resp = requests.post( "https://reapi.ai/api/v1/images/generations", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "z-image", "prompt": "a poster that reads OPENING SOON in bold type, warm tones", "aspect_ratio": "3:4", }, timeout=30, ) print(resp.json()) ``` ```js const r = await fetch("https://reapi.ai/api/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "z-image", prompt: "a poster that reads OPENING SOON in bold type, warm tones", aspect_ratio: "3:4", }), }); console.log(await r.json()); ``` ```go package main import ( "bytes" "encoding/json" "fmt" "io" "net/http" ) func main() { body, _ := json.Marshal(map[string]any{ "model": "z-image", "prompt": "a poster that reads OPENING SOON in bold type, warm tones", "aspect_ratio": "3:4", }) req, _ := http.NewRequest("POST", "https://reapi.ai/api/v1/images/generations", bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(string(out)) } ``` ### Submit response ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "z-image", "status": "processing", "created_at": 1735000000 } ``` Poll `GET /api/v1/tasks/{id}` (see the [Tasks](/docs/api/tasks) reference) until `status === "completed"`. The completed payload's `output.image_urls` holds the generated image URL. *** ## Authentication Every call needs a Bearer token. Generate keys at [reapi.ai/settings/apikeys](https://reapi.ai/settings/apikeys). ```http Authorization: Bearer YOUR_API_KEY ``` *** ## Endpoint ```http POST /api/v1/images/generations GET /api/v1/tasks/{id} ``` Submission is async. The POST returns immediately with a `task_id`; the task endpoint returns the same envelope until completion. Polling does not consume credits. Z-Image is **text-to-image only** — there is no image input. Each request produces **exactly one image** (no `n` parameter). *** ## Request body ### `model` — string, required Must be `z-image`. ### `prompt` — string, required Up to **1,000 characters**. Put any text you want rendered in the image inside quotes for best results. ### `aspect_ratio` — string, default `1:1` One of `1:1`, `4:3`, `3:4`, `16:9`, `9:16`. There is no width/height or resolution control. ### `nsfw_checker` — boolean, optional, default `false` Enables upstream content moderation. Off by default. *** ## Pricing Z-Image bills a flat rate **per generated image**, independent of aspect ratio. Each request produces one image: ``` credits = ceil(per_image_usd × 1000) ``` where `1 credit = $0.001 USD`. It is one of the lowest per-image rates on the platform. Failed and rejected requests are not charged. The exact per-image credit cost surfaces on the [model page](https://reapi.ai/models/z-image) and through the playground estimator before submit. *** ## Response The poll envelope returns the image URL in `output.image_urls`: ```json { "id": "task_019dfd44b7fd74168541552a3260a623", "model": "z-image", "status": "completed", "output": { "image_urls": [ "https://cdn.reapi.ai/...jpg" ] } } ``` Generated URLs expire — mirror them to your own storage if you need long-term retention. *** ## Errors Failures return the standard reAPI envelope `{ error: { code, message, request_id } }`. Common cases: * Invalid input (prompt over 1000 characters, an unsupported `aspect_ratio`) → `400`. * Insufficient credits → `402`. * Rate limited → `429`. See the full catalog at [/docs/api/errors](/docs/api/errors). *** ## Tips * Put the literal text you want rendered **in the prompt, in quotes** — Z-Image is tuned for legible English and Chinese typography. * It is text-to-image only — to edit an existing image, use a model that accepts an `image_url`. * For volume work (social graphics, e-commerce), Z-Image's flat low price makes it well-suited to batching many single-image requests. *** ## Related * [Image generation models](/docs/gpt-image-2) * [Qwen Image 2](/docs/qwen-image-2) * [Tasks API](/docs/api/tasks) * [Error codes](/docs/api/errors) --- # Authentication (https://reapi.ai/docs/api/authentication) ## Bearer token Send your API key as a Bearer token on every request: ```http Authorization: Bearer rk_live_xxxxxxxxxxxxxxxx ``` This matches the OpenAI scheme — most OpenAI clients work by changing `base_url` and `api_key`. ## Create a key 1. Sign in at [reapi.ai](https://reapi.ai). 2. Go to **Dashboard → API Keys**. 3. Click **Create new key**, give it a name (e.g. `production-server`). 4. Copy the key. **It is shown only once** — store it in a secret manager. You can create as many keys as you like (e.g. one per environment, one per service). ## Revoke a key Revoke compromised keys immediately on the dashboard. Pending tasks created with the key continue to completion (and bill credits), but no new requests can be made. ## Key prefixes | Prefix | Environment | | ------------- | -------------------------------------------------------- | | `rk_live_...` | Production | | `rk_test_...` | Test (no credit deduction, mock responses) — coming soon | ## Storing keys **Don't** commit keys to git or paste them in chat. Use a secret manager: * **Local dev**: `.env.local` (in `.gitignore`) * **Vercel**: Environment Variables * **AWS / GCP**: Secrets Manager / Secret Manager * **Docker**: Docker secrets or `--env-file` ## Errors | HTTP | `code` | Cause | Fix | | ---- | ------- | ------------------------------------------- | ---------------------------------------------------------------------------------------- | | 401 | `10001` | No `Authorization` header | Add the header | | 401 | `10002` | Header isn't `Bearer ` | Use `Bearer ` | | 401 | `10003` | Key invalid / typo | Check the dashboard | | 401 | `10004` | Key has been revoked | Mint a new key | | 401 | `10005` | Sign-in required (session-cookie path only) | Use API-key auth, or sign in | | 403 | `10006` | Origin not in allow-list (browser-only) | Only relevant for session-cookie auth from the browser; API-key requests aren't affected | | 402 | `30001` | Balance below request cost | Buy credits or wait for monthly refresh | Full list: [Errors](/docs/api/errors). --- # Balance (https://reapi.ai/docs/api/balance) `GET /api/v1/balance` returns the current credit balance for the credentials making the request. Use it to show remaining credits in your own dashboard, or to check a key has funds before submitting work. Reading this endpoint **does not consume credits**. ## GET /api/v1/balance ### Request ```http GET /api/v1/balance Authorization: Bearer rk_live_xxx ``` No body and no query parameters. ### Response `200 OK`: ```json { "balance": 12500 } ``` ### Response fields | Field | Type | Description | | --------- | ------- | ------------------------------------------------------------- | | `balance` | integer | Current credit balance. Integer credits, `1 credit = $0.001`. | ### Errors | HTTP | `code` | When | | ---- | ----------------- | ---------------------------------------------------------------- | | 401 | `10001` – `10005` | Auth missing / malformed / invalid / revoked | | 429 | `50001` | Per-user rate limit exceeded — retry after `Retry-After` seconds | | 500 | `60099` | Unexpected server error | Full list: [Errors](/docs/api/errors). --- # Errors (https://reapi.ai/docs/api/errors) ## Error format Every error response carries a JSON body in this shape: ```json { "error": { "code": 20002, "message": "Missing required parameter", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` | Field | Description | | ------------ | ------------------------------------------------------------------------------------------------------------- | | `code` | 5-digit numeric code. The leading digit is the category (1xxxx auth, 2xxxx validation, …). | | `message` | Human-readable explanation. May embed request-specific context (parameter names, balance, etc.). | | `request_id` | Unique per request. **Optional** — present whenever the gateway has assigned one; include in support tickets. | The HTTP status code reflects the *category* (401 / 400 / 402 / 429 / 500 / 502 / 503 / 504); the `code` field gives you the precise reason. For `failed` tasks, the same envelope is returned inside the polling response under `error` — see the model docs' Response section. ## Code catalog ### 1xxxx — Authentication (HTTP 401 / 403) | `code` | HTTP | Cause | | ------- | ---- | -------------------------------------------- | | `10001` | 401 | Missing `Authorization` header | | `10002` | 401 | `Authorization` header is not `Bearer ` | | `10003` | 401 | API key invalid | | `10004` | 401 | API key has been revoked | | `10005` | 401 | Sign-in required (session-auth surfaces) | | `10006` | 403 | Request origin not allowed | ### 2xxxx — Validation (HTTP 400) | `code` | Cause | | ------- | ------------------------------------------------- | | `20001` | Request body is not a JSON object | | `20002` | Required parameter missing — `message` says which | | `20003` | Parameter value invalid (type / range / enum) | | `20004` | `model` not supported on this endpoint | | `20005` | `size` not supported by this model | | `20006` | `quality` not supported by this model | | `20007` | `prompt` exceeds maximum length | ### 3xxxx — Billing (HTTP 402 / 400) | `code` | HTTP | Cause | | ------- | ---- | --------------------------------------- | | `30001` | 402 | Insufficient credits | | `30002` | 400 | Cannot determine pricing for this model | ### 4xxxx — Resource (HTTP 404) | `code` | Cause | | ------- | ------------------------------------------ | | `40001` | Task not found, or belongs to another user | ### 5xxxx — Rate limit (HTTP 429) | `code` | Cause | | ------- | --------------------------------------- | | `50001` | Rate limit exceeded — see `Retry-After` | ### 6xxxx — Server internal (HTTP 500) | `code` | Cause | | ------- | ------------------------------------------- | | `60001` | Failed to persist task — credits refunded | | `60002` | Failed to start workflow — credits refunded | | `60099` | Generic internal error | ### 7xxxx — Capacity (HTTP 503) | `code` | Cause | | ------- | ------------------------------------ | | `70001` | Workflow service unavailable — retry | | `70002` | Database unavailable | ### 8xxxx — Workflow execution (returned inside the polling response body when `status="failed"`) > **HTTP status for `GET /api/v1/tasks/{id}` is always `200` when the task is > found.** The codes below appear only inside `error.code` of the response > body — they are *never* the HTTP response status. | `code` | Cause | | ------- | ---------------------------------------------------- | | `80001` | Upstream submission failed (5xx / network on submit) | | `80002` | Polling timeout (wall-clock cap reached) | | `80003` | Upstream returned a terminal failure | | `80004` | Upstream completed but returned no URLs | | `80005` | Failed to persist generated files | | `80006` | Content policy violation | | `80007` | Upstream rejected the input as invalid | | `80008` | Task canceled | The 8xxxx codes are written to the task by the worker; polling returns them under `error.code` once `status="failed"`. ## Recommended handling ```python import requests, time def safe_call(method, url, **kwargs): for attempt in range(3): r = requests.request(method, url, **kwargs) body = r.json() if r.status_code == 200: return body if r.status_code == 429: time.sleep(int(r.headers.get('Retry-After', '5'))) continue if r.status_code in (502, 503, 504): time.sleep(2 ** attempt) continue raise RuntimeError( f"{body['error']['code']}: {body['error']['message']}" ) raise RuntimeError("max retries exceeded") ``` ### What to retry vs not | HTTP | Retry? | | ----------------------- | ------------------------------ | | 200 | n/a | | 400 / 401 / 402 / 404 | ❌ Fix the request | | 429 | ✅ With `Retry-After` | | 500 — `60001` / `60002` | ⚠️ Credits refunded, re-submit | | 500 — `60099` | ✅ Idempotent retry safe | | 502 / 503 / 504 | ✅ Exponential backoff | ## Support When reporting an issue, include: * The `request_id` from the response * The full request URL + method * Approximate timestamp (UTC) Email: [support@reapi.ai](mailto:support@reapi.ai) --- # Overview (https://reapi.ai/docs/api) The reAPI HTTP API exposes image, video, audio, and text models through one set of endpoints at `https://reapi.ai/api/v1`, authenticated with `Authorization: Bearer rk_live_...`. Generation is asynchronous: a submit returns a task `id`, and you poll `GET /api/v1/tasks/{id}` until it reports `completed` or `failed`. Billing runs on credits, where 1 credit is $0.001. Credits are reserved when a request is accepted and settled when the task reaches a terminal state: a task that fails is refunded, and a task that costs less than the reserved amount gets the difference back. The one exception is documented per model — a model that runs a post-generation content check can charge for a generation the check blocks, because the generation itself already happened. ## Base URL ``` https://reapi.ai/api/v1 ``` All endpoints accept and return JSON. The API mirrors OpenAI's conventions where it makes sense — many existing OpenAI clients work by changing only `base_url`. ## Authentication Every request must carry an API key as a Bearer token: ```http Authorization: Bearer rk_live_xxxxxxxxxxxx ``` Create keys in your [dashboard](https://reapi.ai/dashboard/api-keys). See [Authentication](/docs/api/authentication) for full details. ## Asynchronous tasks (image, video) Generation calls are **asynchronous**. The pattern is: 1. **POST** the model endpoint (e.g. `/api/v1/images/generations`) → returns a `task_id` immediately. 2. **GET** `/api/v1/tasks/{task_id}` periodically until `status` is `completed` or `failed`. ``` ┌──────────┐ ┌──────────┐ ┌──────────┐ │ POST │ → │processing│ → │ completed│ │ /images/ │ └──────────┘ │ failed │ │generations│ └──────────┘ └──────────┘ │ ▼ output / error ``` Recommended polling cadence: **1 request every 1–2 seconds**. For details see [Tasks](/docs/api/tasks). Per-model request schemas are on each model's page in the **Models** sidebar. ## Credits Each call deducts credits from your balance. Failed tasks are **automatically refunded** by the worker the moment the workflow ends in failure — atomically, before any poll observes the `failed` status. The exception is a model that runs a post-generation content check: when that check blocks an output, the task ends `failed` and is still charged, because the generation itself completed. Those models say so on their own page. Refund is one-shot; re-polling never refunds twice. Pricing per model is configured in your account dashboard. ## Idempotency reAPI does **not** deduplicate by `Idempotency-Key`. Every successful HTTP POST to a generation endpoint creates a new task and charges credits — by design, so no upstream provider call is ever silently skipped. If you need retry safety, generate the same payload only once on your side or rely on the natural recovery path: when a task fails, credits are refunded automatically and you can resubmit. The `Idempotency-Key` header is currently accepted and recorded for telemetry but does **not** alter request behavior. Don't rely on it to prevent duplicate charges. ## Rate limits Requests are limited **per user**, in 1-second windows. The default is **10 requests / second / user**. When exceeded, you get HTTP `429` with code `50001` and a `Retry-After` header. Polling `GET /api/v1/tasks/{id}` shares the same limit, so don't poll faster than once every 1–2 seconds per task. ## Response format Successful responses are JSON of the resource type. Errors follow a standard shape: ```json { "error": { "code": 20002, "message": "Both `model` and `prompt` are required", "request_id": "req_8a4f0d2e-1c8b-4f1a-9e2d-3b7c5a6f0a1b" } } ``` `code` is a 5-digit numeric identifier (see [Errors](/docs/api/errors) for the full catalog). `request_id` is unique per call — include it in support requests. --- # Quickstart (https://reapi.ai/docs/api/quickstart) Every generation on reAPI takes the same three steps: POST a prompt to a generation endpoint, keep the `id` that comes back, then poll `GET /api/v1/tasks/{id}` every 1–2 seconds until `status` is `completed`. Requests authenticate with `Authorization: Bearer rk_live_...` against the base URL `https://reapi.ai/api/v1`. Billing is credit-based, where 1 credit is $0.001. Credits are reserved when the request is accepted and settled at the terminal state, so a task that ends in `failed` is refunded. See [Overview](/docs/api) for the one documented exception. ## 1. Get an API key Sign up at [reapi.ai](https://reapi.ai), then go to **Dashboard → API Keys → Create new key**. Copy it now — you won't see it again. ``` rk_live_xxxxxxxxxxxxxxxxxxxxxxx ``` ## 2. Submit a generation task ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "a cute red panda eating bamboo, photorealistic", "size": "1:1" }' ``` Response (immediately): ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2", "status": "processing", "created_at": 1735000000 } ``` ## 3. Poll until done ```bash curl https://reapi.ai/api/v1/tasks/task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e \ -H "Authorization: Bearer rk_live_xxx" ``` Repeat every 1–2 seconds until `status` is `completed`: ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2", "status": "completed", "created_at": 1735000000, "output": { "image_urls": [ "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png" ] }, "error": null } ``` That's it. Your image is at `output.image_urls[0]`. ## Full example (Node.js) ```js const KEY = process.env.REAPI_KEY; async function generate(prompt) { const submit = await fetch('https://reapi.ai/api/v1/images/generations', { method: 'POST', headers: { 'Authorization': `Bearer ${KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'gpt-image-2', prompt, }), }).then(r => r.json()); const taskId = submit.id; while (true) { await new Promise(r => setTimeout(r, 1500)); const task = await fetch(`https://reapi.ai/api/v1/tasks/${taskId}`, { headers: { 'Authorization': `Bearer ${KEY}` }, }).then(r => r.json()); if (task.status === 'completed') return task.output.image_urls; if (task.status === 'failed') throw new Error(task.error?.message ?? 'failed'); } } console.log(await generate('a cute red panda')); ``` ## Python ```python import os, time, requests KEY = os.environ['REAPI_KEY'] HEAD = {'Authorization': f'Bearer {KEY}'} submit = requests.post( 'https://reapi.ai/api/v1/images/generations', headers=HEAD, json={ 'model': 'gpt-image-2', 'prompt': 'a cute red panda', }, ).json() task_id = submit['id'] while True: time.sleep(1.5) task = requests.get(f'https://reapi.ai/api/v1/tasks/{task_id}', headers=HEAD).json() if task['status'] == 'completed': print(task['output']['image_urls']) break if task['status'] == 'failed': raise RuntimeError(task['error']) ``` ## Next steps * [API overview](/docs/api) — full conventions * [Tasks](/docs/api/tasks) — `GET /api/v1/tasks/{id}` polling reference * [gpt-image-2 model card](/docs/gpt-image-2) — capabilities + pricing * [Errors](/docs/api/errors) — error code reference --- # Tasks (https://reapi.ai/docs/api/tasks) Generation on reAPI is **asynchronous**. Every submission endpoint — `/api/v1/images/generations`, `/api/v1/videos/generations`, and any future `/api/v1/audio/generations` — returns a task id, and you poll `GET /api/v1/tasks/{id}` until the task reaches a terminal state. This page is the canonical reference for the polling endpoint. The request shape, status values, error codes, polling cadence, and refund semantics are the same regardless of which submission endpoint produced the task; only the contents of `output` differ by media kind. ## GET /api/v1/tasks/\{id} Retrieve the current state of a task. ### Request ```http GET /api/v1/tasks/{id} Authorization: Bearer rk_live_xxx ``` `{id}` is the `id` returned by the submitting POST. Polling **does not consume credits**. ### Response `200 OK` — image task example: ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "model": "gpt-image-2", "status": "completed", "created_at": 1735000000, "output": { "image_urls": [ "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/0.png", "https://cdn.reapi.ai/media/tasks/018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e/1.png" ] }, "error": null } ``` `200 OK` — video task example: ```json { "id": "task_01k9s419324drezfbwnsvxyr6h", "model": "doubao-seedance-2.0", "status": "completed", "created_at": 1762853430, "output": { "video_urls": [ "https://cdn.reapi.ai/media/tasks/01k9s419324drezfbwnsvxyr6h/0.mp4" ] }, "error": null } ``` ### Status values | Status | Meaning | | ------------ | ---------------------------------------------------------------- | | `processing` | Submitted, provider is generating | | `completed` | Done — `output` populated | | `failed` | Provider returned an error — `error` populated, credits refunded | ### Output shape The shape of `output` depends on the media kind of the task: | Media kind | Field | Type | | ---------- | ------------ | --------- | | Image | `image_urls` | string\[] | | Video | `video_urls` | string\[] | | Audio | `audio_urls` | string\[] | Some video models add an extra `last_frame_url` (string) when the request opted into a return-last-frame capability. URLs returned in `output` are rehosted to reAPI's CDN. If you need long-term archival, copy them to your own storage as soon as the task completes — bucket lifecycle policies are configured per-deployment and not guaranteed by this contract. ### Errors | HTTP | `code` | When | | ---- | ----------------- | ------------------------------------------------------------------------ | | 401 | `10001` – `10005` | Auth missing / invalid / revoked | | 404 | `40001` | Task doesn't exist or belongs to another user | | 429 | `50001` | Per-user request rate limit exceeded — retry after `Retry-After` seconds | ## Polling pattern Recommended: ``` attempt 1: wait 2s attempt 2: wait 2s ... the worker keeps a task alive up to a wall-clock cap before it self-reports an 80002 timeout: 1 hour for image and audio, 48 hours for video. Most tasks finish far sooner (image/audio usually under a minute, video in minutes), so size your client-side give-up to your own tolerance, not the cap. ``` The polling endpoint is cached for **5 seconds** while a task is in-flight, so polling faster than every 2–3 seconds returns the same state and just consumes rate-limit budget. Video tasks routinely take several minutes; pace your polling accordingly. ## Refund behavior Failed tasks are **automatically refunded** by the worker the moment the workflow ends in failure — the credit return happens atomically with the status flip, before any poll observes it. Refund is one-shot: re-polling a `failed` task never refunds twice. A failed task surfaces the failure code under `error`: ```json { "id": "task_018f5a3a1b6e7d9f8c2b4d6e8f0a2c4e", "status": "failed", "output": null, "error": { "code": 80006, "message": "Request violates content policy" } } ``` The `code` here is one of the 8xxxx workflow-execution codes — see [Errors → 8xxxx](/docs/api/errors#8xxxx--workflow-execution-returned-in-polling-response-when-statusfailed). --- # AI Image Generation Cost vs Video: 2-9x More Per Frame (https://reapi.ai/blog/ai-image-generation-cost-vs-video) A second of 720p video from Seedance 2.0 costs $0.154 and contains 24 frames, which puts each frame at $0.0064\[1]. The cheapest single image on the same platform, Nano Banana 2 Lite, costs $0.015\[2]. The AI image generation cost is 2.3 times the video frame, and the video frame arrives with 23 siblings that are temporally consistent with it. That inversion holds across every tier we sell and gets wider at the cheap end, where a Seedance 2.0 Mini frame runs $0.0015 against $0.015 for the least expensive standalone image. Ten to one. It is worth understanding why, because it changes which tool you reach for when you need a still. ## TL;DR * A 720p video frame costs **$0.0064**; the cheapest standalone image costs **$0.015**\[1]\[2]. * Normalized per megapixel, images run **2 to 9 times** the AI image generation cost of a video frame. * The AI image generation cost gap is widest at the low end (Mini 480p frame at $0.0015, roughly 10x cheaper than any image) and narrowest at 4K, where images are about 2x. * Video pricing meters on total pixels across the clip; image pricing meters per generation, so short clips subsidize their own frame count. * The catch is control. A video frame is not addressable, not re-rollable, and not prompt-steerable in isolation. * Extracting stills from generated video is cheap and legitimate; it is also the wrong tool when you need nine unrelated compositions. ## The per-frame numbers Video is quoted per second and renders at 24 frames per second, so per-frame cost is the per-second rate divided by 24. Across the Seedance 2.0 family\[1]\[3]: | Tier | Per second | Per frame | Per megapixel | | ------------------ | ---------- | --------- | ------------- | | Mini 480p | $0.036 | $0.00150 | $0.0037 | | Mini 720p | $0.077 | $0.00321 | $0.0035 | | Fast 480p | $0.059 | $0.00246 | $0.0060 | | Fast 720p | $0.124 | $0.00517 | $0.0056 | | Seedance 2.0 480p | $0.072 | $0.00300 | $0.0070 | | Seedance 2.0 720p | $0.154 | $0.00642 | $0.0070 | | Seedance 2.0 1080p | $0.383 | $0.01596 | $0.0077 | | Seedance 2.0 4K | $0.780 | $0.03250 | $0.0039 | Against the image catalog\[2]\[4]\[5]\[6]: | Model | Per image | Per megapixel | | --------------------- | --------- | ------------- | | Nano Banana 2 Lite 1K | $0.015 | $0.0143 | | Nano Banana 2 1K | $0.028 | $0.0267 | | Nano Banana 2 4K | $0.064 | $0.0077 | | Nano Banana Pro 1K | $0.033 | $0.0315 | | Seedream 5.0 Pro 1K | $0.032 | $0.0305 | | GPT Image 2 1K | $0.030 | $0.0286 | | GPT Image 2 4K | $0.080 | $0.0096 | The AI image generation cost per megapixel bottoms out at $0.0143 and the cheapest video tier costs $0.0035. Four times. Compare the flagship image models against mid-tier video and the multiple reaches nine. ## Why AI image generation cost diverges from video Video meters on total pixels shipped. The published formula for the Seedance family multiplies duration by frame area by frame rate, then divides into token buckets\[7]. Every frame is priced identically to every other frame, and there is no fixed per-request overhead worth speaking of. Image generation prices per invocation. Whatever the model spends on prompt interpretation, sampling schedule and safety passes gets amortized across exactly one output. A four-second clip amortizes the same class of overhead across 96. The second factor is what the model is being asked to do. An image model treats every generation as an independent problem: fresh composition, fresh subject, fresh everything. A video model solves one composition and then propagates it, which is a fundamentally cheaper operation per frame even though it is a harder problem overall. Neither of those is a pricing quirk anyone chose. It is what the workloads actually cost to run, surfaced in the rate card. ## When pulling a still from video is the right call The arithmetic suggests an obvious arbitrage, and for some jobs it genuinely works. If you need a hero shot of a specific subject in a specific pose, generating two seconds of 1080p video costs $0.766 and returns 48 candidate frames at $0.016 each. Pick the best. Against $0.033 for a single Nano Banana Pro image, you are paying 23 times the unit price for 48 times the options, with the subject held consistent across all of them. If you need a character to appear in several shots with the same face, video is the cheaper consistency mechanism by a wide margin. That is the whole premise of reference-driven generation, and it is why the reference tier exists at a lower per-second rate. If you need contact-sheet variety on one concept, the same logic applies. Twenty seconds of Mini 480p is $0.72 and yields 480 frames. ## When it is the wrong call, which is often A video frame is not addressable. You cannot prompt frame 37. You steer the clip and accept what lands, whereas an image model gives you a seed, a full prompt, and a re-roll on a single output. Compression is real. Video frames arrive from an encoded stream with motion-compensated artifacts that a still generator never introduces. At 480p, on a subject with fine texture, this is visible and not fixable in post. Text rendering falls apart. If the still needs legible words in it, GPT Image 2 exists precisely because video models do not hold typography stable frame to frame\[6]. Aspect ratios are constrained. Video tiers ship 16:9 and a handful of standard ratios. Image models on the same platform reach 1:4, 4:1 and 8:1\[4], which video cannot do at any price. And nine unrelated compositions means nine generations either way. The per-frame advantage evaporates the moment you need frames that are not related to each other, because relatedness is the entire thing you are buying. ## The number that actually matters for a product Neither per-frame nor per-image AI image generation cost is the figure to budget on. Budget on cost per accepted output. An image workflow accepting one in four generations at $0.030 costs $0.120 per keeper. A video workflow that generates two seconds at 720p for $0.308, then keeps one frame, costs $0.308 per keeper, and that is worse, right up until you need the second keeper from the same clip, at which point it halves. Run your own acceptance rate before deciding which AI image generation cost applies to you. The AI image generation cost advantage of video frames is real, but it only converts into money saved when your workflow consumes more than one frame per generation. ## Where the gap shows up on a real bill Take a storefront that needs 500 product stills a month. At Nano Banana Pro, the AI image generation cost is $16.50. Harvesting the same 500 frames from 1080p video means 21 seconds of generation at $8.04, roughly half, and every frame shares lighting and camera treatment. Now change the brief to 500 unrelated products. The video route collapses, because 500 different subjects means 500 separate clips, and the AI image generation cost is suddenly the cheaper option by a wide margin. Same monthly volume, opposite answer, and the deciding variable was never price. That is the useful way to read the tables above. The AI image generation cost premium is not a markup on equivalent output. It is what you pay for independence between generations, and independence is either the entire point of your workflow or it is dead weight. Work out which one you have before you optimize the wrong number. ## FAQ ### Does a video frame match the quality an AI image generation cost buys? No. It comes out of an encoded stream, so it carries compression artifacts, and it is generally softer on fine texture. At 1080p and above the difference narrows considerably. ### Can I extract frames from a generated video? Yes. The output is a standard video file, so any frame extraction tool handles it. Nothing on the platform restricts it. ### Why is 4K video cheaper per megapixel than 1080p? The token rate for the 4K tier is lower than the 1080p tier\[7]. The total cost is still far higher because the frame carries four times the pixels, but normalized per megapixel it comes out ahead. ### Which is cheaper for character consistency across shots? Video, decisively. Reference-driven generation keeps a subject stable across frames at the per-second rate, which is what image models charge per output to approximate. ### Does the reference video tier change this math? It lowers the per-second rate but adds your input clip to the billed duration\[7]. For frame-harvesting with no reference input, the plain rate is what applies. ### What resolution do the video tiers actually render? 480p renders around 864 x 496, 720p at 1280 x 720, 1080p at 1920 x 1080 and 4K at 3840 x 2160\[7]. Those are the dimensions the per-megapixel column uses. ### Do failed generations cost money? No. Failed jobs refund automatically on reAPI\[1]. ## Choosing between the two The rate cards say video frames are cheap and AI image generation cost is high, and taken literally that is correct by a factor of two to nine. Taken as advice it is misleading, because the two products are not substitutes. Video sells you a sequence in which every frame relates to its neighbours. Images sell you independent control over one output at a time. The workflows where the math genuinely pays are the ones that want relatedness: character sheets, shot variations on a fixed subject, contact sheets from a single concept. For anything requiring nine distinct compositions or legible text, the higher AI image generation cost buys control you cannot get from a video frame at any price, and that control is usually the cheaper purchase in the end. ## References 1. reAPI. *Seedance 2.0 — model page and live pricing.* Retrieved August 2026 from [reapi.ai/models/seedance-2-0](/models/seedance-2-0) 2. reAPI. *Nano Banana 2 Lite — model page and live pricing.* Retrieved August 2026 from [reapi.ai/models/nano-banana-2-lite](/models/nano-banana-2-lite) 3. reAPI. *Seedance 2.0 Mini — model page and live pricing.* Retrieved August 2026 from [reapi.ai/models/seedance-2-0-mini](/models/seedance-2-0-mini) 4. reAPI. *Nano Banana 2 — model page and live pricing.* Retrieved August 2026 from [reapi.ai/models/gemini-3-1-flash-image-preview](/models/gemini-3-1-flash-image-preview) 5. reAPI. *Nano Banana Pro — model page and live pricing.* Retrieved August 2026 from [reapi.ai/models/gemini-3-pro-image-preview](/models/gemini-3-pro-image-preview) 6. reAPI. *GPT Image 2 — model page and live pricing.* Retrieved August 2026 from [reapi.ai/models/gpt-image-2](/models/gpt-image-2) 7. BytePlus. *ModelArk — model pricing, token calculation formula and per-video examples.* Retrieved August 2026 from [docs.byteplus.com/en/docs/ModelArk/1544106](https://docs.byteplus.com/en/docs/ModelArk/1544106) --- # AI Video Generation API: Why the Prices Don't Compare (https://reapi.ai/blog/ai-video-generation-api-pricing) Comparing any AI video generation API by its headline rate breaks almost immediately, because the models in this category do not bill in the same unit. Some charge per second of output. Others charge a flat rate per generation regardless of how long the clip runs. A number like `$0.126` and a number like `$0.189` are not comparable quantities, and treating them as though they were is how video budgets get written wrong by an order of magnitude. The fix when evaluating an AI video generation API is not a bigger comparison table. It is knowing which billing unit a model uses, and where the crossover between the two sits for the clip length you actually ship. ## TL;DR * **Two billing units coexist across the AI video generation API category**: per second of output, and flat per generation. * **Per-second examples**: Kling 3.0 Turbo at $0.126/s (720p), Vidu Q3 Turbo at $0.037/s (540p), Seedance 2.0 at $0.095/s (480P). * **Per-generation example**: Veo 3.1 fast at $0.189 per generation at 720p and 1080p. * **The crossover is short.** Against Kling 3.0 Turbo at 1080p, a flat $0.189 generation breaks even at about **1.2 seconds**. Past that, flat pricing wins. * **Resolution slopes differ wildly.** Seedance 2.0 climbs from $0.095/s at 480P to $1.04/s at 4K, roughly 11x. Vidu Q3 Pro moves from $0.138/s at 720p to $0.148/s at 1080p, about 7%. * **Every AI video generation API here is async.** Submit returns a task id; you poll. Design for that before picking a model. ## The two billing units in AI video generation API pricing Every rate below is a live per-model figure on reAPI, priced in credits where 1 credit is $0.001. **Per second of output.** You pay for duration, so a 10-second clip costs roughly twice a 5-second clip at the same resolution. | Model | 540p / 480P | 720p | 1080p | | ----------------- | ----------- | -------- | -------- | | Vidu Q3 Turbo | $0.037/s | n/a | n/a | | Vidu Q3 Pro | $0.065/s | $0.138/s | $0.148/s | | Seedance 2.0 Mini | $0.046/s | $0.098/s | n/a | | Seedance 2.0 | $0.095/s | $0.205/s | $0.51/s | | Kling 3.0 Turbo | n/a | $0.126/s | $0.158/s | **Flat per generation.** You pay once per job, and duration does not move the bill within whatever limit the model allows. | Veo 3.1 tier | 720p / 1080p | 4K | | ------------ | ------------ | ------ | | fast | $0.189 | $0.66 | | quality | $1.1 | $2.208 | ![Two billing units in AI video generation API pricing: per-second models like Kling 3.0 Turbo at $0.126 and Vidu Q3 Turbo at $0.037 versus flat per-generation pricing like Veo 3.1 fast at $0.189, with the break-even point at roughly 1.2 seconds](https://cdn.reapi.ai/media/blog/ai-video-generation-api-pricing/billing-units.png) Read those two tables as different currencies rather than different prices. Until you fix a clip length, they cannot be ranked against each other. ## Where the crossover sits Pick a target resolution and length, then convert everything into cost-per-clip. At 1080p, Kling 3.0 Turbo bills $0.158 per second and Veo 3.1 fast bills $0.189 per generation. The break-even is `0.189 / 0.158`, about **1.2 seconds**. Almost every real clip runs longer than that, so for 1080p output at these two tiers, the flat rate is cheaper essentially always. Against Seedance 2.0 at 1080p, which is $0.51 per second, the same flat $0.189 breaks even at roughly **0.37 seconds** — meaning it is cheaper for any usable clip at that resolution. Run the same arithmetic at a resolution where per-second pricing is cheap and the answer flips. Vidu Q3 Turbo at 540p is $0.037 per second, so a 5-second clip is about $0.185, which lands right next to a flat $0.189 generation. Below five seconds, per-second wins; above it, flat wins. **The practical rule**: flat-rate pricing rewards long clips, per-second pricing rewards short ones and low resolutions. If your product generates 3-second loops, those are different economics than a product generating 15-second spots, and the right model is probably not the same one. One caveat worth stating rather than glossing: flat-per-generation models have their own duration ceilings. The flat rate applies within that limit, not to arbitrarily long output. Check the limit on the model page before assuming a long clip is free upside. ## Resolution is a pricing dimension, not a quality toggle The slope from low to high resolution differs enormously across this category, and that slope matters more than the entry price for anything shipping at scale. Seedance 2.0 runs $0.095/s at 480P and $1.04/s at 4K. That is roughly **11x** across the range on one model. Choosing 4K there is a budget decision, not a preference. Vidu Q3 Pro runs $0.138/s at 720p and $0.148/s at 1080p — about **7%** for a full step up in resolution. On that model, defaulting to 1080p costs almost nothing. Veo 3.1 fast goes from $0.189 to $0.66 stepping into 4K, roughly 3.5x. So "which AI video generation API is cheapest" has no answer independent of resolution. Any AI video generation API comparison that omits the target resolution is incomplete. A model that is cheap at 480P can be the most expensive option at 4K. ## Design for async before you pick An AI video generation API is long-running by nature, and this category is uniformly asynchronous. The shape is the same regardless of which model you land on: POST a job, get a task id back immediately, poll until the status is terminal, then read the output URL. ```bash # submit curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.0-face", "prompt": "slow dolly across a rain-streaked window at dusk", "resolution": "720p", "size": "16:9", "duration": 5 }' # poll curl https://reapi.ai/api/v1/tasks/{id} \ -H "Authorization: Bearer YOUR_API_KEY" ``` Two consequences people discover late. Your request path cannot block on generation, so a webhook or a job queue belongs in the design from the start rather than bolted on after the prototype. And because jobs fail for reasons outside your control, your cost model needs to account for retries — on reAPI failed generations are refunded automatically, so the meter only moves on output you receive, but that is a platform behavior worth confirming wherever you integrate. ## Media inputs: hosted URLs only Image-to-video and reference-driven generation need their source assets reachable. On this platform, media inputs are **public http(s) URLs only, with no base64 accepted on any model**, so hosting comes before the API call rather than after. That constraint is easy to miss in a prototype where everything is a local file, and it shapes your pipeline: you need somewhere to put frames and reference clips that the API can fetch. ## Choosing an AI video generation API without a spreadsheet A short sequence that reaches an AI video generation API decision faster than a feature matrix: 1. **Fix the output spec first.** Resolution and typical clip length. Without these, no price comparison is meaningful. 2. **Convert every AI video generation API candidate to cost-per-clip** at that spec. This is the only step that makes per-second and per-generation models comparable. 3. **Check the resolution slope**, not just the entry price, if you might move up later. 4. **Confirm the input mode** you need — text-only, image-to-video, or reference video — is supported at the tier you priced. 5. **Prototype on the cheap tier.** Draft at a low resolution, then re-run only what survives review at the tier you ship. That last one is where most of the savings actually live. Generation cost per attempt matters far less than how many attempts you throw away. ## FAQ ### What is an AI video generation API? An HTTP endpoint that takes a prompt, and optionally reference images or video, and returns a generated clip. In practice it is asynchronous: you submit a job, receive a task id, and poll for the result. ### Why can't I compare AI video generation API prices directly? Because the AI video generation API category uses two different billing units. Per-second models charge by output duration; per-generation models charge a flat rate per job. Convert both to cost-per-clip at a fixed resolution and length first. ### Which is cheaper, per-second or per-generation billing? It depends entirely on clip length. Against Kling 3.0 Turbo at 1080p ($0.158/s), a flat $0.189 generation breaks even at about 1.2 seconds, so flat pricing wins for nearly any real clip. At 540p against Vidu Q3 Turbo ($0.037/s), the break-even stretches to about five seconds. ### How much does resolution change the cost? More than most people expect, and by wildly different amounts per model. Seedance 2.0 spans roughly 11x from 480P to 4K. Vidu Q3 Pro moves about 7% from 720p to 1080p. ### Do I need a subscription to use an AI video generation API? Not on this platform. Billing is pay-as-you-go: $1 buys 1,000 credits, credits do not expire, and new accounts start with 100 credits ($0.10) to verify an integration end to end. ### Can I send a local video file to the API? No. Media inputs are public http(s) URLs only, with no base64 on any model, so assets need hosting before the call. ### What happens if a generation fails? Failed generations are refunded automatically, so you only pay for output you actually receive. Build retry handling anyway, since a failed job still costs you wall-clock time. ### Should I use one AI video generation API or several? Several, if your workloads differ in length or resolution. Because these models sit behind one endpoint and one key, switching is a model-id change rather than a new integration, which makes routing cheap work to a cheap tier practical. ## Pricing the clip, not the model The useful question about any AI video generation API is not what it charges per unit but what it charges for the clip you actually ship. Fix the resolution, fix the length, convert every candidate into cost-per-clip, and the category stops looking like a pile of incomparable numbers. Do that once for each AI video generation API on your shortlist and the second-order decisions get easier: draft at a cheap tier, escalate only what survives, and check the live rates rather than the ones in an article, because every number here is a value in a table that changes. The rate tables for each model referenced above are on [reapi.ai/models](/models), and those are canonical. ## References 1. reAPI. *Model catalog — live per-model rates for video generation.* Retrieved July 2026 from [reapi.ai/models](/models) ### Further reading * reAPI. *Seedance 2.0 cost per second.* [reapi.ai/blog/seedance-2-0-cost-per-second](/blog/seedance-2-0-cost-per-second) * reAPI. *Nano Banana API free tier.* [reapi.ai/blog/nano-banana-api-free-tier](/blog/nano-banana-api-free-tier) * reAPI. *What reAPI does.* [reapi.ai/blog/what-is-reapi](/blog/what-is-reapi) --- # AI Video Generator Long Videos: Chaining Past the Cap (https://reapi.ai/blog/ai-video-generator-long-videos) Every AI video model caps a single generation well under a minute. Seedance 2.5 stops at 30 seconds, Seedance 2.0 and MiniMax H3 at 15, and Veo 3.1 is fixed at 8.\[1]\[2]\[3]\[4] There is no setting that lifts those ceilings, and no AI video generator long videos feature hiding behind a paid tier. The limit is architectural. So every multi-minute AI video you have seen was assembled from segments. The question worth answering is not which model makes long videos, it is how to join segments without the join being visible, what that costs when you count the segments you throw away, and which parameter combinations quietly become illegal the moment you start chaining. This covers all three, using the API rather than a timeline editor. ## TL;DR * **30 seconds is the current single-call ceiling**, on Seedance 2.5.\[1] Every AI video generator long videos workflow past that point is chained segments. * **`return_last_frame` is the joint.** Ask for it, then feed `output.last_frame_url` into the next call as the first frame.\[1] * **Chaining forces `size: adaptive`.** A first-frame job rejects any other aspect ratio at submit, so pick your framing in segment one.\[1] * **A chained segment cannot also carry a reference video.** `image_with_roles` is mutually exclusive with `video_urls` and `audio_urls`.\[1] * **A three-minute 720p piece is about $48 of generation if nothing is rejected**, and closer to $144 at three attempts per segment.\[5] ## Why an AI video generator long videos mode does not exist Published limits, from each model's parameter reference: | Model | Single-call duration | | ---------------- | --------------------------------------------------------------------------- | | Seedance 2.5 | 4–30 s, or `-1` to let the model choose\[1] | | Seedance 2.0 | 4–15 s\[2] | | MiniMax H3 | 4–15 s, default 6\[3] | | Grok Imagine 1.5 | 1–15 s\[6] | | Veo 3.1 | fixed at 8 s upstream\[4] | Thirty seconds is the best available, and it is recent. Treat any AI video generator long videos claim as either chaining on your behalf or describing something other than one continuous generation. That distinction matters for cost. A tool that chains for you still pays for every segment, and so do you. ## The chain: last frame out, first frame in The mechanism is two fields. Set `return_last_frame: true` on a generation and the completed task carries `output.last_frame_url` alongside the video.\[1] Hand that URL to the next call as a first frame and the second clip starts on the exact pixel the first one ended on. Segment one, establishing the framing for the whole piece: ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.5-face", "prompt": "Wide shot, harbour at dawn, slow push in", "resolution": "720p", "size": "16:9", "duration": 30, "return_last_frame": true }' ``` Segment two onward, starting from the previous frame: ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.5-face", "prompt": "The camera continues past the moored boats toward the market", "resolution": "720p", "duration": 30, "return_last_frame": true, "image_with_roles": [ { "url": "https://cdn.reapi.ai/media/tasks/.../0.png", "role": "first_frame" } ] }' ``` Note what disappeared from the second request. There is no `size`. ## Three rules that only bite once you chain **Chained segments must run adaptive.** A request carrying `image_with_roles` accepts only `size: "adaptive"` or no `size` at all; anything else is rejected at submit rather than minutes later.\[1] This is not arbitrary, the output follows the first frame's geometry, which is exactly the behaviour continuity needs. The practical consequence is that segment one decides the aspect ratio for the entire piece, so get it right before you generate 6 more. **A chained segment cannot carry reference video or audio.** `image_with_roles` is mutually exclusive with both `video_urls` and `audio_urls`.\[1] If a mid-sequence shot needs a motion reference, that shot cannot also be frame-chained. Pick one per segment. **`image_urls` and `image_with_roles` cannot be combined.** Character reference images and frame chaining are separate modes.\[1] For a chained sequence with a recurring character, carry the character through the frame itself rather than through reference images. Those three constraints are enforced before submit, which is the good case. You get a 400 in a second rather than a failed task in four minutes. ## Where chains actually break Frame continuity is not scene continuity. The joint is pixel-perfect and the drift shows up somewhere else. **Colour and exposure walk.** Each segment re-derives its own grade from one frame. Over six segments the sequence can wander perceptibly even though every individual join is seamless. Grade the assembled cut, not the segments. **Motion discontinuity at the seam.** A still frame carries no velocity. If segment one ends mid-pan, segment two starts from a static frame and has to re-establish the movement, which reads as a stutter. Write segment endings that come to rest, or accept a cut on the joint and treat it as a shot change rather than a continuation. **Audio does not chain.** Each generation synthesises its own track. Six segments give you six independent audio beds, and the seams are more audible than the visual ones. For anything longer than about a minute, generate without audio and lay a single track over the assembled cut. **Identity drift on people.** A face reconstructed from one frame each time accumulates error. This is where a chained sequence usually gives itself away first. None of these are fixable by prompting harder. They are properties of restarting a generation from a still image, and the practical answer is to design the piece so its cuts land where the seams are. ## What three minutes actually costs 180 seconds at 720p on Seedance 2.5 is six 30-second segments. At the published rate of $0.266824 per second:\[5] | Attempts per segment | Total generated seconds | Cost | | -------------------- | ----------------------- | ------- | | 1 (nothing rejected) | 180 | $48.03 | | 2 | 360 | $96.06 | | 3 | 540 | $144.09 | At 480p the same three tiers are $21.35, $42.70 and $64.04.\[5] The realistic number is the second or third row. Chained work has a failure mode single clips do not: a segment can be individually good and still be wrong, because it drifted from the one before it, and you only find out after generating it. Budget the retries or you will be surprised twice. An obvious saving follows. Draft the whole sequence at 480p, confirm the chain holds and the cuts land, then regenerate only the segments that survive review at 720p. That is $21 of drafting instead of $48, and it is the single biggest lever on a long piece. ## When to let the model pick the length Seedance 2.5 accepts `duration: -1`, which hands the choice to the model, and it is required rather than optional for video-edit prompts.\[1] Billing reserves at the 30-second cap and settles to the length actually produced, refunding the difference.\[5] For chaining, explicit durations are usually better. A sequence built from known-length segments is one you can cut to music or to a script; a sequence of model-chosen lengths is one you have to conform afterwards. Use `-1` for edits, where the vendor requires it, and for single clips where the natural length is genuinely unknown. ## FAQ ### What is the longest single AI video generation available? 30 seconds, on Seedance 2.5.\[1] Most other models cap at 15 and Veo 3.1 is fixed at 8.\[2]\[3]\[4] ### How do I make an AI video generator produce long videos? Chain generations. Set `return_last_frame: true`, then pass the returned `last_frame_url` into the next call as a `first_frame` role.\[1] There is no single call that produces minutes of output. ### Why does my chained request get rejected for aspect ratio? Because a first-frame job only accepts `size: "adaptive"`, or no size field at all.\[1] Remove `size` from every segment after the first. ### Can I use reference images and frame chaining together? No. `image_urls` and `image_with_roles` are mutually exclusive, as are `image_with_roles` and `video_urls`.\[1] ### What does a three-minute AI video cost? About $48 at 720p if every segment lands on the first attempt, and roughly $144 at three attempts each.\[5] Drafting at 480p first cuts the exploration phase to about $21. ### Why does the audio jump between segments? Each generation makes its own audio. Turn `generate_audio` off for chained work and lay one track over the finished cut. ### Do the joins look seamless? The joins do. The drift between segments is what gives a chain away: colour walk, restarted motion, and identity error on faces. ## Building length out of segments There is no AI video generator long videos setting, and treating its absence as a limitation of the tool rather than of the technology leads people to buy plans looking for it. What exists is a 30-second ceiling, a frame-chaining mechanism, three parameter rules that are enforced at submit, and four kinds of drift that are not. Plan around them in that order. Set the aspect ratio in segment one because you cannot change it later. Write segment endings that come to rest. Generate silent and score the assembly. Draft at 480p and finish at 720p. Then price the whole thing at three attempts per segment, because that is what it will actually take. Do that and an AI video generator long videos workflow stops being a feature you are shopping for and becomes a build you can budget. Parameter reference and error codes are at [reapi.ai/docs/seedance-2-5](/docs/seedance-2-5), and current per-second rates are on the [Seedance 2.5 model page](/models/seedance-2-5). ## References 1. reAPI. *doubao-seedance-2.5-face — duration, `return_last_frame`, `image_with_roles` and cross-field constraints.* Retrieved August 2026 from [reapi.ai/docs/seedance-2-5](/docs/seedance-2-5) 2. reAPI. *Seedance 2.0 — parameter reference and duration limits.* Retrieved August 2026 from [reapi.ai/docs/seedance-2-0](/docs/seedance-2-0) 3. reAPI. *MiniMax H3 — parameter reference and duration limits.* Retrieved August 2026 from [reapi.ai/docs/minimax-h3](/docs/minimax-h3) 4. reAPI. *Veo 3.1 — parameter reference, fixed 8-second duration.* Retrieved August 2026 from [reapi.ai/docs/veo3-1](/docs/veo3-1) 5. reAPI. *Seedance 2.5 — published per-second rate band and auto-duration settlement.* Retrieved 9 August 2026 from [reapi.ai/models/seedance-2-5](/models/seedance-2-5) 6. reAPI. *Grok Imagine 1.5 — parameter reference and duration limits.* Retrieved August 2026 from [reapi.ai/docs/grok-imagine-video-1-5](/docs/grok-imagine-video-1-5) ### Further reading * reAPI. *Seedance 2.5 API Pricing: fal vs kie vs WaveSpeed vs reAPI.* [reapi.ai/blog/seedance-2-5-api-pricing-compared](/blog/seedance-2-5-api-pricing-compared) * reAPI. *Dreamina Seedance 2.5 Prompt Guide: References & Timing.* [reapi.ai/blog/dreamina-seedance-2-5-prompt-guide](/blog/dreamina-seedance-2-5-prompt-guide) --- # AI Video Generator With Real People: What Actually Works (https://reapi.ai/blog/ai-video-generator-with-real-people) Search for an AI video generator with real people and the autocomplete tells you what everyone is actually asking: with people talking, with famous people, real person, free. Those are four different requests with four different answers, and exactly one of them is refused everywhere no matter which platform you pay. The useful split is not by tool. It is by whose face it is. A photograph of a consenting subject, a synthetic character that happens to look photoreal, and a named celebrity are three legally and technically distinct things, and most of the frustration in this space comes from platforms treating all three as one blocked category. This walks through what each one actually does on a modern video API, what talking requires on top, and where the line genuinely does not move. ## TL;DR * **Reference photos and clips of real people are supported.** Seedance 2.5's parameter reference states plainly that "reference images / videos may contain real people."\[1] * **Rejected reference material refunds in full.** Material passes automated review before generation, and anything refused fails with an error and a full refund of the reserve.\[2] * **Talking is a separate capability.** Seedance 2.5 generates "synced speech, sound effects and background music" with `generate_audio`, on by default.\[1] Kling 3.0 documents lip sync explicitly.\[3] * **Named celebrities are refused on every route.** That is the model's own line, not a platform policy setting, and no parameter reaches it. * **Consent is still yours to obtain.** An API that accepts an upload has not acquired permission on your behalf. ## Four different asks wearing one search term **Your own footage, or a consenting subject.** This is the largest legitimate case: founders in their own product demos, UGC creators, actors who signed a release, a client whose brand video you are making. It is supported, and the rest of this article is mostly about it. **A synthetic person who looks photoreal.** Your character does not exist, but your image generator got good enough that face classifiers score it as a photograph. This is the case that generates the most complaints, because the rejection is a false positive rather than a policy. **A named public figure.** Refused. Not by reAPI as a matter of policy, but by the model, on every host that resells it. Any platform advertising otherwise is either wrong or selling you a likeness-rights problem. **People talking.** A capability question rather than a permission question, and it is answered by which model you pick rather than by which platform. Conflating these is why the advice you find online is contradictory. Someone whose consented-subject workflow runs fine and someone whose synthetic character keeps bouncing are both reporting accurately about different asks. ## Using a consented person as a reference The supported path is reference material, not prompting a description. Seedance 2.5 takes up to 30 reference images, 10 reference clips and 10 audio tracks in one generation.\[1] ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "doubao-seedance-2.5-face", "prompt": "@Image1 walks through a sunlit workshop, handheld follow", "resolution": "720p", "duration": 8, "image_urls": ["https://your-cdn.example.com/subject-01.jpg"] }' ``` The constraints worth knowing before you assemble a reference set:\[1] | Field | Limit | Formats | | ------------ | -------------------------------------------------- | ------------------------------------------- | | `image_urls` | up to 30, each under 30 MB | jpeg, png, webp, bmp, tiff, gif, heic, heif | | `video_urls` | up to 10, each 2–30 s, under 200 MB, combined 30 s | mp4, mov, 480p to 4K | | `audio_urls` | up to 10, each 2–30 s, under 15 MB | wav, mp3 | Two rules catch people out. Every reference must be a **public HTTP(S) URL**; base64 and `data:` payloads are rejected across the whole platform, not just this model.\[1] And `image_urls` cannot be combined with `image_with_roles`, so character references and first/last-frame chaining are separate modes.\[1] Reference material goes through automated review before generation runs. If it is refused, the task fails with an error and the reserve is refunded in full,\[2] which means a false positive costs you a retry rather than money. ## Making them talk This is where model choice matters more than platform choice, and the two documented options behave differently. **Seedance 2.5** generates audio natively. `generate_audio` defaults to `true` and produces "synced speech, sound effects and background music (mono)."\[1] The speech is generated with the video rather than dubbed onto it, so mouth movement and audio come from the same pass. You direct it through the prompt. **Kling 3.0** documents the capability more specifically, describing synchronized native audio as "dialogue, lip sync, ambient sound."\[3] If lip sync accuracy on dialogue is the thing you are being judged on, that is the explicit claim to test against. What neither offers is a dubbing mode where you supply a finished voice track and get precise mouth-shape matching to it. Seedance 2.5's `audio_urls` are documented as reference audio tracks,\[1] which is a different job from lip-sync driving. If your pipeline already has recorded VO, test that assumption on a short clip before you build around it. One practical note for talking-head work: audio does not survive segmentation. Each generation synthesises its own track, so a sequence assembled from several clips gives you several independent audio beds. For dialogue longer than one generation, record or synthesise the voice separately and treat the video as picture only. ## The line that does not move **Named living people are refused.** Every honest route enforces this, and it sits with the model rather than with any platform's settings. If a host claims otherwise, the correct response is suspicion, not a signup. **Third-party characters are refused too.** The same check catches recognisable copyrighted characters, which is a recurring frustration for anime and fan work and has no workaround worth publishing. **Consent is not transferred by an upload form.** The API accepting your reference photo is not permission from the person in it. Releases, likeness rights and, in several jurisdictions, biometric-data rules are your responsibility and do not become the platform's because a request returned 200. That last one is not legal boilerplate. It is the reason the supported path exists at all: the check is designed to stop the non-consensual case, and it works better when the legitimate case has somewhere to go. ## When a person who does not exist gets refused The most common failure in this space is a fully synthetic character being blocked as a real person, because the classifier scores photorealism rather than provenance. It has no way to know your character was generated. Users have reported the same class of rejection with errors like "Input image may contain real person" on other platforms.\[4] The mechanics, the exact error strings, and how to tell a platform-level face detector from a model-level check are covered in [reapi.ai/blog/seedance-face-detected-real-person-error](/blog/seedance-face-detected-real-person-error). The short version: time the rejection. A refusal that lands in under a second never reached a GPU. ## What it costs Reference-driven work is priced the same as any other generation on Seedance 2.5, with one wrinkle. Reference images and audio do not change the rate; a reference **video** moves you to a lower per-second rate that is billed over input plus output seconds.\[2] | Job, 720p | Cost | | --------------------------------- | ----- | | 8 s from reference images | $2.13 | | 30 s from reference images | $8.01 | | 10 s reference clip to 5 s output | $2.40 | Rates from the published per-second band.\[2] A failed moderation check refunds in full, so exploratory reference sets cost time rather than credits. ## FAQ ### Can I use an AI video generator with real people at all? Yes, with reference material of a consenting subject. Seedance 2.5's parameter reference states that reference images and videos may contain real people.\[1] ### Can I generate a famous person? No. Named public figures are refused at the model level on every route, and no parameter changes that. ### Which model handles people talking? Seedance 2.5 generates synced speech alongside the video with `generate_audio`.\[1] Kling 3.0 documents dialogue and lip sync explicitly.\[3] ### Can I supply my own voice recording and get lip sync to it? Not as a documented mode. Seedance 2.5's `audio_urls` are reference tracks rather than a lip-sync driver.\[1] Test it on one short clip before designing a pipeline around it. ### Why was my AI-generated character rejected as a real person? Because the check scores photorealism, not origin. See the [face-detected explainer](/blog/seedance-face-detected-real-person-error) for how to identify which layer refused you. ### Do I get charged when a reference is rejected? Not on reAPI. A task that fails review refunds the reserve in full.\[2] ### Can I upload the reference file directly? No. Every reference must be a public HTTP(S) URL. Base64 and `data:` payloads are rejected platform-wide.\[1] ### How many reference images can one generation take? Up to 30, plus 10 clips and 10 audio tracks.\[1] ## Working with faces instead of around them Decide which of the four asks you actually have before you pick a tool, because three of them are ordinary product decisions and one of them is not available anywhere. A consenting subject and a good reference set is a supported workflow with a published parameter surface and a refund when review says no. A photoreal synthetic character is the same workflow plus a false-positive problem you can diagnose in thirty seconds. Dialogue is a model-selection question with two documented answers. Only the fourth ask, a named person who did not agree, has no route, and that is worth defending rather than routing around. An AI video generator with real people is a normal tool when the people said yes, and the reason the supported path stays open is that the unsupported one stays closed. Full parameter reference at [reapi.ai/docs/seedance-2-5](/docs/seedance-2-5); current rates on the [Seedance 2.5 model page](/models/seedance-2-5). ## References 1. reAPI. *doubao-seedance-2.5-face — request body, reference limits, `generate_audio` and platform media rules.* Retrieved August 2026 from [reapi.ai/docs/seedance-2-5](/docs/seedance-2-5) 2. reAPI. *Seedance 2.5 — model page, real-person reference support, published rates and refund behaviour.* Retrieved 9 August 2026 from [reapi.ai/models/seedance-2-5](/models/seedance-2-5) 3. reAPI. *Kling 3.0 — native audio with dialogue and lip sync.* Retrieved August 2026 from [reapi.ai/docs/kling-3-0](/docs/kling-3-0) 4. r/generativeAI. *Seedance keeps rejecting my AI images as "real person"; any fix?* Posted 22 May 2026, retrieved August 2026 from [reddit.com/r/generativeAI/comments/1tkkxjq](https://www.reddit.com/r/generativeAI/comments/1tkkxjq) ### Further reading * reAPI. *Seedance Face Detected: Real Person Errors, Explained.* [reapi.ai/blog/seedance-face-detected-real-person-error](/blog/seedance-face-detected-real-person-error) * reAPI. *AI Video Generator Long Videos: Chaining Past the Cap.* [reapi.ai/blog/ai-video-generator-long-videos](/blog/ai-video-generator-long-videos) --- # What is the best API platform for building an AI design or marketing creative tool? (https://reapi.ai/blog/api-platform-for-ai-creative-tools) There is no single best API platform for building an AI design or marketing creative tool, and any article naming one without asking what you are shipping is selling something. What exists is four platforms with genuinely different shapes, and one comparison axis that decides more than catalog size does. That axis is the request contract. Text generation is synchronous and streams; image and video generation are long-running jobs that finish minutes later. A creative product needs both, and these platforms differ less in which models they carry than in how honestly they model that split. Below: the matrix, then one section per platform using its own published words, then what a complete workflow actually costs. ## TL;DR * **The modality gap most comparisons cite is out of date.** OpenRouter's own catalog lists 345 text models, 38 image, 17 video, 15 speech, 12 transcription, 4 audio, 27 embeddings and 4 rerank\[1]. * **fal.ai names its own scope precisely:** a generative media platform covering image, video and audio, with serverless GPUs and on-demand clusters for developing and fine-tuning models\[2]. Notice which modality is absent. * **Replicate's pitch is run, fine-tune, deploy**\[3]: infrastructure framing, and the right answer when your differentiator is a model you trained. * **reAPI carries 50 model pages**: 8 chat, 14 image, 18 video, 7 music and audio, 3 text-processing, one of which is a launch preview\[4]. * **A complete creative workflow prices out at about $1.32** per finished asset at current rates\[7]\[8], and the ratio inside it matters more than the total. * **Signup credits are 100, which is ten cents**\[5]. Budget a top-up as part of any evaluation. ## The comparison at a glance | Platform | How it describes itself | Where the depth is | Long-running jobs | Pick it when | | ---------- | ------------------------------------------------------------------------------ | ------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------- | | fal.ai | Generative media platform for developers\[2] | Image, video, audio; serverless GPUs; fine-tuning | Media-native | Media inference at scale, or serving your own weights | | Replicate | Run AI with an API; run, fine-tune, deploy\[3] | Model breadth, custom deployment | Media-native | You're still choosing a model, or the model is the product | | OpenRouter | Model comparison and routing\[1] | 345 text vs 38 image vs 17 video | Text-native | Language is the centre, visuals are a supporting feature | | reAPI | Curated multi-modal catalog\[4] | 50 documented models across five buckets | Async submit + free polling\[5] | A media pipeline with a text step, on one balance | Read that "long-running jobs" column before the model counts. It is the one that shows up in your incident log. ## Why the request contract decides more than the catalog Catalogs are the least durable thing in this category. Models churn quarterly, and everyone lists the same frontier releases within a week of each other; fal, Replicate and reAPI were all leading with HappyHorse 1.1 and the current Seedance generation on the day I checked\[2]\[3]\[4]. What does not churn is request shape, and creative products have two shapes that fight each other. Text generation is synchronous: connection open, tokens streaming, user watching words appear, done in seconds. Image and video generation is a job. A video render takes one to several minutes, far past any sensible HTTP timeout, so it must be submit-then-collect: get an identifier, poll or subscribe, retrieve the artifact. Billing differs too. Text bills per token afterward; media bills per image or per second of output, usually at submission, and the question that matters is what happens to that charge when the render fails. A platform can handle this three ways. Expose one endpoint shape and make the media case awkward, usually by holding a connection open or polling something built to stream. Expose two contracts and say why. Or paper over the difference in an SDK and let you discover during your first production incident which one you actually bought. So when the marketing says "one API for everything", the useful follow-up is: one API with how many contracts underneath? One key and one invoice are real conveniences worth paying for. One request shape across streaming text and a four-minute render is not a thing that exists. ## fal.ai: media infrastructure, in its own words **What it says it is.** A "generative media platform for developers", offering "the world's best generative image, video, and audio models, all in one place", with serverless GPUs and on-demand clusters for developing and fine-tuning models, trusted by over 1,500,000 developers\[2]. **What that is good for.** The deepest media-infrastructure story of the four. If the hard problem in your product is scaling diffusion workloads, or you are serving weights you fine-tuned, this is the shape that fits. **Where it stops.** Read the modality list again: image, video, audio. Text is not in it. If your creative tool needs a language model to read a brand brief and write campaign angles before it generates anything, that step lives on another platform, with another key and another invoice. ## Replicate: run, fine-tune, deploy **What it says it is.** "Run AI with an API. Run and fine-tune models. Deploy custom models. All with one line of code."\[3] **What that is good for.** Two real phases of real projects: the exploration phase where you compare a dozen open-weight variants before committing, and the production phase where your differentiator is a model you trained rather than a workflow you assembled. **Where it stops.** That is infrastructure framing, not creative-workflow framing. A marketing tool shipping campaign assets daily wants predictable parameter sets and stable model availability more than it wants deployment flexibility, and more of the orchestration layer stays your problem. ## OpenRouter: language depth, more visual than its reputation **What it says it is.** A model comparison and routing layer, presented around pricing, context and benchmarks\[1]. **What that is good for.** Text-heavy creative work: headline generation, prompt expansion, brand-voice rewriting, creative-brief analysis, agent workflows. Its catalog page carries a modality filter with counts printed next to each entry: Text 345, Image 38, Embeddings 27, Audio 4, Video 17, Rerank 4, Speech 15, Transcription 12\[1]. **Where it stops.** The centre of gravity is obviously language, and 345 against 38 tells you where the depth is. But comparisons written six months ago that call it text-only, or "limited" on visual, are describing a product that has changed: 17 video models is not zero. Whether it is enough is a question you answer by opening the filter, not by reading a listicle. ## reAPI: a curated catalog behind one async contract **What it says it is.** A curated multi-modal catalog with a deliberately narrow surface. Fifty model pages are live: 8 chat models, 14 image, 18 video, 7 music and audio, and 3 text-processing endpoints, with one video entry being a preview page for an unreleased model\[4]. **What that is good for.** Uniformity. Every image and video model sits behind the same asynchronous contract: submit, get a `task_id`, poll `GET /api/v1/tasks/{id}` for free until it settles. Mode is implicit rather than a dropdown, so one request body covers text-to-video, image-to-video, frame interpolation and reference-driven generation, with the fields you set deciding which runs\[5]. Adding a video model to your product is a model string and a parameter diff, not a new integration. Fifty is not a big number in this company, and it is a design position: each of those models has a hand-written documentation page with its exact parameter set, constraints and error catalog\[5]. ### Where I would send you elsewhere A comparison with no disqualifiers is a brochure, so here are reAPI's. * **No fine-tuning, no custom model deployment.** That is Replicate and fal territory, and pretending otherwise would waste your week. * **Two base URLs, not one.** Media runs on the async task contract; chat runs on a standard `/v1/chat/completions` endpoint on its own host\[6]. Two honest contracts instead of one dishonest one, but it is two things to configure. * **Media inputs must be public HTTP(S) URLs.** Base64 and `data:` URIs are rejected at the gateway, so object storage is part of your architecture from day one\[5]. * **The catalog is curated.** If the model you want is not on it, it is not on it. * **Signup credits are ten cents.** One hundred credits at a tenth of a cent each, which covers about three draft images\[5]. ## Pricing one whole workflow instead of one call Model counts are free to publish; prices are not, which makes them the more informative comparison. Here is a complete marketing pipeline at reAPI's current rates. | Step | What runs | Cost | | ----------------- | ---------------------------------------------------------- | -------------- | | Campaign angles | A chat model, a few hundred tokens | Rounds to zero | | Direction finding | 5 × 1K image at $0.032\[7] | $0.16 | | Finalists | 2 × 2K image at $0.063\[7] | $0.13 | | Motion | 5s × 720p at $0.205/s\[8] | $1.03 | | | **Per finished creative** | **$1.32** | One credit is a tenth of a cent, charges land on submit, and a task ending `failed` refunds automatically\[5]. The ratio inside that table is what I would actually optimize. A 720p clip costs roughly thirty times a 1K still, so any pipeline that discovers composition problems during a video render is paying about thirty times too much for the same information. No amount of catalog breadth fixes a pipeline with its stages in the wrong order. ## Five questions to ask before you integrate Platform-independent, and each has cost me time somewhere. 1. **How does a long-running job work?** Submit-and-poll, webhook, or held connection. If the answer for video is a held connection, you will be fighting timeouts in production. 2. **What happens to the charge when a render fails?** Automatic refund, manual credit, or nothing. Ask specifically about content-policy blocks, where the compute happened and no artifact arrived. That is where policies differ most and nobody volunteers the answer. 3. **Is the request shape uniform across models in one modality?** If every video model has its own parameter names, what you bought is a directory of integrations with one invoice attached. 4. **What input formats are accepted?** Public URL only, base64, or direct upload. This single answer decides whether you need object storage on day one. 5. **Where does the per-model documentation live, and who wrote it?** An auto-generated schema dump and a hand-written page with an error catalog are very different artifacts at 2am. ## FAQ ### What is the best API platform for AI design tools? It depends whether your differentiator is the workflow or the model. For a workflow product chaining text, image and video, a curated multi-modal catalog with one uniform media contract saves the most engineering time. For a product built on weights you trained, Replicate or fal's fine-tuning and deployment story matters more than catalog breadth\[2]\[3]. ### Is OpenRouter enough for a visual creative tool? More than older comparisons suggest: 38 image and 17 video models alongside 345 text models\[1]. Whether it is enough depends on whether the specific models you need are among them. ### Do I need separate APIs for text, image and video? Separate contracts, not necessarily separate vendors. Streaming text and multi-minute renders are different request shapes, and a platform hiding that has hidden it, not solved it. Authentication, billing and support are what genuinely consolidate. ### How is video generation billed? Per second of output on most platforms, banded by resolution. On reAPI the current Seedance rates run from $0.078 per second at 480p on the fast variant to $1.04 at 4K, charged on submit with automatic refunds on failure\[8]. ### Can I upload images directly, or do they need hosting? On reAPI, media inputs must be public HTTP(S) URLs across every model, and base64 is rejected at the gateway\[5]. Other platforms differ, so check before architecting around direct upload. ### How many models does a creative tool actually need? Fewer than the catalogs suggest. A production pipeline typically settles on one text model, one or two image models, one video model, and a fallback for each. What you want from the platform is that switching any one of those is a parameter change rather than a rewrite. ### Which platform has the most models? Not worth answering, and I could not retrieve a first-party total for fal or Replicate to answer it honestly. Catalog size predicts almost nothing about integration effort and correlates negatively with per-model documentation quality. ## Choosing without a beauty contest Match the platform to the hard part of your product. Media infrastructure at scale or your own weights, go to fal or Replicate. Language with visuals attached, OpenRouter's depth is on the side you need. A creative pipeline where text, image, video and audio each do a step and you want one balance behind one uniform async contract, that is the case reAPI is built for, and fifty documented models are the point rather than the limitation. What I would not do is pick a best API platform from a table of model counts. Ask the five questions above, price one complete workflow at real rates, and see which platform's shape matches the product you are actually building. ## References 1. OpenRouter. *Models catalog — modality filter counts.* Retrieved July 2026 from openrouter.ai/models 2. fal.ai. *Generative media platform for developers — homepage positioning and developer count.* Retrieved July 2026 from fal.ai 3. Replicate. *Run AI with an API — homepage positioning.* Retrieved July 2026 from replicate.com 4. reAPI. *Model catalog.* Retrieved July 2026 from [reapi.ai/models](/models) 5. reAPI. *API documentation — async task contract, mode routing, billing, media input rules, per-model references.* Retrieved July 2026 from [reapi.ai/docs](/docs) 6. reAPI. *Chat model documentation — standard chat-completions endpoint on api.reapi.ai.* Retrieved July 2026 from [reapi.ai/docs/claude-opus-4-8](/docs/claude-opus-4-8) 7. reAPI. *Seedream 5.0 Pro — live pricing table.* Retrieved July 2026 from [reapi.ai/models/seedream-5-0-pro](/models/seedream-5-0-pro) 8. reAPI. *Seedance 2.0 — live pricing table.* Retrieved July 2026 from [reapi.ai/models/seedance-2-0](/models/seedance-2-0) ### Further reading * reAPI. *fal.ai alternatives.* [reapi.ai/blog/best-fal-ai-alternatives](/blog/best-fal-ai-alternatives) * reAPI. *Replicate alternatives.* [reapi.ai/blog/best-replicate-alternatives](/blog/best-replicate-alternatives) * reAPI. *Seedream 5.0 Pro Seedance 2.5 Workflow: What Actually Ships.* [reapi.ai/blog/seedream-5-0-pro-seedance-2-5-workflow](/blog/seedream-5-0-pro-seedance-2-5-workflow) --- # Atlas Cloud vs Higgsfield: API Platform or Creator Studio? (https://reapi.ai/blog/atlas-cloud-vs-higgsfield) **Choose reAPI when you are building a SaaS product and want a focused multi-model API, one balance, and a documented asynchronous media workflow. Choose Higgsfield when a creator wants presets and a polished browser studio. Choose Atlas Cloud when maximum catalog breadth or raw GPU infrastructure is the deciding requirement.** That three-way distinction also explains the recent “Seedance 2.5 Higgsfield” and “Atlas Cloud Seedance 2.5” searches. A platform can publish a model page without proving that the model is callable. Atlas Cloud, Higgsfield, and reAPI all have a public Seedance 2.5 surface; none of those surfaces currently proves a generally callable production endpoint. ## TL;DR * **reAPI:** best fit for product teams that want a curated multi-model API, live model pages, pay-as-you-go credits, and the same submit-and-poll workflow across media. * **Atlas Cloud:** best fit when a very broad catalog, GPU services, or enterprise infrastructure matters more than a focused integration path.\[1] * **Higgsfield:** best fit for people producing clips in a browser with presets, identity tools, and a visual project workflow. * **Seedance 2.5:** Atlas Cloud advertises early access, while Higgsfield and reAPI label it coming soon. None currently exposes a verified public 2.5 model ID.\[2]\[3] * **What to ship today:** developers can run [Seedance 2.0](/models/seedance-2-0) or [MiniMax H3](/models/minimax-h3) through reAPI; creators can use Seedance 2.0 inside Higgsfield. ## Atlas Cloud vs Higgsfield at a glance ![Three AI video paths: Atlas Cloud for catalog breadth, reAPI for a unified SaaS API, and Higgsfield for browser-based creation](https://cdn.reapi.ai/media/blog/atlas-cloud-vs-higgsfield/atlas-cloud-higgsfield-reapi-decision-map.png) | Area | Atlas Cloud | Higgsfield | reAPI | | -------------- | -------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------------- | | Core product | Broad multi-model API and GPU cloud | AI video creator studio | Curated multi-model API gateway | | Primary user | Infrastructure and enterprise teams | Creators, marketers, and agencies | SaaS and application developers | | Main interface | Model pages, APIs, and GPU services | Browser generator, presets, and projects | Model playground, REST API, and task status | | Model breadth | 400+ models advertised | Curated studio catalog | Curated catalog with live availability on [model pages](/models) | | Billing | Usage based; varies by model | Subscription tiers and credits | Pay-as-you-go credits; no monthly plan required | | Seedance now | Seedance 2.0 API | Seedance 2.0 creator workflow | [Seedance 2.0 API](/models/seedance-2-0) | | Seedance 2.5 | Early-access cohort; not a verified endpoint | Coming-soon notification page | [Coming-soon model page](/models/seedance-2-5) | | Product work | You build UI, review, storage, and delivery | Studio supplies most creator workflow | You build the UI; reAPI supplies the model and task layer | | Best outcome | Broad infrastructure platform | A finished clip made interactively | A programmable product pipeline | This comparison is published by reAPI. reAPI competes with Atlas Cloud at the API layer, so its product claims point to live reAPI pages and the recommendations state where Atlas Cloud or Higgsfield is genuinely the better fit. ## Atlas Cloud is an API platform Atlas Cloud gives developers one account for a large model catalog spanning video, image, audio, and language generation. Its Seedance 2.0 endpoint follows a familiar asynchronous pattern: submit a job, retain the task identifier, then poll or otherwise retrieve the result when generation finishes.\[1] This is useful when your product already has its own user interface. A team can place model selection behind configuration, route workload by price or capability, and store outputs in its own system. The trade-off is ownership: Atlas Cloud does not become your review queue, brand workflow, customer permissions, or final delivery experience. The breadth is useful when one account must cover an unusually wide set of models or when the same vendor also needs to supply GPU infrastructure. The trade-off is focus: every production decision should use the live model page and price table, not the size of the overall catalog. ## Higgsfield is a creator studio Higgsfield starts from the opposite end. A creator chooses a model within a web product, then combines it with platform-level tools such as camera presets, character or identity workflows, advertising formats, and project organization. Higgsfield uses subscription tiers and credits, with exact offers varying by plan, promotion, and region.\[4] It also documents a 30-day Seedance Unlimited promotion built on Enhanced Seedance 2.0 Fast. That promotion uses standard queues and 480p or 720p output; it is not unlimited Seedance 2.5 or unlimited 4K.\[5] The studio saves setup work for a human operator. It is less suitable as the invisible engine behind your own SaaS unless a specific API program covers the required workflow. ## reAPI is the focused API alternative reAPI sits between Atlas Cloud's broad infrastructure catalog and Higgsfield's finished creator studio. It exposes selected image, video, audio, and language models through one account and credit balance. Media jobs use a consistent asynchronous flow: submit a request, receive a task ID, then poll the task until it completes or fails. The practical difference is what can be used now. [Seedance 2.0 on reAPI](/models/seedance-2-0) supports text, image, first/last-frame, video, and audio-reference workflows with documented duration and resolution rules. [MiniMax H3](/models/minimax-h3) is also callable for teams that want mixed references, native audio, and up to 2K output. The Seedance 2.5 page remains explicitly coming soon. reAPI does not replace Higgsfield's full editing workspace, reusable-identity tools, or campaign presets. It also does not sell the raw GPU infrastructure that can make Atlas Cloud attractive. It is the narrower choice for teams that want to put generation inside their own product without maintaining a separate provider integration and billing relationship for every selected model. **Building a product? [Try Seedance 2.0 on reAPI](/models/seedance-2-0), review the [API quickstart](/docs/api/quickstart), or [track Seedance 2.5 availability](/models/seedance-2-5).** ## Seedance 2.5 availability: early access is not an endpoint ByteDance has demonstrated Seedance 2.5 with 30-second continuous output, expanded multimodal references, second-level control, and video editing.\[6] The missing pieces are a final public model identifier, API schema, resolution specification, and price. Atlas Cloud has a Seedance 2.5 early-access page that describes preparation for day-one access, while its callable Seedance documentation remains on 2.0.\[2] Higgsfield now has a Seedance 2.5 notification page, but that page says access is still coming.\[3] reAPI likewise labels [Seedance 2.5](/models/seedance-2-5) coming soon rather than presenting its 2.0 schema as a live 2.5 contract. Use the same test on any platform: 1. Is `Seedance 2.5` present in the signed-in live catalog? 2. Is there a real model ID or selectable generator option? 3. Are duration, resolution, reference limits, and audio behavior stated? 4. Is the actual charge visible before generation? If any answer is missing, you have an announcement or waitlist—not a production dependency. The [Seedance 2.5 on Higgsfield guide](/blog/seedance-2-5-on-higgsfield) tracks that distinction in more detail. ## Pricing: three different bills Atlas Cloud meters model calls. Higgsfield sells plan access and credits. reAPI meters completed API work against a pay-as-you-go credit balance and automatically refunds a media job that finishes in failure. Comparing the cheapest visible number produces a misleading winner because the three products include different work. For Atlas Cloud, estimate: * generated seconds by model and resolution; * average failed or rejected generations; * storage, delivery, moderation, and application hosting; * engineering time for queue and error handling. For Higgsfield, estimate: * monthly plan and any add-ons; * credits consumed per accepted clip; * unused credits; * creator time saved by presets, identity, and in-app workflows. For reAPI, estimate: * the live per-model rate for the chosen resolution and duration; * any billable reference-video time documented by that model; * accepted outputs after automatic failed-job refunds; * the product work your team still owns: UI, review, storage, and delivery. Then divide the total by accepted deliverables. Pay as you go usually fits variable API traffic. A subscription studio can be cheaper for a creator who uses its workflow every day. For reAPI, use the [live Seedance 2.0 model page](/models/seedance-2-0) rather than copying a price from an article that may age. ## Model choice and switching Atlas Cloud's wider catalog makes switching easier at the account level, but models still have different request schemas and behaviors. Normalizing `prompt`, `duration`, and `aspect_ratio` does not make reference video, native audio, and safety errors identical. Higgsfield deliberately narrows those differences behind a visual interface. That makes testing easier for a creator but automation harder for a product team. Its value is curation and workflow, not maximum backend portability. reAPI narrows the operational differences at the job layer: one credential, task status pattern, balance, and model directory. Model-specific fields still matter, so switching from Seedance to H3 is a controlled adapter change rather than a promise that every request body is identical. If portability is the goal, define an internal job object and provider adapter. Store the upstream model ID with every result, maintain a fixed evaluation set, and never silently change the model behind an existing product label. ## Which should you choose? ### Choose Atlas Cloud when * you are building a SaaS product or internal application; * API calls, metered billing, and model breadth matter; * your team can own job queues, storage, review, and delivery; * you want current Seedance 2.0 plus access to other model families; * you can treat Seedance 2.5 as early access until a live endpoint appears. ### Choose Higgsfield when * creators need to work in a browser with minimal setup; * reusable identity, camera presets, and marketing tools save time; * subscription credits match predictable monthly use; * the final deliverable is a clip, not an API response; * Seedance 2.0 is sufficient while 2.5 remains unavailable. ### Choose reAPI when * you are adding AI video to your own SaaS or application; * Seedance 2.0 or MiniMax H3 needs to be callable now; * one task workflow and credit balance are more useful than the widest possible catalog; * live model pages and automatic failed-job refunds matter; * you do not need a full browser editing studio or raw GPU rental. ### Use Higgsfield with reAPI when * a creative team explores and approves a visual language in Higgsfield; * developers then automate approved, structured variants through reAPI; * the cost of two tools is lower than forcing either platform to do the other's job. ## Atlas Cloud and Higgsfield alternatives None of the three will fit every team. fal and Replicate offer model-level developer access, Krea provides another creator workspace, and Dreamina is the official ByteDance consumer route. The [best Higgsfield alternatives guide](/blog/best-higgsfield-alternatives-ai-video) compares those platform categories directly. ## FAQ ### Is Atlas Cloud cheaper than Higgsfield? Not universally. Atlas Cloud meters API usage, while Higgsfield sells subscriptions and credits that include creator tools. Compare cost per accepted deliverable for your workload. ### Does Atlas Cloud have a Seedance API? Yes, Atlas Cloud publicly documents Seedance 2.0 endpoints. Its Seedance 2.5 page describes early access; verify a live model ID before planning production. ### Does Higgsfield offer an API? Higgsfield's public product is primarily a creator studio. If an API is essential, confirm current developer access, supported models, and commercial terms directly rather than assuming the web model picker is programmable. ### Which platform is better for MiniMax H3? For a documented route on this platform, use [MiniMax H3 on reAPI](/models/minimax-h3). Atlas Cloud remains relevant when its broader catalog or infrastructure is the reason for the account. Higgsfield should be evaluated through its current live model picker. See the [H3 API guide](/blog/hailuo-h3-minimax-h3-api-guide) for request modes and limits. ### Which is better for a marketing team? Higgsfield usually fits a hands-on marketing team because it provides creator workflows. reAPI fits a marketing software product that generates assets programmatically. Atlas Cloud becomes more relevant when that product also needs maximum catalog breadth or GPU infrastructure. ### Is reAPI an Atlas Cloud alternative? Yes, for teams buying model access through an API. reAPI is the more focused option for selected media and language models; Atlas Cloud is broader and also sells GPU infrastructure. Compare the exact live models your product needs rather than total catalog size. ### Does reAPI have Seedance 2.5? Not as a callable endpoint today. The [reAPI Seedance 2.5 page](/models/seedance-2-5) is marked coming soon. Developers can use [Seedance 2.0](/models/seedance-2-0) now and keep the model identifier configurable for a later migration. ## The verdict Atlas Cloud wins on breadth and infrastructure. Higgsfield wins on interactive creator workflow. reAPI is the practical choice for teams that want to put Seedance and other selected media models inside their own product with a documented async API and live pay-as-you-go pricing. Seedance 2.5 is not callable on any of the three today, so ship with [Seedance 2.0 on reAPI](/models/seedance-2-0) and keep the model ID configurable. ## References 1. Atlas Cloud. *Model catalog and Seedance 2.0 API.* Retrieved August 2, 2026. atlascloud.ai 2. Atlas Cloud. *Seedance 2.5 early access.* Retrieved August 2, 2026. atlascloud.ai 3. Higgsfield. *Seedance 2.5 — coming-soon notification page.* Retrieved August 2, 2026. higgsfield.ai 4. Higgsfield. *AI pricing and plans.* Retrieved August 2, 2026. geo.higgsfield.ai 5. Higgsfield. *What Creators Really Get with Seedance Unlimited.* Updated July 9, 2026. geo.higgsfield.ai 6. ModelArk. *Doubao Seedance 2.5 official promotion.* Retrieved August 2, 2026. [ark.volcengine.com](https://ark.volcengine.com/promotion?modelName=seedance-2-5) ### Further reading * reAPI. *Seedance 2.5 on Higgsfield.* [reapi.ai/blog/seedance-2-5-on-higgsfield](/blog/seedance-2-5-on-higgsfield) * reAPI. *MiniMax H3 vs Seedance 2.5.* [reapi.ai/blog/minimax-h3-vs-seedance-2-5](/blog/minimax-h3-vs-seedance-2-5) * reAPI. *Best Seedance 2.5 alternatives.* [reapi.ai/blog/best-seedance-2-5-alternatives](/blog/best-seedance-2-5-alternatives) --- # AtlasCloud Alternatives in 2026: 5 Tools Compared (https://reapi.ai/blog/atlascloud-ai-alternatives) Atlas Cloud sells itself as a "full-modal AI inference platform": one OpenAI-compatible API for chat, image, video, and audio, with a catalog it bills at 400+ models and a promise to launch new ones on day zero\[1]. Its own docs name fal.ai and kie.ai as the incumbents it undercuts, and it runs a per-second, per-image, pay-as-you-go meter with no monthly minimum\[2]. If you are shopping for **AtlasCloud alternatives**, you usually want one of three things: the same image and video models for less money, a bill you can read without a sales call, or a platform whose headline price is not a rotating promo. This guide compares five AtlasCloud alternatives on the axis that decides most media work, which is what the same models actually cost, plus catalog breadth, API shape, and where each one fits. Four are platforms in their own right: fal.ai, Replicate, Together AI, and RunPod. The fifth is reAPI, which we build, so read that section knowing the source. Every figure below came from each vendor's own pages in July 2026, and prices move, so confirm before you commit. ## TL;DR * **fal.ai** is the closest media-first match: 1,000+ image, video, and audio models on the fastest diffusion engine, but each model is its own endpoint and it is not OpenAI-compatible\[4]. * **Replicate** runs almost any model through one predictions API and lets you deploy your own, at the cost of fragmented billing and no OpenAI endpoint\[6]. * **Together AI** is the open-source LLM cloud with real GPU clusters and drop-in OpenAI compatibility; media generation is a thin add-on to a text-first catalog\[8]. * **RunPod** is GPU-first (H100 SXM from $3.29/hr) and now serves managed media endpoints too, but the media side is a scattered catalog rather than one unified API\[11]. * **reAPI** carries the same flagship media models behind one OpenAI-compatible API and lists roughly 50% to 80% lower prices on the Nano Banana image models (2, Lite, and Pro), with credit billing at 1 credit = $0.001 and refunds on failed jobs\[12]. ## What Atlas Cloud does well, and where it leaves gaps Atlas Cloud's pitch is breadth on top of a serious inference engine. Where it is strong: * **One unified, OpenAI-compatible API across every modality.** Chat, image, video, and audio through a single key, sold as a drop-in replacement for the OpenAI SDK, with streaming, batching, and structured outputs\[1]. * **Day-0 access to new frontier media models.** The catalog carries the newest video and image models (Seedance 2.0, Kling V3.0, Nano Banana 2, Veo 3.1, Grok Imagine) close to their release\[1]. * **A real high-throughput engine.** Its "Atlas Photon" stack is built on SGLang with FP4 quantization, and Atlas Cloud is a named SGLang collaborator, which is a genuine credential rather than a slogan\[1]. * **Enterprise posture and a GPU business.** SOC and HIPAA certifications, plus on-demand GPUs, bare metal, and serverless fine-tuning for teams that want to rent compute directly\[3]. Where teams hit walls: * **The flagship price page hides behind a challenge and a promo.** The public model-pricing table renders behind a bot check, and headline discounts like "20% off Seedance" are promotional, so the number you quote today may not be the number you pay next month\[2]. * **GPU pricing is a sales call.** Compute starts "from $2.95/GPU-hr," but the per-model H100, H200, and B200 rates sit behind a contact form\[3]. * **It is an aggregator serving upstream models.** Availability and quality ride on models it does not own, which is the same structural reality as any unified gateway, reAPI included. ## How to evaluate an AtlasCloud alternative Four questions sort the field faster than any feature list: * **Price on the models you actually run.** Not the headline "from" rate, but the specific resolution and mode you use, and whether that price is stable or a promo. * **Catalog fit.** Do they carry the exact image and video models you need, and how quickly do new ones land? * **API shape.** OpenAI-compatible chat plus clean REST for media, one key for everything, or several endpoints and SDKs? * **How you pay.** Transparent per-unit pricing, free credits to start, and no prepaid minimum, or seats, quotes, and sales gates. ## What the same models cost on Atlas Cloud and reAPI The reason to compare these two head to head is that they carry the same flagship models, so the prices line up cleanly. Every figure below came from each platform's own model pages and playground on July 8, 2026\[2]\[12]. Images are where the gap is widest, and both platforms bill Nano Banana per image at a flat rate, so it is a like-for-like read. | Model (per image) | reAPI | Atlas Cloud (list) | | ----------------------- | ------ | ------------------ | | Nano Banana 2 Lite (1K) | $0.02 | $0.04 | | Nano Banana 2 (1K) | $0.032 | $0.08 | | Nano Banana 2 (4K) | $0.072 | $0.16 | | Nano Banana Pro (1K) | $0.042 | $0.14 | | Nano Banana Pro (4K) | $0.045 | $0.24 | reAPI lists Nano Banana 2 at $0.032 for a 1K image against Atlas Cloud's $0.08, about 60% less, and the gap holds at 2K and 4K. Nano Banana Pro is wider: $0.042 versus $0.14 at 1K, and $0.045 versus $0.24 at 4K, roughly 80% less at the top resolution. Nano Banana 2 Lite is half price, $0.02 against $0.04. Atlas Cloud's discounted "developer" image tiers still sit above reAPI's standard rate on all three. GPT Image 2 is the exception, and it is close. Atlas Cloud meters it by tokens and quality, so a low-quality 1K image runs about $0.008 and a high-quality one about $0.14; reAPI charges a flat $0.03 for a 1K image on its basic channel, or roughly $0.005 to $0.17 across its quality tiers. Match the quality and the two sit within a fraction of a cent at the low and medium end, with Atlas Cloud actually cheaper at high quality. GPT Image 2 is a wash, so pick it on latency, not price. Video is closer than the image gap, and it needs a caveat. Atlas Cloud meters Seedance by tokens, and its homepage "from $0.09/sec" is a nominal floor rather than the real cost: its own playground prices a 5-second 720p text-to-video clip on Seedance 2.0 at $1.21, which works out to $0.24 per second\[2]. reAPI's displayed per-second rate is the rate it bills. | Seedance tier (720p, text-to-video) | reAPI ($/sec) | Atlas Cloud ($/sec, list) | | ----------------------------------- | ------------- | ------------------------- | | Seedance 2.0 | $0.205 | $0.242 | | Seedance 2.0 Fast | $0.165 | $0.194 | | Seedance 2.0 Mini | $0.098 | $0.121 | At 720p text-to-video and list prices, reAPI comes in about 15% under Atlas Cloud on Seedance 2.0 and Fast, and about 19% under on Mini. Two honest caveats. Atlas Cloud is running a 20% Seedance promo as of this writing, which pulls those three to rough parity while it lasts, and its token metering means the gap moves with resolution and clip length rather than staying fixed. reAPI's per-second rate is flat and shown up front. So on video the story is "modestly cheaper and more predictable," not "half price." The decisive price wins are on the Nano Banana image models. ## Five AtlasCloud alternatives worth comparing ### 1. fal.ai: the media-first inference API fal.ai is the closest thing to Atlas Cloud's media half done as a pure-play. It bills itself as a "generative media platform for developers," with the world's image, video, and audio models in one place\[4]. * **What it does:** serves 1,000+ generative media models on an inference engine tuned for speed, with serverless GPUs and on-demand clusters underneath\[4]. * **Models:** FLUX, Kling, Veo, Seedance, Nano Banana, Sora, Hailuo, Wan, and more, the same frontier media roster Atlas Cloud carries\[4]. * **API:** its own queue model (submit, poll status, fetch result) with a first-party client. It is not OpenAI-compatible, and each model is a separate `fal-ai/` endpoint with its own schema\[4]. * **GPU rental:** yes, from $1.89/hr for an H100\[5]. * **For:** teams that want the widest, fastest media catalog and do not mind wiring each model separately. * **Vs Atlas Cloud:** both are media-first, and fal.ai's catalog is larger. The trade is that fal.ai gives you a per-model endpoint zoo rather than one normalized, OpenAI-compatible interface. ### 2. Replicate: run and fine-tune almost any model Replicate's line is "Run AI with an API," and it leans on running open-source models plus deploying your own\[6]. * **What it does:** runs community models and lets you package custom ones with Cog, deploy them, and autoscale, all behind one predictions API\[6]. * **Models:** the same media flagships appear here, including Seedance 2.0, Veo 3.1, Kling v3, FLUX.2, Nano Banana 2 and Pro, and GPT Image 2\[6]. * **API:** a predictions endpoint you submit to and poll, not OpenAI-compatible, and billing is mixed, with some models charged by hardware and time and others by input and output\[6]. * **GPU rental:** billed as per-second hardware, with an H100 at $5.49/hr and an A100 80GB at $5.04/hr\[7]. * **For:** teams that want to run community models and ship their own custom models on the same platform. * **Vs Atlas Cloud:** comparable media breadth plus custom deploys, but the fragmented billing and lack of a normalized media schema or OpenAI endpoint make cost harder to predict. ### 3. Together AI: the open-source LLM cloud with GPUs Together AI calls itself "the AI Native Cloud," a full stack of inference, fine-tuning, and GPU clusters centered on open-weight LLMs\[8]. * **What it does:** open-source LLM inference, fine-tuning, and raw GPU clusters, with image generation attached to a text-first catalog\[8]. * **Models:** for media it carries FLUX, GPT Image 2, Wan, and Seedance, but not Kling, Veo, or Nano Banana at the time of writing\[8]. * **API:** genuinely OpenAI-compatible. Point the OpenAI SDK at `api.together.ai/v1` and most calls work unchanged\[9]. * **GPU rental:** yes, with an H100 at $3.99/hr, H200 at $5.99/hr, and B200 at $8.19/hr on demand\[9]. * **For:** teams built around open-weight LLMs and fine-tuning who want some media on the side. * **Vs Atlas Cloud:** Together is stronger on open LLM infrastructure and clusters, but its media catalog is thinner, so a media-first workload gets more from fal.ai, Atlas Cloud, or reAPI. ### 4. RunPod: raw GPUs plus managed media endpoints RunPod is "the AI Developer Cloud," and it started as raw GPU rental before growing managed endpoints on top\[10]. * **What it does:** GPU pods, serverless workers, and clusters across 30+ GPU SKUs, plus "Public Endpoints" that serve ready-made media models per call\[10]. * **Models:** its Public Endpoints now include Seedance, Kling, Nano Banana Edit and Pro Edit, FLUX, and WAN, so it is no longer GPU-only\[11]. * **API:** partial OpenAI compatibility, limited to its vLLM LLM endpoints; the media endpoints each have their own REST shape\[10]. * **GPU rental:** its core business, with an H100 SXM at $3.29/hr and a B200 at $5.89/hr\[11]. * **For:** teams that want low-level GPU control, fast cold starts, and no egress fees, with a few managed media endpoints available. * **Vs Atlas Cloud:** RunPod gives you cheaper raw compute and more control, but its media side is a scattered set of endpoints rather than one curated, unified media API. ### 5. reAPI: the same media models at a lower listed price reAPI is a unified, OpenAI-compatible aggregator with a deliberately focused catalog of around 48 image, video, and chat models, built for developers who want the models inside their own product\[12]. Up front, it is narrower than Atlas Cloud's 400+ and it does not rent raw GPUs, so if you need the widest possible catalog or bare-metal compute, Atlas Cloud or RunPod is the honest answer. * **What it does:** async image and video generation on REST endpoints plus OpenAI-compatible chat, with sub-second failover and zero request retention, under one key\[12]. * **Models:** the same flagships you would pick Atlas Cloud for, including Seedance 2.0, Fast, and Mini, Nano Banana 2, Lite, and Pro, GPT Image 2, plus Veo, Kling, and Wan\[12]. * **API:** OpenAI-compatible chat at `reapi.ai/api/v1`, REST for media, one bearer key for all of it\[12]. * **Pricing:** credit-based at 1 credit = $0.001, you pay only for completed generations, failed jobs refund automatically, and free credits cover the first runs with no card\[12]. * **For:** builders who want Atlas Cloud's flagship media models at a lower listed price with a bill they can read. * **Vs Atlas Cloud:** both are unified OpenAI-compatible media APIs. Atlas Cloud wins on raw breadth, GPU rental, and enterprise compliance. reAPI's edge is a lower per-unit price on several shared flagship models and transparent credit billing with no promo or quote games, as the price section above lays out. ## AtlasCloud vs the alternatives at a glance | Platform | Catalog | Media focus | OpenAI-compatible | Rents GPUs | How you pay | | ----------- | -------------------------- | ----------------------------- | ------------------- | ----------------------------------------- | ----------------------------------------- | | Atlas Cloud | 400+ models | Image, video, audio, plus LLM | Yes | Yes (from $2.95/GPU-hr, rates on request) | Pay-as-you-go, promo-driven | | fal.ai | 1,000+ media models | Media-first | No (own queue) | Yes (H100 from $1.89/hr) | Per generation + GPU/hr | | Replicate | Large, plus custom deploys | Media and general models | No (predictions) | By hardware-time (H100 $5.49/hr) | Per run, mixed metrics | | Together AI | 180+ models | LLM-first, media add-on | Yes | Yes (H100 $3.99/hr) | Per token, per image, GPU/hr | | RunPod | 30+ GPU SKUs + endpoints | GPU-first, media endpoints | Partial (vLLM only) | Yes (H100 SXM $3.29/hr) | Per-hour GPU, per-call endpoints | | reAPI | \~48 curated models | Image, video, chat | Yes | No | Credits, 1cr = $0.001, pay per completion | Capability claims are from each vendor's official pages as of July 2026, and features change, so confirm before you commit. ## The split that actually decides it Two questions sort this list faster than any feature table. First, do you want raw compute or a finished media API? RunPod and the GPU side of Together and Atlas Cloud rent you hardware to run whatever you like. fal.ai, Replicate, reAPI, and the media side of Atlas Cloud hand you the model as a call. If your workload is "generate this video," you want the second group, and paying for GPU hours is mostly a distraction. Second, unified or per-model? fal.ai and Replicate give you enormous reach but a different endpoint and schema per model. Together AI and reAPI are OpenAI-compatible, and Atlas Cloud advertises the same. If you are wiring media into a product, one normalized interface and one key save more time than a few extra models in the catalog. ## Calling reAPI from the OpenAI SDK Because reAPI speaks the OpenAI format, moving a chat call over is a base-URL change, and image and video run on REST endpoints under the same key. ```python from openai import OpenAI client = OpenAI( base_url="https://reapi.ai/api/v1", api_key="rk_live_YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Draft three taglines for a launch."}], ) ``` ## FAQ ### Which AtlasCloud alternative is cheapest for Seedance 2.0? At 720p text-to-video and list prices, reAPI runs about 15% under Atlas Cloud on Seedance 2.0 and its Fast tier, and about 19% under on Mini\[12]\[2]. Atlas Cloud's current 20% Seedance promo narrows that to roughly even while it lasts, and its token metering means the exact gap shifts with resolution and clip length. ### Which AtlasCloud alternative is cheapest for image generation? reAPI, on the Nano Banana models. It lists Nano Banana 2 Lite at $0.02 against Atlas Cloud's $0.04, Nano Banana 2 at $0.032 against $0.08, and Nano Banana Pro at $0.042 against $0.14, roughly 50% to 70% less at 1K\[12]\[2]. ### Is there a free AtlasCloud alternative? No platform here is free to run at volume, but reAPI gives free credits to start with no card, and you pay only for completed generations, so failed jobs cost nothing\[12]. Atlas Cloud also starts with a free API key and a first-top-up bonus\[2]. ### Which AtlasCloud alternative has the most models? fal.ai lists 1,000+ media models, and Replicate hosts a very large open catalog plus your own custom deploys\[4]\[6]. Atlas Cloud advertises 400+; reAPI is deliberately narrower at around 48 curated models\[12]. ### Do these AtlasCloud alternatives have an OpenAI-compatible API? Together AI and reAPI are OpenAI-compatible, RunPod is compatible only on its vLLM LLM endpoints, and fal.ai and Replicate use their own APIs instead\[9]\[12]. ### Which AtlasCloud alternative rents raw GPUs? RunPod, Together AI, fal.ai, and Atlas Cloud all rent GPUs by the hour; RunPod is the most GPU-centric, with an H100 SXM at $3.29/hr\[11]. reAPI does not rent GPUs, it only serves models as an API. ## Picking an AtlasCloud alternative Atlas Cloud does a real job: it puts 400+ models, day-0 media access, a fast inference engine, and a GPU business behind one OpenAI-compatible API. The reason to look at an AtlasCloud alternative is usually specific. Choose fal.ai for the widest, fastest media catalog, Replicate to run and deploy your own models, Together AI for open-weight LLMs with real clusters, and RunPod when you want raw GPU control. If what you want is the same flagship image and video models at a lower listed price, with credit billing you can read and refunds on failed jobs, reAPI is the AtlasCloud alternative aimed at developers who care more about cost and clarity than catalog size. Run one real workload through two of these and let price and model fit decide which AtlasCloud alternative you keep. ## Further reading * [reapi.ai/models](/models) lists the full catalog of image, video, and chat models behind one key. * [reapi.ai/models/seedance-2-0](/models/seedance-2-0) and [reapi.ai/models/nano-banana-2-lite](/models/nano-banana-2-lite) show the per-generation prices used above. * [reapi.ai/docs/api/quickstart](/docs/api/quickstart) covers the OpenAI-compatible chat endpoint in a few lines. ## References 1. Atlas Cloud. *Full-modal AI inference platform — homepage and highlights.* Retrieved July 2026 from atlascloud.ai 2. Atlas Cloud. *Docs and model pricing — OpenAI-compatible API, pay-as-you-go, no minimums.* Retrieved July 2026 from atlascloud.ai/docs 3. Atlas Cloud. *GPU Cloud — on-demand compute from $2.95/GPU-hr.* Retrieved July 2026 from atlascloud.ai/gpus 4. fal.ai. *Generative media platform for developers — models and quickstart.* Retrieved July 2026 from fal.ai 5. fal.ai. *Pricing — serverless GPUs and per-model rates.* Retrieved July 2026 from fal.ai/pricing 6. Replicate. *Run AI with an API — models and predictions.* Retrieved July 2026 from replicate.com 7. Replicate. *Pricing — hardware and per-run rates.* Retrieved July 2026 from replicate.com/pricing 8. Together AI. *The AI Native Cloud — inference, fine-tuning, and clusters.* Retrieved July 2026 from together.ai 9. Together AI. *Pricing and OpenAI compatibility.* Retrieved July 2026 from together.ai/pricing 10. RunPod. *The AI Developer Cloud — pods, serverless, and vLLM compatibility.* Retrieved July 2026 from runpod.io 11. RunPod. *Pricing — GPU rates and Public Endpoints.* Retrieved July 2026 from runpod.io/pricing 12. reAPI. *Model catalog and per-generation pricing.* Retrieved July 2026 from [reapi.ai/models](/models) --- # Which Claude Model Is Best for Coding and for Writing (https://reapi.ai/blog/best-claude-model-for-coding) "Which Claude model is best for coding" has a different answer depending on whether you mean the highest benchmark score, the best result per dollar, or the model that will not surprise you at 2am. Those are three different models. The published numbers settle more of it than people expect, including one row where Anthropic's own table shows its flagship losing. ## TL;DR * **Highest agentic-coding score**: Claude Fable 5 at 80.3% on SWE-Bench Pro\[1]. * **Best default for most teams**: Claude Opus 5, which Anthropic positions for complex agentic coding and enterprise work\[2]. * **Opus 5 loses one coding row.** GPT-5.6 Sol takes DeepSWE v1.1, 72.7% against 68.8%, in Anthropic's own table\[3]. * **For writing, the ranking inverts toward knowledge work**, where Opus 5 leads GDPval-AA v2 at 1861\[3]. * **Effort matters more than model choice** below the frontier: `low` and `medium` on Opus 5 hold up unusually well\[2]. * **On reAPI, Opus 5 costs less than Fable 5 by a wide margin**, which changes the trade. ## The coding numbers ![Three coding benchmarks with three different winners: Fable 5 on SWE-Bench Pro, Opus 5 on Frontier-Bench, and GPT-5.6 Sol taking DeepSWE, plus the knowledge-work row where the ranking inverts](https://cdn.reapi.ai/media/blog/best-claude-model-for-coding/split.png) Three models are in serious contention. Here is what Anthropic published for each. | Benchmark | Fable 5 | Opus 5 | Opus 4.8 | | -------------------------------------- | ----------- | --------- | -------- | | SWE-Bench Pro (agentic coding) | **80.3%** | n/a | 69.2% | | FrontierCode Diamond (hardest coding) | **29.3%** | 53.4%† | 13.4% | | Terminal-Bench 2.1 | **88.0%**\* | n/a | 82.7% | | Frontier-Bench v0.1 (agentic terminal) | 33.7% | **43.3%** | 21.1% | | DeepSWE v1.1 (agentic coding) | 69.7% | 68.8% | 59.0% | \* A starred row is one where Anthropic notes the public Fable 5 diverges from the unrestricted sibling because safety classifiers trigger; expect the model you can actually call to land closer to Opus 4.8 there\[1]. † FrontierCode v1.1 Main, a different cut of the benchmark than the Diamond subset in the Fable 5 column, so read down the column rather than across this row. Two conclusions survive that table. **Fable 5 is the top of the coding board** where the benchmarks are directly comparable, and by a real margin on SWE-Bench Pro\[1]. **Opus 5 wins the newer agentic-terminal benchmark decisively**, more than doubling Opus 4.8's Frontier-Bench score\[3]. ## The row Anthropic left in On DeepSWE v1.1, Anthropic's own comparison table puts **GPT-5.6 Sol at 72.7% against Opus 5's 68.8%**\[3]. That is the clearest coding loss on the board, and it lands on exactly the workload Opus 5 is marketed for. It is worth taking seriously rather than explaining away. If your evaluation resembles DeepSWE, a competitor scores higher on the vendor's own numbers. If it resembles long-horizon terminal work, Opus 5 wins the same table by nine points over that competitor. The lesson is not that one model is better. It is that "best for coding" resolves differently depending on which coding benchmark matches your work. ## Which one for writing Ask the writing question and the ranking reorganizes, because writing lives closer to knowledge work than to code. | Benchmark | Opus 5 | Fable 5 | Opus 4.8 | | ---------------------------------- | --------- | --------- | -------- | | GDPval-AA v2 (knowledge work, Elo) | **1861** | 1747 | 1593 | | Humanity's Last Exam, no tools | 56.3% | **56.5%** | 49.8% | | Humanity's Last Exam, with tools | **64.7%** | 63.9% | 57.9% | Opus 5 leads knowledge work by 114 Elo over Fable 5\[3]. On reasoning without tools the two are a statistical tie. For drafting, editing, and synthesis, that GDPval gap is the relevant signal, and it points at Opus 5 rather than the model that tops the coding board. ## The variable that beats model choice Below the frontier, effort level moves results more than switching models does. Anthropic describes Opus 5 as converting additional effort into better results more reliably than any earlier Opus model, and separately notes that `low` and `medium` produce strong quality at a fraction of the tokens and latency\[2]. The official guidance is to start at the default `high` and sweep in both directions against your own evaluations. That has a practical consequence for this whole question. A team that picks the "best" model and leaves effort at an inherited default is often getting worse results, more slowly, than a team on the tier below that tuned the dial. ## What it costs on reAPI Model choice is a cost decision as much as a capability one. | Model | Input / output per 1M tokens | | ----------------- | ---------------------------- | | Claude Fable 5 | $8.00 / $40.00 | | Claude Opus 5 | **$2.40 / $12.00** | | Claude Opus 4.8 | $4.00 / $20.00 | | Claude Sonnet 4.6 | $2.40 / $12.00 | Fable 5 costs more than three times Opus 5 on the same gateway. That reframes the coding question: Fable 5's SWE-Bench Pro lead is real, and you are paying over 3x for it, on a model that also carries mandatory 30-day retention and a refusal layer\[1]. For most teams that trade does not clear. For a repo-scale migration where a failed run costs more than the tokens, it can. ## Picking **Default to Opus 5.** Best knowledge-work score, decisive on the newer agentic-terminal benchmark, and the cheapest of the three on this gateway. **Reach for Fable 5** when the task is long-horizon and hard *and* you have measured it winning on your own work. The FrontierCode curve is the honest argument: on the hardest problems, extra effort keeps buying accuracy where other models flatten\[1]. **Stay on Opus 4.8** when your evaluations are already calibrated to it, or when you need thinking disabled at high effort levels, which Opus 5 rejects\[2]. **Consider a non-Claude model** if your workload looks like DeepSWE. The vendor's own table says so. ```python from openai import OpenAI client = OpenAI(api_key="YOUR_REAPI_KEY", base_url="https://api.reapi.ai/v1") resp = client.chat.completions.create( model="claude-opus-5", messages=[{"role": "user", "content": "Refactor this module and add tests."}], max_tokens=16000, stream=True, ) ``` Switching between them is a model-string change on one key. Rates are on [reapi.ai/models](/models). ## FAQ ### Which Claude model is best for coding? Fable 5 tops the directly comparable coding benchmarks, notably SWE-Bench Pro at 80.3%\[1]. Opus 5 wins the newer agentic-terminal benchmark and costs far less, which makes it the better default for most teams\[3]. ### Which Claude model is best for writing? Opus 5. It leads knowledge work on GDPval-AA v2 at 1861 Elo, 114 ahead of Fable 5\[3]. ### Does Claude beat GPT for coding? Not on every benchmark. Anthropic's own table shows GPT-5.6 Sol taking DeepSWE v1.1 at 72.7% against Opus 5's 68.8%, while Opus 5 leads the same table on agentic terminal work\[3]. ### Is Fable 5 worth three times the price? Only when the task is hard enough that its effort curve pays for itself. It also carries mandatory 30-day data retention and a classifier refusal layer that Opus 5 does not\[1]. ### Does effort level matter more than model choice? Below the frontier, often yes. Opus 5 converts extra effort into results more reliably than earlier Opus models, and its `low` and `medium` settings hold up unusually well\[2]. ### Which model should I use for code review specifically? Opus 5, with one caveat from Anthropic's guidance: it follows severity filters literally, so asking only for high-severity issues depresses what it reports. Ask for everything with confidence labels and filter downstream\[2]. ### Is Sonnet good enough for coding? For high-volume work where cost per turn dominates, often yes. On reAPI Sonnet 4.6 costs the same as Opus 5, which removes the price argument for choosing it. ### How do I switch between them? One model string on one key, if you call them through a gateway rather than per-vendor accounts. ## Matching the model to the benchmark that matches your work The honest answer to which Claude model is best for coding is that the question is underspecified. Fable 5 tops the classic coding benchmarks. Opus 5 tops the newer agentic-terminal one, leads knowledge work outright, and costs a third as much. A competitor beats both on one row that Anthropic published anyway. So pick the benchmark that resembles your actual work, then read that row. And before switching models at all, sweep the effort dial on the one you already have, because below the frontier that moves results more than the model name does. ## References 1. reAPI. *How to use Claude Fable 5 — benchmark table, effort curve, refusal layer, and retention.* [reapi.ai/blog/how-to-use-claude-fable-5](/blog/how-to-use-claude-fable-5) 2. Anthropic. *What's new in Claude Opus 5 — effort guidance, behavior changes, and capability improvements.* Retrieved July 2026 from [platform.claude.com/docs/en/about-claude/models/whats-new-opus-5](https://platform.claude.com/docs/en/about-claude/models/whats-new-opus-5) 3. reAPI. *How to use Claude Opus 5 — the full published benchmark table.* [reapi.ai/blog/how-to-use-claude-opus-5](/blog/how-to-use-claude-opus-5) ### Further reading * reAPI. *How to use Claude Opus 4.8.* [reapi.ai/blog/how-to-use-claude-opus-4-8](/blog/how-to-use-claude-opus-4-8) * reAPI. *How to use GPT-5.6.* [reapi.ai/blog/how-to-use-gpt-5-6](/blog/how-to-use-gpt-5-6) * reAPI. *Model catalog.* [reapi.ai/models](/models) --- # Best CometAPI Alternatives in 2026: 5 Options Compared (https://reapi.ai/blog/best-cometapi-alternatives) CometAPI is a unified gateway: one OpenAI-compatible key reaches 500+ models across text, image, video, and audio, priced at least 20% below the providers' official rates\[1]. It is a clean pitch in a crowded category. Teams comparing **CometAPI alternatives** usually want one of a few things: pass-through pricing where they pay the exact provider rate, the option to own inference or fine-tune, deeper media and video coverage, or a specific model CometAPI does not carry. This guide compares five CometAPI alternatives on what moves a decision: model range, pricing model, integration effort, and where each one beats CometAPI. Four are independent platforms. The fifth is reAPI, which we build. Both reAPI and CometAPI are unified, OpenAI-compatible gateways priced below official rates, so I will be specific about the real differences rather than pretend they are far apart. Every figure below came from each vendor's own pricing page or docs on May 30, 2026. ## TL;DR * **CometAPI** unifies 500+ models behind one OpenAI-compatible key at roughly 20% below official rates, with pay-as-you-go credits that do not expire\[1]. * **OpenRouter** is the pass-through option: 400+ models across 60+ providers at provider rates, plus a 5.5% credit-purchase fee, with free model variants\[2]\[3]. * **WaveSpeed** is a speed-first unified API with 1,000+ models, but a $1 trial and prepayment-gated throughput\[4]. * **Together AI** owns its open-model inference and fine-tuning; **Replicate** owns the widest custom-model catalog\[6]\[8]. * **reAPI** is the curated-media unified pick: 200+ models with deeper video generation and a transparent credit unit. ## What CometAPI does well, and where it leaves gaps CometAPI's strength is consolidation with a built-in discount. Where it is strong: * **One key for 500+ models.** Text, image, video, and audio through a single OpenAI-compatible endpoint\[1]. * **A flat discount.** Models are priced at least 20% below official vendor rates, stated as "customer price = official x 0.8"\[1]. * **Credits that last.** Pay-as-you-go with no subscription and no minimum, and unused credits carry forward indefinitely\[1]. * **Easy entry.** Test credits at signup, no credit card required\[1]. Where teams hit walls: * **Self-reported reliability.** The 99.9% uptime and response-time figures are CometAPI's own numbers, not audited benchmarks\[1]. * **A fixed discount, not the floor.** The roughly 20% cut is off official rates; for some open models, a pass-through router can reach a cheaper third-party provider instead\[3]. * **No fine-tuning or self-hosting.** It is an aggregation layer, so training and dedicated deployment live elsewhere. * **Unpublished free amount.** The trial is "test credits," with no documented dollar figure\[1]. ## How to evaluate a CometAPI alternative Five questions sort the field: * **Pricing shape.** A flat discount off official, pass-through provider rates, or your own compute? * **Model reach.** Does it carry the exact models you need across modalities? * **Media depth.** Is video generation a first-class feature or an afterthought? * **Train vs. call.** Do you need fine-tuning or dedicated hosting? * **Entry cost.** A real free balance, or a token trial? ## The best CometAPI alternatives in 2026 ### 1. OpenRouter: best for pass-through pricing and breadth OpenRouter is the largest aggregator and the transparency option: you pay the provider's rate, not a repriced one\[2]. * **Features:** 400+ models across 60+ providers behind one OpenAI-compatible key, with provider routing, free model variants, and bring-your-own-key support\[2]\[3]. * **Pricing:** Pass-through at the provider's own rate, plus a 5.5% ($0.80 minimum) fee on credit purchases. Rates vary by provider, for example Claude Opus 4.8 at $5 in / $25 out\[3]. * **Performance:** Depends on the routed provider; the schema is normalized across them. * **Best for:** Teams that want provider-exact pricing and the widest model reach. * **Vs CometAPI:** OpenRouter pays provider rate plus a credit fee; CometAPI prices a flat 20% below official with no purchase surcharge. Which is cheaper depends on the model. ### 2. WaveSpeed: best for speed-first media WaveSpeed is another unified, OpenAI-compatible gateway, tuned for low latency on media\[4]. * **Features:** 1,000+ models across image, video, audio, 3D, and language, with sub-second latency claims and Python and JavaScript SDKs\[5]. * **Pricing:** Pay-per-use, for example Seedance 2.0 Fast at $0.10/second and Nano Banana 2 at $0.07/image. New accounts get $1 in trial credits\[4]. * **Performance:** Advertises zero cold starts and images in under two seconds\[5]. * **Best for:** Latency-sensitive media workloads. * **Vs CometAPI:** WaveSpeed leans on raw speed and a larger catalog; throughput is gated behind prepayment tiers rather than a flat discount\[5]. ### 3. Together AI: best for open models and fine-tuning Together AI owns its inference rather than reselling, with fine-tuning on top\[6]. * **Features:** 176 open-weighted models, per-token serverless, dedicated GPUs, fine-tuning, and an OpenAI-compatible API\[6]\[7]. * **Pricing:** Per-token, for example Llama 3.3 70B at $0.88 per million, with dedicated H100s at $6.49/hour. No free trial, $5 minimum\[6]. * **Performance:** Strong for open-model chat, vision, and reasoning. * **Best for:** Open-source-first teams that fine-tune. * **Vs CometAPI:** Together runs its own inference and training; CometAPI aggregates closed and open models without training. ### 4. Replicate: best for custom models Replicate hosts the widest catalog and lets you ship your own model\[8]. * **Features:** Thousands of community models, per-second hardware inference, fine-tuning, and Cog packaging\[8]. * **Pricing:** Hardware per-second, for example A100 80GB at $5.04/hour, or per-output like FLUX 1.1 Pro at $0.04/image\[8]. * **Performance:** Flexible, with cost tied to runtime. * **Best for:** Teams that need a niche model or a custom deploy. * **Vs CometAPI:** Replicate is built for custom and community models; CometAPI is a curated commercial catalog. ### 5. reAPI: best for curated media and transparent credits reAPI is a unified, OpenAI-compatible gateway priced below official rates, with a deeper curated video catalog and a transparent credit unit at 1 credit = $0.001. * **Features:** 200+ models with deeper video generation (Veo 3.1, Seedance 2.0, Wan 2.7, Kling, HappyHorse 1.0) plus frontier LLMs (GPT-5, Claude Opus 4.8, Gemini) and image models (GPT-Image-2, Gemini 3 Pro Image). Chat is OpenAI-compatible; image and video run on REST endpoints under the same key. * **Pricing:** Pay-as-you-go credits at 1 credit = $0.001, so the unit is explicit, at 20-50% below official rates. Media is flat per-output, for example GPT-Image-2 from $0.0066/image, Seedance 2.0 from $0.0506/video, and Veo 3.1 Fast from $0.207/generation. Free credits to start. * **Performance:** Same upstream frontier models; the win is a tighter media catalog and a clear price unit. * **Best for:** Teams that want a unified gateway with serious video generation and a transparent per-credit cost. * **Vs CometAPI:** reAPI matches the unified, OpenAI-compatible, below-official model and adds a deeper curated video catalog (Veo 3.1, Seedance 2.0, Wan 2.7, Kling) plus an explicit credit unit at 1 credit = $0.001. ## CometAPI vs. the top alternatives at a glance | Platform | Catalog | Modalities | Pricing model | OpenAI-compatible | Best for | | ----------- | ------------------------- | ---------------------------- | ------------------------------ | ----------------- | ------------------------- | | CometAPI | 500+ models | Text, image, video, audio | \~20% below official | Yes | Unified discounted access | | OpenRouter | 400+ across 60+ providers | Text + some multimodal | Pass-through + 5.5% fee | Yes | Pass-through breadth | | WaveSpeed | 1,000+ models | Image, video, audio, 3D, LLM | Pay-per-use, tiered | Yes | Speed-first media | | Together AI | 176 (open focus) | Chat, vision, image, audio | Per-token + dedicated GPU | Yes | Open models + fine-tuning | | Replicate | Thousands (community) | Image, video, some LLMs | Per-second or per-output | No | Custom + community models | | reAPI | 200+ models | Image, video, audio, chat | Credits, 20-50% below official | Yes (chat) | Curated media + LLMs | Catalog and pricing figures are from each vendor's official pages as of May 2026; rates change, so confirm before you commit. ## What the numbers say about pricing CometAPI, OpenRouter, and reAPI are all unified gateways, but they price differently, and the cheapest one is model-dependent. * **CometAPI** prices a flat 20% or so below each provider's official rate, with no purchase surcharge and credits that do not expire\[1]. * **OpenRouter** passes the provider's exact rate through unchanged, then adds a 5.5% ($0.80 minimum) fee when you buy credits, so a cheap third-party provider can win on open models while the fee eats into small top-ups\[3]. * **reAPI** uses an explicit credit unit, 1 credit = $0.001, at 20-50% below official rates, with free starting credits. * **WaveSpeed** is pay-per-use but gates throughput behind prepayment tiers; **Together** is per-token with a $5 minimum\[5]\[6]. The honest read: against CometAPI, the deciding factors are usually catalog fit and media depth, not a few percent of token cost. Compare the specific models you call, not the headline discount. ## Moving from CometAPI to reAPI Because both speak the OpenAI format, switching text calls is a base-URL change, and media moves to reAPI's REST endpoints: ```python from openai import OpenAI client = OpenAI( base_url="https://api.reapi.ai/v1", api_key="YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Rewrite this paragraph for clarity."}], ) ``` Image and video run on REST endpoints under the same base URL and key. Since both are pay-as-you-go, the low-risk move is to run a real workload through each and compare invoices and model coverage before you consolidate. ## FAQ ### Is CometAPI legit? CometAPI is a working unified gateway for 500+ models at below-official pricing\[1]. Its reliability statistics are self-reported rather than independently audited, which is worth noting but common for the category. The reasons to compare CometAPI alternatives are usually catalog fit, media depth, or a preference for pass-through pricing. ### What is the difference between CometAPI and OpenRouter? CometAPI prices each model around 20% below its official rate with no purchase surcharge. OpenRouter passes the provider's exact rate through unchanged, then charges a 5.5% ($0.80 minimum) fee on credit purchases\[1]\[3]. CometAPI is cheaper on models where the official rate is the reference; OpenRouter can be cheaper where a budget third-party provider hosts an open model. ### Which CometAPI alternative is best for video? reAPI and WaveSpeed both carry serious video catalogs. reAPI lists curated models like Veo 3.1, Seedance 2.0, and Wan 2.7 with flat per-video pricing; WaveSpeed leans on low-latency generation\[4]. ### Which CometAPI alternative is OpenAI-compatible? OpenRouter, WaveSpeed, Together AI, and reAPI all expose OpenAI-compatible APIs, so you reuse an existing client by changing the base URL\[2]\[5]\[7]. Replicate uses its own predictions API. ### Can I fine-tune models on a CometAPI alternative? Yes. Together AI and Replicate both support fine-tuning, and RunPod or Hugging Face let you train on your own infrastructure\[6]\[8]. CometAPI itself is a hosted-inference gateway rather than a training platform. ## Choosing a CometAPI alternative CometAPI does the unified-gateway job well: one key, 500+ models, a flat discount off official rates. The case for a CometAPI alternative is rarely the headline price and usually the specifics: pass-through transparency, the option to fine-tune, or deeper video generation. OpenRouter wins on provider breadth and pass-through pricing, WaveSpeed on latency, Together AI on open-model training, and Replicate on custom models. If you want a unified, OpenAI-compatible gateway with a curated media catalog and a transparent per-credit cost, reAPI is the CometAPI alternative built for that. Run a real workload through two of them and let coverage and invoices decide. ## Further reading * [reapi.ai/models](/models) — frontier LLMs plus image, video, and audio. * [Claude Opus 4.8](/models/claude-opus-4-8) — frontier reasoning on the OpenAI-compatible gateway. * [Best Together AI alternatives](/blog/best-together-ai-alternatives) — the same comparison for Together AI. ## References 1. CometAPI. *Pricing and platform overview — 500+ models, below-official rates.* Retrieved May 2026 from cometapi.com/pricing 2. OpenRouter. *Models — provider and modality catalog.* Retrieved May 2026 from openrouter.ai/models 3. OpenRouter. *Docs FAQ — pass-through pricing, fees, and free models.* Retrieved May 2026 from openrouter.ai/docs/faq 4. WaveSpeed AI. *Pricing — pay-per-use rates and trial credits.* Retrieved May 2026 from wavespeed.ai/pricing 5. WaveSpeed AI. *Platform overview, performance, and API.* Retrieved May 2026 from wavespeed.ai/about 6. Together AI. *Pricing — serverless tokens, dedicated GPUs, and minimums.* Retrieved May 2026 from together.ai/pricing 7. Together AI. *OpenAI compatibility and model catalog.* Retrieved May 2026 from docs.together.ai/docs/inference/openai-compatibility 8. Replicate. *Pricing — hardware and per-output model rates.* Retrieved May 2026 from replicate.com/pricing --- # Best Compilatio Alternatives in 2026: 5 Tools Compared (https://reapi.ai/blog/best-compilatio-alternatives) Compilatio is a French ed-tech company that has sold plagiarism detection to schools since 2005, and over the last few years it added AI-text detection to the same platform\[1]. If you are weighing **Compilatio alternatives**, you are usually one of two people: an educator who wants a different academic-integrity tool, or a developer who wants the detection itself as an API to build on. Compilatio serves the first well and the second not at all. This guide compares five Compilatio alternatives on what actually separates them: what they detect (plagiarism, AI text, or both), whether you get a dashboard or an API, how far the LMS integration reaches, and language coverage. Four are detection products in their own right. The fifth is reAPI, which we build, and I will be upfront about it: reAPI is not a classroom plagiarism platform, so if you need similarity-matching against a source database with a teacher dashboard, the honest answer is Compilatio, Turnitin, or Copyleaks, not us. Where reAPI fits is the developer who wants AI detection as an API, with a humanizer and an essay generator under the same key. Everything below came from each vendor's own pages, checked in June 2026. ## TL;DR * **Turnitin** is the institutional standard: Similarity Reports against the largest academic database, comparison across 170 languages, and an AI writing indicator, sold to institutions with no public API\[4]\[5]. * **Copyleaks** does what Compilatio does and exposes it: AI detection across 30+ languages and plagiarism across 100+, in one report, behind a white-labeled API\[6]\[7]. * **GPTZero** is education-first AI detection with sentence-level highlighting, a Chrome extension, and the lowest-friction API of the group\[8]\[9]. * **Originality.ai** is built for web publishers and SEO teams: AI detection, plagiarism, and fact-checking in one suite, with an API on its top plan\[10]\[11]. * **reAPI** gives you AI detection as a single API call that returns a 0–100 score, plus a humanizer and an essay generator on the same key. It is a developer toolkit, not a similarity checker and not a classroom product. ## What Compilatio does well, and where it leaves gaps Compilatio's strength is that it covers both halves of academic integrity inside one workflow built for teachers. Where it is strong: * **Plagiarism and AI in one place.** A similarity report lists sources and locates matches in the text; an AI detector flags passages that read as machine-written and gives an AI-likelihood percentage\[1]. * **Built for the classroom.** Magister and Magister+ are for teachers, Studium is for student self-checks, and an institution's own submissions can be cross-compared against each other\[2]. * **Wired into the LMS.** It plugs into Moodle, Canvas, Brightspace, Blackboard, Microsoft Teams, and Open LMS through an identification key issued per instance\[3]. * **European data posture.** A French company with servers in France, ISO 9001 certification, and use across more than 50 countries\[12]. Where teams hit walls: * **AI detection is tiered, not standard.** The base Magister plan does similarity only. AI detection sits on Magister+, Studium, and the Copyright product, so the feature you came for may not be in the plan you have\[2]. * **No self-serve developer API.** The "API" is an institutional integration key for an LMS, not a public endpoint with docs that any developer can sign up for and call\[3]. * **A European-education center of gravity.** The product interface ships in six languages, French, English, German, Spanish, Italian, and Portuguese, and the whole thing is shaped around schools rather than software teams\[12]. * **A product, not a building block.** You operate Compilatio from its dashboard. You cannot drop its detection inside your own app. ## How to evaluate a Compilatio alternative Five questions sort the field quickly: * **What do you need to detect?** Plagiarism against real sources, AI-generated text, or both. * **Dashboard or API?** A log-in-and-upload product, or an endpoint you call from your own code. * **Who actually uses it?** Teachers and students inside an LMS, or your own users inside your own product. * **How many languages?** English only, the main European languages, or a long tail. * **One job or a toolkit?** Detection alone, or detection plus the text tools that sit next to it. ## The best Compilatio alternatives in 2026 ### 1. Turnitin: best for institutional academic integrity at scale Turnitin is the name most universities already run, and the closest match to Compilatio's institutional side\[4]. * **What it does:** Similarity Reports compare a submission against student archives, paid publications, and more than 20 years of web content. A separate AI writing indicator flags text that is likely AI-generated or AI-paraphrased, including work pushed through "bypass" humanizers\[4]. iThenticate handles publishers and researchers on the same engine\[4]. * **Detection scope:** plagiarism and AI writing, with similarity comparison across 170 languages\[4]. Turnitin reports a document-level false-positive rate under 1% on its AI detection, and is careful to say the tool flags text for a human to judge rather than accusing anyone\[5]. * **Best for:** schools, universities, and journals that want one trusted integrity platform wired into their LMS. * **Vs Compilatio:** the same job with a larger database and a wider footprint. Like Compilatio, Turnitin is institutional-only and sold through sales, with no public developer API\[4]. You adopt the platform; you do not build on it. ### 2. Copyleaks: best for combined AI and plagiarism with an API Copyleaks does roughly what Compilatio does, then hands you an API to embed it\[6]\[7]. * **What it does:** AI content detection, which it claims runs over 99% accuracy on its own English testing across 30+ languages against ChatGPT, Gemini, Claude, and others, plus plagiarism detection across 100+ languages, both in a single report\[6]. It also flags AI in images and video\[6]. * **Developer access:** a white-labeled set of APIs, covering AI detection, plagiarism, grammar, and text moderation, with a developer dashboard and documentation\[7]. * **LMS:** Canvas, Moodle, D2L Brightspace, Schoology, Sakai, Edsby, and Blackboard\[6]. * **Best for:** teams that want both detection types and the option to embed them rather than only logging into a dashboard. * **Vs Compilatio:** the same plagiarism-plus-AI coverage, but with a real public API and multimodal detection that Compilatio does not offer. ### 3. GPTZero: best for education-focused AI detection with a low-friction API GPTZero built its name on AI detection for teachers, and made the API easy to try before you commit\[8]. * **What it does:** AI text detection with sentence-level highlights that explain why a passage reads as AI, alongside a plagiarism checker, a grammar checker, and a "Writing Replay" that reconstructs how a document was actually written\[8]. * **Languages:** full support for English, German, Portuguese, French, and Spanish, with use reported across 100+ countries\[8]. * **Developer access:** a public API that takes a POST with an API key and returns a human, mixed, or AI classification with per-sentence detail, plus a Chrome extension and LMS hooks for Canvas and Google Classroom\[8]\[9]. You can run the API straight from the docs without an account for a few calls\[9]. * **Best for:** educators who want classroom-grade AI detection, and developers who want to test a detection API in minutes. * **Vs Compilatio:** stronger and more transparent AI detection with an open API, though its plagiarism side is lighter than Compilatio's source-matching depth. ### 4. Originality.ai: best for web publishers and content teams Originality.ai aims at a different reader than Compilatio. The buyer here is a publisher or an SEO lead, not a teacher\[10]. * **What it does:** a content-integrity suite combining AI detection, plagiarism, fact-checking, readability scoring, and a full-site bulk scan\[10]. It reports 99% accuracy for its Lite model and over 99% for Turbo on recent models, and 97.8% across 30 languages for its multilingual model\[10]. * **Developer access:** an API with scan endpoints and toggles for AI, plagiarism, and fact checks, offered on its top plan\[11]. * **Best for:** agencies and publishers that verify freelance or AI-written content at scale before it goes live. * **Vs Compilatio:** overlapping detection pointed at content operations instead of academic integrity, with fact-checking that Compilatio does not do. ### 5. reAPI: best for AI detection as an API, with a humanizer and essay generator reAPI is a developer platform, not a checker you log into. The caveat first: it does not match text against a plagiarism database, and it has no teacher dashboard or LMS plugin. What it gives you is AI detection as one API call, plus two adjacent text tools on the same key. * **What it does:** the AI text detector scores any text from 0 to 100 for AI authorship and returns per-engine sub-scores, aggregating several detection engines into one result, up to 30,000 words a call. The same key reaches a humanizer that rewrites AI-sounding text to read more human, and an essay generator that drafts from a topic. * **Developer access:** REST endpoints under one base URL and a bearer key, with an async submit-and-poll pattern. Detection, humanization, and essay generation are three calls against the same account. * **Best for:** developers building AI detection, or a writing tool, into their own product, who want an endpoint rather than a dashboard. * **Vs Compilatio:** opposite ends of the same space. Compilatio is a closed institutional product that does plagiarism and AI detection. reAPI is an open API that does AI detection and the text tools around it, with no plagiarism matching and no classroom layer. ## Compilatio vs. the alternatives at a glance | Tool | Plagiarism | AI detection | Public API | LMS integration | Languages | Best for | | -------------- | ---------- | -------------------- | --------------------------- | --------------------------------- | -------------------- | ------------------------------------- | | Compilatio | Yes | Yes (tiered by plan) | No (institutional key only) | Moodle, Canvas, Brightspace, more | UI in 6 | Classroom integrity, Europe | | Turnitin | Yes | Yes | No (sales-led) | Top LMS platforms | 170 (similarity) | Institutional integrity at scale | | Copyleaks | Yes (100+) | Yes (30+) | Yes (white-label) | Canvas, Moodle, Brightspace, more | 100+ | Both types, with embedding | | GPTZero | Lighter | Yes | Yes | Canvas, Google Classroom | 5 full | Education AI detection plus easy API | | Originality.ai | Yes | Yes (30) | Yes (top plan) | None listed | 30 | Publishers and SEO teams | | reAPI | No | Yes (0–100 score) | Yes | No | Multilingual rewrite | Developer detection plus text toolkit | Capability claims are from each vendor's official pages as of June 2026; features change, so confirm before you commit. ## The split that actually decides it Two questions sort this list faster than any feature table. First, do you need plagiarism, AI detection, or both? Compilatio, Turnitin, Copyleaks, and Originality.ai all match text against real sources. GPTZero's plagiarism is lighter, and reAPI does not do source matching at all. If catching copied passages is the point, those two come off the shortlist. Second, do you want to log in or to call an endpoint? Compilatio and Turnitin are platforms you adopt and run from a dashboard, tied into an LMS. Copyleaks, GPTZero, Originality.ai, and reAPI all let you call detection from your own code, which is what you want the moment detection becomes a feature inside your product rather than a task a teacher does by hand. reAPI takes that one step further by putting the humanizer and the essay generator behind the same key, so the AI-text toolkit is one integration instead of three. ## Calling reAPI's detector Because reAPI is an API rather than a dashboard, wiring it in is a single POST and a poll. Submit returns a task id; you poll the task until it completes, and the score comes back as `output.detection.result` on a 0–100 scale. ```python import requests resp = requests.post( "https://reapi.ai/api/v1/detect", headers={"Authorization": "Bearer rk_live_YOUR_REAPI_KEY"}, json={ "model": "ai-text-detector", "text": "Paste the passage you want to score for AI authorship here.", }, ) task = resp.json() # poll GET /api/v1/tasks/{id} until status == "completed" ``` The same base URL and key reach `/v1/humanize` to rewrite AI-sounding text and `/v1/essay` to draft from a topic, so a detect-then-rewrite loop is two calls on one account. Since detection bills on the text you submit and nothing else, the low-risk move is to run a real batch through it and see whether the scores match your own read before you build on it. ## FAQ ### Does Compilatio have an API? Not a public, self-serve one. Compilatio exposes an integration key for institutional LMS connections, but there is no developer endpoint with open documentation you can sign up for and call on your own\[3]. If an API is a hard requirement, Copyleaks, GPTZero, Originality.ai, or reAPI are the alternatives that have one\[7]\[9]\[11]. ### Which Compilatio alternative is best for plagiarism? Turnitin and Copyleaks have the deepest source matching, Turnitin across 170 languages against a very large academic database, Copyleaks across 100+ languages\[4]\[6]. If plagiarism is the real need, those two beat the AI-first tools. ### Does Compilatio detect AI text, not just copied text? Yes, on Magister+, Studium, and the Copyright product, where it flags passages likely written by ChatGPT, Gemini, Claude, and similar models\[1]\[2]. The base Magister plan checks similarity only, so AI detection depends on which plan you hold. ### Is reAPI a plagiarism checker? No. reAPI detects AI-generated text and offers a humanizer and an essay generator, but it does not compare your text against a database of sources. For plagiarism, use Compilatio, Turnitin, or Copyleaks. ### Which Compilatio alternative handles non-English text best? Copyleaks covers 100+ languages for plagiarism and 30+ for AI detection, Turnitin compares similarity across 170 languages, and Originality.ai reports 30 languages for its multilingual AI model\[6]\[4]\[10]. GPTZero fully supports five\[8]. ### Can students self-check the way Compilatio Studium allows? GPTZero and Originality.ai both let an individual scan their own writing, and Copyleaks sells individual plans alongside its institutional ones\[8]\[10]. Compilatio's own answer to this is Studium\[2]. ### Which alternative should a developer pick? If you want detection you can embed, GPTZero has the lowest-friction API and Copyleaks the widest API surface\[7]\[9]. reAPI is the pick when you want AI detection plus a humanizer and an essay generator under one key rather than only a detector. ## Picking the right Compilatio alternative Compilatio does a specific job well: plagiarism and AI detection for European schools, run from a teacher's dashboard and wired into an LMS. The case for a Compilatio alternative is almost always one of the specifics. Turnitin if you want the institutional standard at a larger scale, Copyleaks if you want both detection types with an API, GPTZero if you want transparent AI detection that is easy to drop in, and Originality.ai if you are a publisher checking content rather than grading students. If what you actually need is AI detection as an endpoint, with a humanizer and an essay generator on the same key, reAPI is the Compilatio alternative built for developers rather than classrooms, with the honest caveat that it does not match text against sources. Run a real sample through two of them and trust the scores and coverage you can see for yourself. ## Further reading * [reapi.ai/docs/ai-text-detector](/docs/ai-text-detector) scores any text 0–100 for AI authorship. * [reapi.ai/docs/humanize](/docs/humanize) rewrites AI-sounding text to read human. * [reapi.ai/models](/models) lists the full model catalog behind one key. ## References 1. Compilatio. *Plagiarism and AI content detection — product overview.* Retrieved June 2026 from [compilatio.net/en](https://www.compilatio.net/en) 2. Compilatio. *Magister, Magister+, and Studium — plans for teachers and students.* Retrieved June 2026 from [compilatio.net/en/magister-plus](https://www.compilatio.net/en/magister-plus) 3. Compilatio. *LMS integration — connecting via an identification key per instance.* Retrieved June 2026 from [compilatio.net/en/lms-integration](https://www.compilatio.net/en/lms-integration) 4. Turnitin. *AI writing detection and Similarity products.* Retrieved June 2026 from [turnitin.com/solutions/topics/ai-writing](https://www.turnitin.com/solutions/topics/ai-writing/) 5. Turnitin. *Understanding false positives in AI writing detection.* Retrieved June 2026 from [turnitin.com/blog](https://www.turnitin.com/blog/understanding-false-positives-within-our-ai-writing-detection-capabilities) 6. Copyleaks. *AI content detector — accuracy, languages, and plagiarism.* Retrieved June 2026 from [copyleaks.com/ai-content-detector](https://copyleaks.com/ai-content-detector) 7. Copyleaks. *APIs — AI detection, plagiarism, grammar, and moderation.* Retrieved June 2026 from [copyleaks.com/api](https://copyleaks.com/api) 8. GPTZero. *AI detector — features, languages, and integrations.* Retrieved June 2026 from [gptzero.me](https://gptzero.me/) 9. GPTZero. *Developers — API reference and quickstart.* Retrieved June 2026 from [gptzero.me/developers](https://gptzero.me/developers) 10. Originality.ai. *Content integrity suite — AI detection, plagiarism, and fact-checking.* Retrieved June 2026 from [originality.ai](https://originality.ai/) 11. Originality.ai. *API v2 documentation.* Retrieved June 2026 from [docs.originality.ai/api-v2-0-new](https://docs.originality.ai/api-v2-0-new) 12. Compilatio. *Who we are — company, certification, and reach.* Retrieved June 2026 from [compilatio.net/en/who-are-we](https://www.compilatio.net/en/who-are-we) --- # Best fal.ai Alternatives in 2026: 5 Options Compared (https://reapi.ai/blog/best-fal-ai-alternatives) fal.ai built its reputation on speed. Its serverless platform runs 1,000+ generative media models for image, video, audio, and 3D, and it returns results fast enough that teams ship real-time features on top of it\[2]. But raw inference speed is not the only thing that decides a stack. Most teams shopping for **fal.ai alternatives** in 2026 want one of a few things fal.ai does not hand them: a single API that also covers text and reasoning models, more predictable per-call pricing, a free balance to test with, or a drop-in that speaks the OpenAI format their code already uses. This guide compares five fal.ai alternatives on the things that actually move a decision: model range, pricing model, integration effort, and where each one beats fal.ai. Four are independent platforms. The fifth is reAPI, which we build. Every price and capability below was pulled from each vendor's own pricing page or docs on May 30, 2026. ## TL;DR * **fal.ai** is the media speed leader: 1,000+ models, output-based pricing (for example Veo 3 at $0.4/second, FLUX Kontext Pro at $0.04/image), prepaid credits, no OpenAI-compatible endpoint\[1]\[2]. * **Replicate** wins on breadth: thousands of community models, per-second hardware billing (A100 80GB at $5.04/hour) plus per-output models, and Cog for custom deploys\[3]. * **Together AI** is the open-LLM pick: 176 models, per-token serverless, and a real OpenAI-compatible API, but no free trial and a $5 minimum\[5]\[6]. * **RunPod** and **Hugging Face** are infrastructure, not managed media APIs: you rent GPUs (RunPod H100 from $1.99/hour) or deploy Hub models on dedicated instances (Hugging Face A100 at $2.50/hour)\[7]\[8]. * **reAPI** is the unified option: 200+ image, video, audio, and chat models behind one key, pay-as-you-go credits with no subscription, and an OpenAI-compatible surface for text. ## What fal.ai does well, and where it leaves gaps fal.ai is a generative media specialist, and it is good at it. The platform is tuned for diffusion and video workloads, and the docs lead with reliability numbers rather than marketing copy. Where it is strong: * **Model depth in media.** 1,000+ optimized endpoints across image, video, audio, music, speech, and 3D\[2]. * **Speed and uptime.** fal.ai bills itself as the fastest inference for generative media and cites 99.99% historical uptime\[2]. * **Pay only for successful output.** Server errors and queue time are not billed; you pay per image, per megapixel, or per second of video\[1]. * **SDKs in five languages.** JavaScript, Python, Swift, Kotlin/Java, and Dart, with a queue API, webhooks, streaming, and WebSockets\[2]. Where teams hit walls: * **It stops at media.** There is no frontier LLM layer. If your app mixes generation with chat, reasoning, or coding models, fal.ai is half the stack. * **No OpenAI-compatible endpoint.** fal.ai uses its own SDKs and `fal-ai/` paths, so existing OpenAI code does not drop in\[2]. * **Prepaid only.** fal.ai runs a prepaid credit model with no documented free trial, so you fund the account before the first call\[2]. * **Per-output cost adds up.** Output pricing is clean until volume climbs; at scale a high-throughput consumer app can pay more than it would on hourly compute. ## How to evaluate a fal.ai alternative Five questions sort the field fast: * **Catalog scope.** Media only, or text plus media under one key? * **Pricing model.** Per-output, per-token, per-second compute, or hourly hardware. Each one favors a different workload shape. * **API compatibility.** Does it speak the OpenAI format, or do you rewrite your client? * **Billing entry.** Is there a free balance, or a prepaid minimum before you can test? * **Managed vs. raw.** A ready model API, or GPUs you deploy to yourself. ## The best fal.ai alternatives in 2026 ### 1. Replicate: best for community models and custom deploys Replicate hosts thousands of community-contributed models plus proprietary ones, which makes it the widest catalog of the group\[3]. * **Features:** Per-second hardware inference, per-output models, fine-tuning, webhooks, and Cog for packaging your own models. SDKs for Python, Node, Go, and Swift\[3]\[4]. * **Pricing:** Two modes. Hardware per-second, for example Nvidia A100 80GB at $5.04/hour, H100 at $5.49/hour, T4 at $0.81/hour. Or per-output, for example FLUX 1.1 Pro at $0.04/image and Wan 2.1 i2v 720p at $0.25/second of video\[3]. * **Performance:** Reliable and flexible, but fal.ai is generally faster on its curated media models. * **Best for:** Teams that need variety beyond media, want to deploy a custom model, or experiment with community research models. * **Vs fal.ai:** Replicate wins on selection and custom deploys; fal.ai wins on raw speed for popular media models. ### 2. Together AI: best for open-source LLM inference Together AI is the open-model pick. Its catalog lists 176 models, weighted toward open LLMs with image, vision, audio, and code alongside\[6]. * **Features:** Per-token serverless, dedicated GPU endpoints, fine-tuning (LoRA, full, vision-language), and a genuinely OpenAI-compatible API at `https://api.together.ai/v1`\[6]. * **Pricing:** Per-token, for example Llama 3.3 70B at $0.88 per million tokens in and out, and gpt-oss-20B at $0.05 in / $0.20 out. Dedicated H100 runs $6.49/hour. FLUX images start around $0.0027/megapixel\[5]. * **Performance:** Strong for text and multimodal LLM workloads with research-backed inference tuning. * **Best for:** Open-source-first stacks that lean on chat, vision, and reasoning more than pure media. * **Vs fal.ai:** Together AI is better for LLM-heavy apps and OpenAI compatibility; fal.ai is better for media speed. Note Together has no free trial and requires a $5 minimum to start\[6]. ### 3. RunPod: best for raw GPU control and price RunPod rents GPUs by the second with minimal abstraction. It is the cheapest path if you want to run your own containers\[7]. * **Features:** On-demand GPU pods, serverless workers that scale to zero, 30+ regions, and bring-your-own-container deploys. A separate Public Endpoints line offers some pre-deployed models\[7]. * **Pricing:** Per-second, with no ingress or egress fees. H100 PCIe from $1.99/hour, A100 80GB from $1.19/hour, RTX 4090 from $0.34/hour. Serverless H100 PRO runs $0.00116/second\[7]. * **Performance:** Full control means you can squeeze custom optimizations, but you own the setup. * **Best for:** Cost-sensitive teams comfortable packaging and operating their own model containers. * **Vs fal.ai:** RunPod is cheaper for infrastructure-heavy work; fal.ai is a managed API you call, not a server you run. They solve different problems. ### 4. Hugging Face Inference Endpoints: best for dedicated Hub deploys Hugging Face lets you deploy any model from its Hub onto dedicated, autoscaling instances billed by the minute\[8]. * **Features:** Dedicated and autoscaling instances with scale-to-zero, plus a separate serverless Inference Providers route that passes through provider cost directly\[8]\[9]. * **Pricing:** Dedicated endpoints start at $0.033/hour for CPU; GPU runs T4 at $0.50/hour, L4 at $0.80/hour, A100 80GB at $2.50/hour. Billing is per-minute even though rates are quoted hourly\[8]. * **Performance:** Solid for steady traffic. Scale-to-zero saves money but reintroduces a cold start when an idle endpoint wakes\[8]. * **Best for:** Researchers and teams that want Hub integration plus dedicated infrastructure they control. * **Vs fal.ai:** More model choice and control; fal.ai is faster out of the box for its curated media set with no instance to manage. ### 5. reAPI: best for one key across media and LLMs reAPI is the unified option. One account gives you 200+ models spanning image, video, audio, and chat, behind a single key and a single credit balance, with 20-50% savings versus the providers' official rates. * **Features:** Curated frontier media models (Veo 3.1, Seedance 2.0, Wan 2.7, Kling, HappyHorse 1.0, Imagen 4, Seedream 5.0, GPT-Image-2, Gemini 3 Pro Image) alongside frontier LLMs (GPT-5, Claude Opus 4.8, Gemini). Chat is OpenAI-compatible; image and video run on REST endpoints under the same base URL and key. * **Pricing:** Pay-as-you-go credits at 1 credit = $0.001, no subscription and no prepaid minimum. Real listed rates: GPT-Image-2 from $0.0066/image, Seedance 2.0 from $0.0506/video, Veo 3.1 Fast from $0.207/generation. New accounts start with free credits. * **Performance:** Same upstream frontier models, so generation quality matches the source; the win is consolidation, not a different engine. * **Best for:** Teams that want media generation and LLM calls under one key, one balance, and one invoice. * **Vs fal.ai:** reAPI covers both media and text where fal.ai stops at media, adds an OpenAI-compatible path, and gives you a free balance to start instead of prepaid-only credits. ## fal.ai vs. the top alternatives at a glance | Platform | Catalog | Modalities | Pricing model | OpenAI-compatible | Best for | | ------------ | --------------------- | -------------------------- | --------------------------------- | ----------------- | ------------------------- | | fal.ai | 1,000+ media models | Image, video, audio, 3D | Per-output + prepaid credits | No | Pure media speed | | Replicate | Thousands (community) | Image, video, some LLMs | Per-second hardware or per-output | No | Community + custom models | | Together AI | 176 models | Chat, vision, image, audio | Per-token + dedicated GPU/hour | Yes | Open-source LLMs | | RunPod | Bring your own | Anything you deploy | Per-second GPU + serverless | Partial | Raw GPU control | | Hugging Face | Hub models | Anything you deploy | Per-minute instance | No | Dedicated Hub deploys | | reAPI | 200+ models | Image, video, audio, chat | Pay-as-you-go credits | Yes (chat) | One key for media + LLMs | Catalog and pricing figures are from each vendor's official pages as of May 2026; rates change, so confirm current numbers before you commit. ## What the numbers say about pricing The platforms do not price the same way, which is why a flat "cheaper" claim is usually noise. Match the pricing model to your workload instead. * **fal.ai** charges per output: roughly $0.05 to $0.4 per second for video and around $0.025 to $0.04 per image, with GPU compute as a fallback (H100 at $1.89/hour)\[1]. Clean for bursty media, but it scales linearly with volume. * **Replicate** is hardware per-second for most models, so an idle-free batch job is cheap and a slow cold model is not\[3]. * **Together AI** is per-token, which is ideal for chat and useless as a comparison point for a 5-second video\[5]. * **RunPod** and **Hugging Face** bill for compute time, not output, so utilization is the whole game; an under-loaded endpoint burns money while it waits\[7]\[8]. * **reAPI** lists flat per-output rates and runs on a single prepaid-free credit balance, so a GPT-Image-2 render is $0.0066 whether you send one or ten thousand, and the same balance covers a Claude or GPT-5 call. The honest summary: fal.ai is competitive for pure media, and reAPI's edge shows up when one balance has to cover both media and text without juggling two prepaid accounts. ## Moving from fal.ai to reAPI reAPI does not replace fal.ai's engine; it consolidates how you buy and call models. Three things change for a team coming from fal.ai. First, the LLM layer arrives. Chat, reasoning, and coding models sit next to your image and video calls instead of in a second vendor account. Second, billing simplifies to one pay-as-you-go balance at 1 credit = $0.001, with free credits to start and no $5 floor before the first request. Third, text calls are a drop-in for OpenAI code. Point the base URL at reAPI and reuse your existing client: ```python from openai import OpenAI client = OpenAI( base_url="https://api.reapi.ai/v1", api_key="YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Summarize this release."}], ) ``` Image and video run on REST endpoints under the same base URL and key, so a hybrid setup is normal early on: keep fal.ai where its latency matters, route everything else through reAPI, and collapse to one provider once the numbers line up. ## FAQ ### Is fal.ai still worth using in 2026? Yes, for pure generative media where its low-latency engine is the point. The reason to add a fal.ai alternative is scope: a unified API for text plus media, a free balance to test with, or OpenAI compatibility. fal.ai gives you none of those, by design\[2]. ### Which fal.ai alternative is cheapest? It depends on the workload. RunPod is cheapest for raw GPU time, Together AI for open LLM tokens, and per-output media pricing on fal.ai or reAPI is cheapest when utilization on a rented GPU would be low\[5]\[7]. Pick the pricing model that matches your traffic before you compare headline rates. ### Does any fal.ai alternative support both image, video, and LLMs? reAPI and Replicate both span media and language models. reAPI adds an OpenAI-compatible surface for chat and a single prepaid-free credit balance across all of them; Replicate keeps everything per-model on community infrastructure\[3]. ### Is reAPI a drop-in replacement for fal.ai? For text, yes: change the base URL and key and your OpenAI client works. For media, you call reAPI's REST image and video endpoints rather than `fal-ai/` paths, so the calls are similar in shape but not identical, which is why hybrid setups are common during migration. ### Which fal.ai alternatives have a free tier? Hugging Face gives free serverless inference credits ($0.10/month free, $2/month on PRO), and reAPI starts new accounts with free credits\[9]. fal.ai, Together AI, and Replicate are prepaid; Together requires a $5 minimum\[6]. ### Do RunPod and Hugging Face compete with fal.ai directly? Not really. fal.ai is a managed model API you call; RunPod rents raw GPUs and Hugging Face Endpoints deploys Hub models onto instances you scale yourself\[7]\[8]. They are alternatives only if you are willing to operate infrastructure. ## Choosing a fal.ai alternative fal.ai is still excellent at the one thing it set out to do: fast generative media. The case for a fal.ai alternative is almost never speed, and almost always scope or cost structure. If you operate your own infrastructure, RunPod and Hugging Face are cheaper per GPU-hour. If you live in open LLMs, Together AI fits. If you want the widest community catalog, Replicate does. And if you want image, video, audio, and frontier LLMs behind one key, one pay-as-you-go balance, and an OpenAI-compatible path, reAPI is the fal.ai alternative built for that shape. Test two of them with small pilots and let your own traffic pick the winner. ## Further reading * [reapi.ai/models](/models) — browse image, video, audio, and chat models behind one key. * [What is reAPI?](/blog/what-is-reapi) — quickstart, pricing, and how the API works. * [Best Replicate alternatives](/blog/best-replicate-alternatives) — the same comparison for Replicate. ## References 1. fal.ai. *Pricing — per-model rates for image and video.* Retrieved May 2026 from fal.ai/pricing 2. fal.ai. *Documentation — platform overview, model APIs, and SDKs.* Retrieved May 2026 from fal.ai/docs 3. Replicate. *Pricing — hardware and per-output model rates.* Retrieved May 2026 from replicate.com/pricing 4. Replicate. *Billing and client libraries.* Retrieved May 2026 from replicate.com/docs/topics/billing 5. Together AI. *Pricing — serverless tokens, dedicated GPUs, and image models.* Retrieved May 2026 from together.ai/pricing 6. Together AI. *OpenAI compatibility and model catalog.* Retrieved May 2026 from docs.together.ai/docs/inference/openai-compatibility 7. RunPod. *Pricing — GPU cloud and serverless rates.* Retrieved May 2026 from runpod.io/pricing 8. Hugging Face. *Pricing — Inference Endpoints instance rates.* Retrieved May 2026 from [huggingface.co/pricing](https://huggingface.co/pricing) 9. Hugging Face. *Inference Providers pricing and free credits.* Retrieved May 2026 from [huggingface.co/docs/inference-providers/pricing](https://huggingface.co/docs/inference-providers/pricing) --- # Best Higgsfield Alternatives for AI Video Creators and APIs (https://reapi.ai/blog/best-higgsfield-alternatives-ai-video) **reAPI is the best Higgsfield alternative for a SaaS team that wants to put selected image and video models behind its own product interface. Atlas Cloud is stronger when maximum catalog breadth or GPU infrastructure is the requirement; Krea is closer to Higgsfield's hands-on creator workflow; Dreamina is the official route to monitor for Seedance rollout.** Higgsfield bundles models with creator tools, subscriptions, and promotional workflows. No alternative replaces all three layers equally. This guide compares platforms by the job they perform instead of pretending that six different billing models are interchangeable. ## TL;DR * **reAPI:** best for SaaS and product teams that want one account, pay-as-you-go credits, live model pages, and a consistent asynchronous media workflow. * **Atlas Cloud:** best API-first alternative when a broad catalog and GPU infrastructure are the deciding requirements. * **fal:** best for serverless developer access with explicit model-level prices. * **Replicate:** best for familiar client libraries, model pages, examples, and rapid prototyping. * **Krea:** best for creators who want a visual workspace and subscription compute instead of raw endpoints. * **Dreamina:** best official ByteDance creator surface to monitor for Seedance 2.5 rollout. ## Best Higgsfield alternatives compared ![A platform map comparing Atlas Cloud, reAPI, fal, Replicate, Krea, and Dreamina by studio versus API and subscription versus pay-as-you-go](https://cdn.reapi.ai/media/blog/best-higgsfield-alternatives-ai-video/best-higgsfield-alternatives-ai-video-platform-map.png) | Platform | Primary user | Interface | Billing shape | Seedance status | | ----------- | -------------------------- | ---------------------- | ------------------------ | ---------------------------------- | | reAPI | Product developers | Unified API | Pay as you go | 2.0 available | | Atlas Cloud | Developer teams | APIs and model catalog | Pay as you go | 2.0 live; 2.5 early-access page | | fal | AI application developers | Serverless APIs | Model-level usage | 2.0 available | | Replicate | Developers and prototypers | Hosted models and SDKs | Per-output usage | 2.0 available | | Krea | Designers and creators | Browser workspace | Subscription compute | 2.0 listed; 2.5 marked soon | | Dreamina | Consumer creators | Browser editor | Product/region dependent | Official 2.5 page says coming soon | This article is published by reAPI, which operates one of the compared gateways. The recommendations use public product pages and state that relationship so you can weigh the comparison appropriately. ## Why creators look for a Higgsfield alternative Higgsfield is compelling because it connects generation with creator-facing features such as reusable identity, camera-oriented presets, advertising formats, and a model picker. It packages those tools into subscription tiers and credits, with exact offers varying by plan, promotion, and region.\[1] That package becomes a mismatch when you need one of four things: 1. an API instead of a visual interface; 2. metered usage instead of monthly credits; 3. a particular model that is not in the current picker; 4. a neutral backend that can switch providers without rebuilding the product. The correct alternative depends on which mismatch you are solving. ## 1. reAPI: best for a SaaS product reAPI provides asynchronous media jobs and live model pages across a curated multi-model catalog. A product team can reuse one credential, credit balance, task status pattern, and error model while keeping the selected model configurable. Choose reAPI when you are building a SaaS product rather than producing clips manually. It does not replace Higgsfield's creator presets or visual project workspace. It replaces the model-integration layer beneath your own interface, with callable options such as [Seedance 2.0](/models/seedance-2-0) and [MiniMax H3](/models/minimax-h3) available now. Because reAPI publishes this article, confirm current availability and pricing on each [live model page](/models) and compare the exact workload with direct providers before committing volume. ## 2. Atlas Cloud: best for catalog breadth and infrastructure Atlas Cloud markets a catalog of more than 400 models behind one account and pay-as-you-go access. It documents an asynchronous Seedance 2.0 image-to-video endpoint and combines its model catalog with broader GPU and infrastructure services.\[2] Its Seedance 2.5 page is an early-access promise, not proof of a callable 2.5 endpoint. Developers can use Atlas Cloud for Seedance 2.0 now and join the 2.5 cohort, but should not hard-code a speculative model identifier. Choose Atlas Cloud when API breadth or GPU infrastructure matters more than a focused product integration. Choose Higgsfield when a creator needs a polished web studio. The direct [Atlas Cloud vs Higgsfield vs reAPI comparison](/blog/atlas-cloud-vs-higgsfield) covers those operational differences. ## 3. fal: best for serverless model endpoints fal exposes individual generative models through hosted endpoints and publishes model-specific prices. Its Seedance 2.0 page, for example, gives separate per-second rates for output mode and resolution, which makes small workload estimates direct.\[3] fal fits developers who want a broad inference platform and are comfortable integrating each model's schema. It is less comparable to Higgsfield for nontechnical creators because the value sits in infrastructure rather than a guided production studio. If provider depth is the deciding issue, read the [best fal alternatives](/blog/best-fal-ai-alternatives) before selecting a gateway. ## 4. Replicate: best for rapid prototypes and documented models Replicate pairs hosted models with web demos, API examples, client libraries, and observable version pages. Its official Seedance 2.0 listing exposes the model as an API and bills by generated output.\[4] Choose Replicate when a developer wants to test a model from a browser and move quickly into code. For high-volume production, compare cold starts, version behavior, support, and actual output cost rather than using public run counts as a quality score. Our [Replicate alternatives guide](/blog/best-replicate-alternatives) goes deeper on provider choice. ## 5. Krea: best visual workspace alternative Krea is the most direct option in this list for creators who still want a browser-based environment. It combines image and video tools, a model catalog, and subscription compute units. Its models page currently lists Seedance 2.0 while marking Seedance 2.5 as “Soon.”\[5] Choose Krea when visual iteration and access to multiple creative tools matter more than raw API control. Subscription compute is not directly comparable to Higgsfield credits: resolution, model, and mode can consume allowances differently. Test the exact workflow before comparing headline monthly prices. ## 6. Dreamina: best official ByteDance creator route Dreamina is relevant because it is ByteDance's creator-facing product, not because it currently guarantees Seedance 2.5 to every account. Its official 2.5 page says “coming soon,” and the access guide tells users to sign in and check account-level rollout.\[6] Choose Dreamina when official Seedance access is the main objective and API automation is not required. Choose Higgsfield or Krea when the surrounding creator workflow matters more than first-party model provenance. ## Higgsfield alternative by use case | If you need… | Start with… | Why | | ---------------------------------- | ----------- | ---------------------------------------------------------- | | A normalized backend for your SaaS | reAPI | Consistent task and billing surface across selected models | | A visual multi-model studio | Krea | Closest creator-first working style | | A broad video API catalog | Atlas Cloud | API-first model discovery and usage billing | | Transparent endpoint-level prices | fal | Public per-model pricing | | Quick browser-to-code prototyping | Replicate | Demo, examples, and SDK path | | Official Seedance creator rollout | Dreamina | ByteDance-owned consumer surface | | Character and marketing presets | Higgsfield | Staying may be better than switching | The last row is important. An alternatives article should not manufacture a reason to migrate. If Higgsfield's studio saves more editing time than another platform saves in generation cost, it remains the better tool. ## How to compare the real cost A $29 subscription and a $0.30-per-second endpoint are different purchasing units. Use one monthly workload: * number of final clips; * average duration and resolution; * average rerenders per accepted clip; * creator time spent outside the generator; * storage, moderation, and delivery costs; * unused subscription credits at month end. Calculate cost per accepted deliverable, not cost per attempted generation. A more expensive model that halves rerolls can be cheaper. A polished studio that removes two manual tools can outperform the lowest endpoint price. ## FAQ ### What is the best free Higgsfield alternative? Free allowances change frequently. Krea and some developer platforms may offer trial capacity, but free tiers usually have queues, watermarks, model limits, or noncommercial restrictions. Verify the current plan before publishing client work. ### Is Atlas Cloud better than Higgsfield? Atlas Cloud is better for API-first applications and metered multi-model access. Higgsfield is better for creators who want a visual studio, presets, and subscription workflow. ### Which Higgsfield alternative supports Seedance? Atlas Cloud, reAPI, fal, and Replicate expose Seedance 2.0. Krea lists 2.0 in its creator catalog. Dreamina is the official consumer route to monitor for 2.5 rollout. ### Does Higgsfield have Seedance 2.5? Higgsfield now has a Seedance 2.5 coming-soon notification page, but that is not a callable model or a published price. See the current [Seedance 2.5 on Higgsfield status](/blog/seedance-2-5-on-higgsfield). ### Which alternative is best for a SaaS product? Start with [reAPI's live model catalog](/models) when you want a focused multi-model backend and one asynchronous media workflow. Choose Atlas Cloud instead when maximum breadth or GPU infrastructure is a hard requirement, fal for a specific optimized endpoint, or Replicate for community-model breadth and rapid prototyping. ## Choose the layer first Higgsfield is a creator studio. reAPI, Atlas Cloud, fal, and Replicate are primarily developer infrastructure. Krea is a creator workspace, and Dreamina is an official model surface. Decide which layer you need before comparing prices; otherwise the cheapest option may require you to rebuild the feature that made Higgsfield useful. If the missing layer is an API beneath your own product, start with a real prompt set on [reAPI](/models), then keep only the provider that performs best on accepted-output cost. ## References 1. Higgsfield. *AI pricing and plans.* Retrieved August 2, 2026. geo.higgsfield.ai 2. Atlas Cloud. *Seedance 2.0 image-to-video API and model catalog.* Retrieved August 2, 2026. atlascloud.ai 3. fal. *ByteDance Seedance 2.0 text-to-video API.* Retrieved August 2, 2026. fal.ai 4. Replicate. *ByteDance Seedance 2.0 API.* Retrieved August 2, 2026. replicate.com 5. Krea. *AI model catalog and pricing.* Retrieved August 2, 2026. krea.ai 6. Dreamina. *Seedance 2.5 generator and access guide.* Retrieved August 2, 2026. [dreamina.capcut.com](https://dreamina.capcut.com/seedance/seedance-2-5) ### Further reading * reAPI. *Atlas Cloud vs Higgsfield.* [reapi.ai/blog/atlas-cloud-vs-higgsfield](/blog/atlas-cloud-vs-higgsfield) * reAPI. *Best Seedance 2.5 alternatives.* [reapi.ai/blog/best-seedance-2-5-alternatives](/blog/best-seedance-2-5-alternatives) * reAPI. *Seedance 2.5 release status.* [reapi.ai/blog/seedance-2-5-release-status](/blog/seedance-2-5-release-status) --- # Best Open-Source AI Video Models for Local GPUs (2026) (https://reapi.ai/blog/best-open-source-ai-video-models-local-gpu-2026) **Wan 2.2 TI2V-5B is the best all-round local AI video model for a 24GB GPU. HunyuanVideo-1.5 is the stronger starting point at 14–16GB, while CogVideoX1.5-5B is the most realistic experiment below that. Mochi 1 remains interesting for its Apache-2.0 license and hackable pipeline, but its memory use and 480p output make it a specialist choice rather than the default.** That answer comes with an important caveat: a published minimum VRAM number usually assumes CPU offloading, tiling, lower precision, or all three. It tells you that a workflow can fit. It does not tell you that the workflow will be fast enough to use every day. This comparison uses the projects' official model cards and repositories, checked on July 30, 2026. The term “open-source AI video model” is used because that is how people search for these models. “Open-weight” is often more precise, especially when a model uses a custom community license. ## Best local AI video models at a glance | Model | Published local VRAM path | Video output | License | Best fit | | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | --------------------------------- | --------------------------------------------------- | | Wan 2.2 TI2V-5B | At least 24GB with CPU offloading\[1] | 720p-class, 24fps; text-to-video and image-to-video | Apache-2.0 | Best balance for a single 24GB workstation | | HunyuanVideo-1.5 | 14GB minimum with model offloading\[2] | 480p/720p T2V and I2V, plus a super-resolution path | Tencent Hunyuan Community License | Best documented option for a 14–16GB CUDA GPU | | CogVideoX1.5-5B | Diffusers BF16 from 10GB; INT8 from 7GB\[3] | 1360×768, 5 or 10 seconds | CogVideoX License | Low-VRAM testing when slow generation is acceptable | | Mochi 1 preview | 22GB for the lower-precision Diffusers example; about 60GB for the reference single-GPU repository\[4] | Initial release targets 480p text-to-video | Apache-2.0 | Research, LoRA work, and permissive licensing | These rows are not benchmark-equivalent. CogVideoX's smallest figure uses a different precision and memory strategy from Wan's documented 24GB command. Mochi's 22GB example explicitly accepts a small quality drop. Treat the numbers as deployment routes, not as a quality ranking. ## What your GPU can realistically run ### 8GB VRAM: a technical test, not a comfortable workstation CogVideoX1.5-5B is the only model in this group whose publisher documents an INT8 Diffusers path starting around 7GB. The same model card warns that quantization and sequential CPU offload reduce speed. Its low-memory testing was performed on A100/H100 hardware, although the authors say the approach should generally work on NVIDIA Ampere or newer cards\[3]. An 8GB card may therefore prove that the model runs, but it leaves little room for the display, decoder, longer clips, or another process. Expect dependency tuning and a large system-RAM footprint. For regular production, a hosted job or a larger GPU is usually less frustrating. ### 10–12GB VRAM: CogVideoX becomes usable for patient experiments CogVideoX1.5-5B's optimized BF16 Diffusers path starts around 10GB. This is a better first test than INT8 if the card can hold it. The trade-off is time: the publisher's own 50-step results for a five-second clip are measured in hundreds of seconds even on an H100, and longer on an A100\[3]. Those are not consumer-GPU predictions, but they make the bottleneck clear. CogVideoX also expects English prompts. Teams accepting prompts in other languages need a translation or prompt-rewriting step before inference. ### 14–16GB VRAM: HunyuanVideo-1.5 is the practical step up Tencent publishes a 14GB minimum with model offloading enabled. The official source path targets Linux, Python 3.10 or newer, and an NVIDIA CUDA GPU\[2]. That is a much firmer starting point than an unofficial community claim that a large video model “works on 12GB.” HunyuanVideo-1.5 supports text-to-video and image-to-video checkpoints at 480p and 720p. Its separate super-resolution model can upscale video to 1080p. That last step is extra work; it should not be described as native 1080p generation. The main constraint is legal rather than technical. The Tencent Hunyuan Community License excludes use in the European Union, United Kingdom, and South Korea, includes use restrictions, and requires a separate license for certain products above its stated user threshold\[5]. Read the current license before choosing it for a commercial service. ### 24GB VRAM: the useful local-video tier This is where local generation stops feeling like a memory stunt. Wan 2.2 TI2V-5B has an official single-GPU command for a 24GB RTX 4090-class card. It supports text-to-video and image-to-video in one 5B pipeline and outputs 720p-class video at 24fps\[1]. Wan's model card says the 5B model can generate a five-second 720p video in under nine minutes on a single consumer GPU without special optimization. That is useful for previews and batch work, but it is not interactive editing. Queue design still matters. Mochi 1 can also fit this tier through its 22GB BF16 Diffusers example. Genmo notes a slight quality reduction for that path. With only a small amount of spare VRAM, another application or a different frame count can push the job out of memory\[4]. Choose Mochi here for its research value and license, not because it is the safest 24GB deployment. ### 48–80GB VRAM: fewer compromises, not automatic throughput Mochi's higher-quality Diffusers example requires 42GB, while its reference repository describes about 60GB for single-GPU operation and recommends an H100\[4]. More memory can also reduce offloading for the other models or support more than one worker. It does not remove the compute cost of diffusion. Before buying a larger card, benchmark the number of accepted clips per hour, not the number of prompts submitted. ## Wan 2.2: best overall for a 24GB GPU Wan 2.2 TI2V-5B has the cleanest combination of local practicality and output capability in this group: * official weights and inference code; * a documented single-24GB-GPU path; * text-to-video and image-to-video in the same model; * 720p-class output at 24fps; * an Apache-2.0 license. Be precise about the model name. Wan 2.2 also has larger A14B checkpoints. A tutorial showing TI2V-5B on a 4090 does not prove the larger variants fit the same hardware. Download size, inference arguments, and memory requirements differ. Wan is the sensible first benchmark for an independent creator, research team, or studio with one 4090. Its weakness is latency. A single machine can render a useful batch overnight; it is less convincing as the backend for a product that promises immediate results. ## HunyuanVideo-1.5: best at 14–16GB HunyuanVideo-1.5 packages an 8.3B video model around a surprisingly accessible official minimum. It is the strongest candidate here when the machine cannot reach 24GB but still needs both text-to-video and image-to-video. Its model family is more complicated than one download. Tencent lists separate 480p and 720p checkpoints, distilled variants, and super-resolution weights. Decide which path the product actually needs before provisioning storage or building a container. This model is also the clearest example of why “open” and “permissive” are different questions. The weights and training code are available, but the community license has territory, attribution, distribution, and acceptable-use conditions. Apache-2.0 assumptions do not carry over. ## CogVideoX1.5-5B: best low-VRAM experiment CogVideoX1.5-5B wins the fitting contest. The official table documents 10GB BF16 and 7GB INT8 Diffusers configurations, compared with 76GB for its BF16 SAT route\[3]. That spread shows how much the software path changes the hardware answer. Choose CogVideoX when: * the available GPU has 8–12GB; * generation can run in the background; * prompts can be normalized to English; * the team is comfortable pinning CUDA, PyTorch, Diffusers, and quantization dependencies. Do not choose it solely because “7GB” looks efficient. The INT8 path trades speed for memory, and the model's 5- or 10-second output remains expensive to sample repeatedly. A 12GB installation that completes reliably can be more useful than an 8GB configuration operating at its limit. CogVideoX uses its own license. Review that text for the planned distribution and commercial use instead of treating “downloadable on Hugging Face” as a legal conclusion\[6]. ## Mochi 1: best for permissive research work Mochi 1 is a 10B text-to-video research preview released under Apache-2.0. Genmo publishes the weights, inference code, a programmable pipeline, and a LoRA trainer. That makes it a good base for teams that care about modifying the stack rather than simply producing the highest-resolution clip. Its limitations are unusually well documented. The initial checkpoint targets 480p, is tuned toward photorealism, can show warping under extreme motion, and performs less well on animated styles\[7]. The reference implementation also wants about 60GB of VRAM on one GPU. Diffusers lowers that to 22GB in BF16, but with a stated quality trade-off. Mochi makes sense on a research workstation or multi-GPU server. It is harder to justify for a creator buying a single card specifically for finished 720p output. ## “Runs locally” has four different meanings Model comparisons often collapse four milestones into one: 1. **The process starts.** The weights load with quantization and offloading. 2. **One sample completes.** A short, low-batch job avoids an out-of-memory error. 3. **The workflow is repeatable.** Ten jobs finish without memory fragmentation, driver crashes, or manual cleanup. 4. **The system is useful.** Throughput, accepted-output rate, and operating effort beat the available alternative. Only the fourth milestone supports a production decision. CPU offloading shifts pressure into system RAM and PCIe transfers. Quantization can reduce memory while making inference slower. VAE tiling saves memory but changes the execution profile. A desktop GPU also loses part of its capacity to the display and other applications. Closed hosted models are a separate category: an API or ComfyUI node may expose a familiar model name while all inference happens remotely. For a concrete example of that distinction, see the explanation of [whether Seedance can run locally](/blog/can-you-run-seedance-locally). ## A fair local benchmark takes one afternoon Do not begin with a large prompt library. Use five prompts that expose different failure modes: * a locked camera with one moving subject; * two people interacting; * fast lateral motion; * image-to-video with a face or product that must stay consistent; * a scene containing text, hands, or repeated geometry. Run every model at the resolution, duration, and memory settings you would actually ship. Record: | Metric | Why it matters | | ------------------------------- | ------------------------------------------------------------- | | Peak VRAM | Reveals whether the workflow survives alongside real services | | Peak system RAM | Shows the hidden cost of CPU offloading | | Cold-start time | Matters for serverless workers and restarted queues | | Seconds per clip | Determines capacity, but not quality | | Accepted clips per ten attempts | Captures motion, identity, and prompt failures | | Watt-hours per accepted clip | Makes local operating cost comparable | | Manual interventions | Exposes a brittle pipeline before production | Keep seeds and prompts fixed. If one model needs a prompt rewrite, save that rewrite as part of its pipeline rather than quietly giving it a better prompt during evaluation. ## Before deploying an open-weight video model The checkpoint is only one component. A dependable local service also needs: * enough NVMe space for weights, caches, inputs, and rendered frames; * pinned versions for the NVIDIA driver, CUDA, PyTorch, and attention libraries; * a worker that frees GPU memory after failed jobs; * request limits for duration, resolution, frame count, and batch size; * output moderation and a policy for uploaded faces or copyrighted assets; * model and license notices carried into the product where required; * reproducible benchmark prompts for upgrades. Video diffusion failures are expensive because they arrive late. A worker may spend minutes before returning an out-of-memory error or an unusable clip. Validate inputs and reserve memory before the job enters the generation queue. ## FAQ ### What is the best open-source AI video model for 12GB VRAM? CogVideoX1.5-5B is the clearest documented choice. Its official model card lists an optimized BF16 Diffusers path from 10GB and an INT8 path from 7GB. Both rely on memory-saving techniques and may be slow. ### What is the best local video model for an RTX 4090? Wan 2.2 TI2V-5B is the best starting point in this comparison. The publisher documents a 24GB single-GPU setup, 720p-class output at 24fps, and support for both text-to-video and image-to-video. ### Can HunyuanVideo-1.5 run on 16GB VRAM? Yes, according to Tencent's published 14GB minimum with model offloading. The official setup targets Linux and an NVIDIA CUDA GPU. Available system RAM and storage speed still affect the experience. ### Is Mochi 1 practical on a 24GB GPU? It can fit using the official 22GB BF16 Diffusers example, which notes a slight quality drop. Its reference implementation needs much more memory, and the initial model targets 480p, so Wan 2.2 is usually the more practical 24GB choice. ### Can I use these models commercially? The answer depends on the model. Wan 2.2 TI2V-5B and Mochi 1 use Apache-2.0. HunyuanVideo-1.5 uses Tencent's community license, and CogVideoX1.5 uses the CogVideoX License. Review the current license, acceptable-use rules, territory, and distribution terms for the exact checkpoint. This article is a technical comparison, not legal advice. ### Does minimum VRAM predict generation speed? No. The smallest configurations usually save memory through CPU offloading, tiling, or quantization, all of which can reduce speed. Measure wall-clock time and accepted outputs on the target machine. ## References 1. Wan-AI. *Wan2.2-TI2V-5B model card and official repository.* Weights, Apache-2.0 license, 720p output, 24GB command, and performance guidance. Retrieved July 30, 2026 from [huggingface.co/Wan-AI/Wan2.2-TI2V-5B](https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B) and [github.com/Wan-Video/Wan2.2](https://github.com/Wan-Video/Wan2.2) 2. Tencent. *HunyuanVideo-1.5 model card.* Official 14GB minimum, system requirements, checkpoints, and output paths. Retrieved July 30, 2026 from [huggingface.co/tencent/HunyuanVideo-1.5](https://huggingface.co/tencent/HunyuanVideo-1.5) 3. Z.ai. *CogVideoX1.5-5B model card.* Diffusers and SAT memory figures, quantization trade-offs, duration, and resolution. Retrieved July 30, 2026 from [huggingface.co/zai-org/CogVideoX1.5-5B](https://huggingface.co/zai-org/CogVideoX1.5-5B) 4. Genmo. *Mochi 1 preview model card.* Diffusers memory examples and lower-precision trade-off. Retrieved July 30, 2026 from [huggingface.co/genmo/mochi-1-preview](https://huggingface.co/genmo/mochi-1-preview) 5. Tencent. *Tencent Hunyuan Community License Agreement.* Territory, distribution, commercial, and use terms. Retrieved July 30, 2026 from [HunyuanVideo-1.5 LICENSE](https://huggingface.co/tencent/HunyuanVideo-1.5/blob/main/LICENSE) 6. Z.ai. *CogVideoX License.* License linked from the official model card. Retrieved July 30, 2026 from [CogVideoX1.5-5B LICENSE](https://huggingface.co/zai-org/CogVideoX1.5-5B/blob/main/LICENSE) 7. Genmo. *Mochi repository.* Hardware guidance, Apache-2.0 license, architecture, and documented limitations. Retrieved July 30, 2026 from [github.com/genmoai/mochi](https://github.com/genmoai/mochi) --- # Best Replicate Alternatives in 2026: 5 Options Compared (https://reapi.ai/blog/best-replicate-alternatives) Replicate runs thousands of community-contributed and proprietary models, which makes it one of the widest catalogs you can reach from a single API\[1]. That breadth is also why teams go looking for **Replicate alternatives**. Most models bill per second of compute, so a slow or cold-booting model costs more than you forecast; the community catalog is uneven in quality; and there is no OpenAI-compatible endpoint to drop into code you already wrote. This guide compares five Replicate alternatives on what actually moves a decision: model range, pricing model, integration effort, and where each one beats Replicate. Four are independent platforms. The fifth is reAPI, which we build. Every price and capability below came from each vendor's own pricing page or docs on May 30, 2026. ## TL;DR * **Replicate** has the widest catalog (thousands of models) but bills most models per second of hardware, for example Nvidia A100 80GB at $5.04/hour, which makes per-call cost hard to forecast\[1]. * **fal.ai** is faster and fully managed for media, with output pricing (Veo 3 at $0.4/second, FLUX Kontext Pro at $0.04/image) and no hardware to think about\[3]. * **Together AI** brings a real OpenAI-compatible API and per-token LLM pricing, but no free trial and a $5 minimum\[6]. * **RunPod** is cheaper raw GPU time (H100 from $1.99/hour) and **Hugging Face** deploys Hub models on per-minute instances, both for teams that operate their own serving\[7]\[8]. * **reAPI** gives you predictable flat per-output pricing across 200+ media and LLM models behind one key, billed at a fixed rate per call. ## What Replicate does well, and where it leaves gaps Replicate's pitch is range and openness. You can run almost anything, package your own model, and pay only for what runs. Where it is strong: * **Catalog breadth.** Thousands of community models plus proprietary ones, more added daily\[1]. * **Custom deploys.** Cog, Replicate's open-source packaging tool, lets you ship your own model as an API\[1]. * **Two pricing modes.** Per-second hardware for most models, or per-output for popular ones like FLUX 1.1 Pro at $0.04/image\[1]. * **Failed runs are free.** For official models, a failed run is not billed\[2]. Where teams hit walls: * **Per-second cost is hard to forecast.** When billing follows runtime, a cold or slow model quietly costs more, and you cannot quote a fixed price per call\[1]. * **No OpenAI-compatible endpoint.** Replicate uses its own predictions API, so existing OpenAI code does not drop in. * **Uneven catalog.** Community contributions vary in quality and maintenance; not every model is production-ready. * **Prepaid credit expires.** Purchased credit is prepaid and expires after a year, and private deployments are billed for active time even on failed runs\[2]. ## How to evaluate a Replicate alternative Five questions sort the field: * **Forecastable cost.** Flat per-output, or per-second compute you cannot quote in advance? * **Catalog vs. curation.** Do you want everything, or a vetted production set? * **API compatibility.** OpenAI format, or a bespoke client? * **Custom models.** Do you need to deploy your own, or just call hosted ones? * **Scope.** Media only, or media plus frontier LLMs under one key? ## The best Replicate alternatives in 2026 ### 1. fal.ai: best for media speed fal.ai is the managed media specialist. It runs 1,000+ optimized endpoints and is tuned for low-latency diffusion and video\[4]. * **Features:** Image, video, audio, and 3D models with a queue API, webhooks, streaming, and SDKs in five languages\[4]. * **Pricing:** Output-based, for example Veo 3 at $0.4/second, Kling 2.5 Turbo Pro at $0.07/second, and FLUX Kontext Pro at $0.04/image. Prepaid credits, billed only on successful output\[3]. * **Performance:** fal.ai claims the fastest inference for generative media and cites 99.99% uptime\[4]. * **Best for:** Media-heavy apps that want speed without renting or managing GPUs. * **Vs Replicate:** fal.ai is faster and fully managed for media; Replicate has the wider catalog and lets you deploy custom models with Cog. ### 2. Together AI: best for open-source LLMs Together AI is the open-model pick, with 176 models weighted toward open LLMs\[6]. * **Features:** Per-token serverless, dedicated GPU endpoints, fine-tuning, and an OpenAI-compatible API at `https://api.together.ai/v1`\[6]. * **Pricing:** Per-token, for example Llama 3.3 70B at $0.88 per million in and out, and gpt-oss-20B at $0.05 in / $0.20 out. Dedicated H100 runs $6.49/hour\[5]. * **Performance:** Strong for chat, vision, and reasoning workloads. * **Best for:** Open-source-first stacks that lean on language models. * **Vs Replicate:** Together is OpenAI-compatible and token-priced for LLMs; Replicate spans more media and arbitrary custom models. Together has no free trial and requires a $5 minimum\[6]. ### 3. RunPod: best for raw GPU price RunPod rents GPUs by the second, which undercuts a per-second model API if you are willing to operate the serving yourself\[7]. * **Features:** On-demand GPU pods, serverless workers that scale to zero, 30+ regions, and bring-your-own-container deploys\[7]. * **Pricing:** Per-second with no egress fees. H100 PCIe from $1.99/hour, A100 80GB from $1.19/hour, RTX 4090 from $0.34/hour\[7]. * **Performance:** Full control over the runtime, at the cost of owning the setup. * **Best for:** Cost-sensitive teams comfortable packaging and running their own containers. * **Vs Replicate:** RunPod is cheaper raw infrastructure; Replicate hands you a model API and Cog packaging so you skip the ops. ### 4. Hugging Face Inference Endpoints: best for dedicated Hub deploys Hugging Face deploys any Hub model onto dedicated, autoscaling instances billed by the minute\[8]. * **Features:** Dedicated and autoscaling instances with scale-to-zero, plus a serverless Inference Providers route that passes provider cost through directly\[8]\[9]. * **Pricing:** CPU from $0.033/hour; GPU runs T4 at $0.50/hour, L4 at $0.80/hour, A100 80GB at $2.50/hour, billed per minute\[8]. * **Performance:** Good for steady traffic; scale-to-zero adds a cold start when an idle endpoint wakes\[8]. * **Best for:** Teams already centered on the Hub that want dedicated infrastructure. * **Vs Replicate:** Both deploy custom models; Hugging Face ties to the Hub and instances, Replicate to Cog and a per-second model API. ### 5. reAPI: best for predictable pricing across media and LLMs reAPI is the unified pick with pricing you can quote in advance: 200+ image, video, audio, and chat models behind one key, billed at a flat rate per call, at 20-50% below the providers' official rates. * **Features:** Curated frontier media models (Veo 3.1, Seedance 2.0, Wan 2.7, Kling, HappyHorse 1.0, Imagen 4, Seedream 5.0, GPT-Image-2, Gemini 3 Pro Image) plus frontier LLMs (GPT-5, Claude Opus 4.8, Gemini). Chat is OpenAI-compatible; image and video run on REST endpoints under the same key. * **Pricing:** Flat per-output, so a render costs the same every time: GPT-Image-2 from $0.0066/image, Seedance 2.0 from $0.0506/video, Veo 3.1 Fast from $0.207/generation. Pay-as-you-go credits at 1 credit = $0.001, no subscription, free credits to start. * **Performance:** Same upstream frontier models, so quality matches the source; the win is forecastable cost and consolidation. * **Best for:** Teams that want a fixed, quotable price per call across both media and LLMs. * **Vs Replicate:** reAPI's flat per-output pricing is quotable in advance, unlike Replicate's per-second compute, and it covers media and frontier LLMs behind one OpenAI-compatible key. ## Replicate vs. the top alternatives at a glance | Platform | Catalog | Modalities | Pricing model | OpenAI-compatible | Best for | | ------------ | --------------------- | -------------------------- | --------------------------------- | ----------------- | ------------------------- | | Replicate | Thousands (community) | Image, video, some LLMs | Per-second hardware or per-output | No | Custom + community models | | fal.ai | 1,000+ media models | Image, video, audio, 3D | Per-output + prepaid credits | No | Media speed | | Together AI | 176 models | Chat, vision, image, audio | Per-token + dedicated GPU/hour | Yes | Open-source LLMs | | RunPod | Bring your own | Anything you deploy | Per-second GPU + serverless | Partial | Raw GPU price | | Hugging Face | Hub models | Anything you deploy | Per-minute instance | No | Dedicated Hub deploys | | reAPI | 200+ models | Image, video, audio, chat | Pay-as-you-go credits | Yes (chat) | One key, predictable cost | Catalog and pricing figures are from each vendor's official pages as of May 2026; rates change, so confirm before you commit. ## What the numbers say about pricing The core question with Replicate is forecastability. Per-second hardware billing is fair, but it ties your cost to runtime, which you do not fully control. * **Replicate** charges most models per second of the hardware they run on, from CPU at $0.09/hour to H100 at $5.49/hour, plus per-output for some popular models\[1]. A fast model is cheap; a cold or slow one is not, and you cannot quote a fixed per-call price. * **fal.ai** and **reAPI** charge per output, so the price of an image or a video clip is fixed regardless of how long the GPU took\[3]. * **Together AI** is per-token, the right shape for chat and the wrong one for comparing a single render\[5]. * **RunPod** and **Hugging Face** bill for compute time, so a busy endpoint is efficient and an idle one wastes money\[7]\[8]. The honest read: Replicate is the right tool when you need its catalog or a custom Cog model, and the wrong one when you need a stable, quotable cost per call. That is where flat per-output pricing wins. ## Moving from Replicate to reAPI reAPI takes a different approach from Replicate: a curated, production-ready catalog with predictable pricing and a built-in LLM layer. Two things change for a team coming from Replicate. First, cost becomes quotable. A flat per-output rate means a GPT-Image-2 render is $0.0066 whether the GPU was warm or cold, so you can put a real number in a budget. Second, text and media share one key. Frontier LLMs sit next to image and video, and chat calls drop into existing OpenAI code: ```python from openai import OpenAI client = OpenAI( base_url="https://api.reapi.ai/v1", api_key="YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="gpt-5", messages=[{"role": "user", "content": "Draft the changelog entry."}], ) ``` Image and video run on REST endpoints under the same base URL and key. If you depend on a specific community model or a custom Cog deploy, keep that on Replicate and route the rest through reAPI. ## FAQ ### Why look for a Replicate alternative? Three reasons come up most: per-second billing makes per-call cost hard to forecast, there is no OpenAI-compatible endpoint, and community model quality is uneven\[1]. If you need predictable pricing or a vetted set, an alternative fits. ### Which Replicate alternative is cheapest? It depends on the workload. RunPod is cheapest for raw GPU time, Together AI for open LLM tokens, and flat per-output pricing on fal.ai or reAPI is cheapest when a rented GPU would sit underused\[5]\[7]. ### Does Replicate charge for failed runs? For official models, no, a failed run is not billed. But private models and deployments are billed for active instance time even when a run fails or is canceled\[2]. ### Is there an OpenAI-compatible Replicate alternative? Yes. Together AI exposes an OpenAI-compatible API at `api.together.ai/v1`, and reAPI is OpenAI-compatible for chat\[6]. Both let you reuse an existing OpenAI client by changing the base URL. ### Which Replicate alternative is best for video? fal.ai for managed low-latency media, and reAPI if you want flat per-video pricing alongside LLMs\[3]. RunPod is cheaper only if you run the video model on your own container. ### Can I deploy my own custom model on a Replicate alternative? Yes. Hugging Face Inference Endpoints deploy any Hub model on dedicated instances, and RunPod runs your own containers\[7]\[8]. Neither needs Replicate's Cog format. ## Choosing a Replicate alternative Replicate is still the catalog king, and the right call when you need an obscure community model or a custom Cog deploy. The case for a Replicate alternative is usually predictability or scope: a fixed price per call, an OpenAI-compatible path, or one key that also covers frontier LLMs. RunPod and Hugging Face win on raw infrastructure cost, fal.ai on managed media speed, Together AI on open LLMs, and reAPI on flat pricing across media and language models. The right Replicate alternative is the one whose pricing model matches your traffic, so pilot two and let real usage decide. ## Further reading * [reapi.ai/models](/models) — the full curated model catalog. * [What can reAPI do for you?](/blog/what-can-reapi-do) — use cases across image, video, and LLMs. * [Best fal.ai alternatives](/blog/best-fal-ai-alternatives) — the same comparison for fal.ai. ## References 1. Replicate. *Pricing — hardware and per-output model rates.* Retrieved May 2026 from replicate.com/pricing 2. Replicate. *Billing — prepaid credit, failed runs, and client libraries.* Retrieved May 2026 from replicate.com/docs/topics/billing 3. fal.ai. *Pricing — per-model rates for image and video.* Retrieved May 2026 from fal.ai/pricing 4. fal.ai. *Documentation — platform overview, model APIs, and SDKs.* Retrieved May 2026 from fal.ai/docs 5. Together AI. *Pricing — serverless tokens, dedicated GPUs, and image models.* Retrieved May 2026 from together.ai/pricing 6. Together AI. *OpenAI compatibility and model catalog.* Retrieved May 2026 from docs.together.ai/docs/inference/openai-compatibility 7. RunPod. *Pricing — GPU cloud and serverless rates.* Retrieved May 2026 from runpod.io/pricing 8. Hugging Face. *Pricing — Inference Endpoints instance rates.* Retrieved May 2026 from [huggingface.co/pricing](https://huggingface.co/pricing) 9. Hugging Face. *Inference Providers pricing and free credits.* Retrieved May 2026 from [huggingface.co/docs/inference-providers/pricing](https://huggingface.co/docs/inference-providers/pricing) --- # Best Seedance 2.5 Alternatives: H3, Veo, Sora and More (https://reapi.ai/blog/best-seedance-2-5-alternatives) **The best Seedance 2.5 alternative is MiniMax H3 if you need a new multimodal video API now, or Seedance 2.0 if you want the lowest-risk production substitute.** Veo 3.1, Sora 2, Runway Gen-4.5, and Kling 3 are stronger choices for specific ecosystems and creative workflows. Seedance 2.5 has been officially demonstrated, but its final public API model ID, price, resolution, and input limits were not published as of August 2, 2026.\[1] That makes this an alternatives guide for teams that need to produce today—not a speculative ranking of launch reels. ## TL;DR * **MiniMax H3:** best callable alternative for mixed media, 2K output, native stereo audio, and clips up to 15 seconds.\[2] * **Seedance 2.0:** best continuity option for an existing Seedance pipeline; its API and limits are already documented. * **Veo 3.1:** best fit for Google Cloud and Gemini teams that value native audio, references, and scene extension.\[3] * **Sora 2:** straightforward synced-audio API with published per-second pricing and fixed 4, 8, or 12-second durations.\[4] * **Runway Gen-4.5:** focused text-to-video and image-to-video option for teams already using Runway's production tools.\[5] * **Kling 3:** a practical creator-facing alternative when motion control and an established web workflow matter. * **For API access:** reAPI lets a product team test callable options such as [MiniMax H3](/models/minimax-h3) and [Seedance 2.0](/models/seedance-2-0) through one account while Seedance 2.5 remains coming soon. ## Best Seedance 2.5 alternatives compared ![A decision map for choosing between MiniMax H3, Seedance 2.0, Veo 3.1, Sora 2, Runway Gen-4.5, and Kling 3](https://cdn.reapi.ai/media/blog/best-seedance-2-5-alternatives/best-seedance-2-5-alternatives-selection-map.png) | Alternative | Best for | Verified strength | Main trade-off | | -------------- | --------------------------- | ----------------------------------------------------------- | --------------------------------------------------- | | MiniMax H3 | Multimodal API projects | 4–15 seconds, up to 2K, native stereo audio | Shorter than Seedance 2.5's demonstrated 30 seconds | | Seedance 2.0 | Existing Seedance workflows | Shipping API and familiar model family | Earlier generation with shorter clips | | Veo 3.1 | Google/Gemini stacks | Native audio, references, first/last frame, scene extension | Access and billing follow Google's ecosystem | | Sora 2 | Simple synced-audio API | Published duration, resolution, and price | Limited duration choices and aspect ratios | | Runway Gen-4.5 | Runway production workflow | Text-to-video and image-to-video API | 2–10-second output window | | Kling 3 | Creator UI and motion work | Established generation and editing workflow | Provider capabilities and prices vary | These are model alternatives. Higgsfield, Atlas Cloud, fal, Replicate, and reAPI are **access platforms** that can expose one or more models. Comparing a studio subscription with a model is useful only after naming the underlying model. ## Where reAPI fits in this model shortlist reAPI is not a seventh video model, so ranking it beside H3 or Veo would be misleading. It is the access layer for a product team that wants to evaluate more than one callable model without rebuilding authentication, task polling, and billing each time. Start with [MiniMax H3 on reAPI](/models/minimax-h3) when mixed references, native audio, and 2K output matter. Start with [Seedance 2.0 on reAPI](/models/seedance-2-0) when staying in the Seedance family matters more than using the newest model. Both use reAPI's asynchronous task workflow, so a later 2.5 evaluation can reuse the surrounding application even though its model-specific fields will still need validation. This is also the boundary: reAPI does not replace Higgsfield's finished studio, Google's native Cloud integration, or Runway's creator suite. It is the recommended starting point when the search for a “Seedance 2.5 alternative” is really a search for an API your own product can call today. ## 1. MiniMax H3: best immediate Seedance 2.5 alternative MiniMax H3 is the closest match to the reason many teams are watching Seedance 2.5: one model can interpret text, images, video, and audio as connected references. Its public video API accepts clips from four to 15 seconds, renders up to 2K, and generates native stereo audio.\[2] H3 also publishes its reference budget: up to nine images, three videos, and three audio files. That makes form validation and cost planning possible. MiniMax lists direct output pricing at $0.09 per second for 768p and $0.13 per second for 2K, before applicable input-media charges.\[6] Choose H3 when you need to ship mixed-reference video now. Wait for Seedance 2.5 when a single 30-second shot, second-level direction, or selective video editing would remove more work than an immediate migration creates. See the full [MiniMax H3 vs Seedance 2.5 comparison](/blog/minimax-h3-vs-seedance-2-5). ## 2. Seedance 2.0: best low-risk replacement Seedance 2.0 is less exciting than changing vendors, but it is often the correct production answer. It preserves the prompt style and model family while providing a callable API with known duration and input rules. It is available through several providers, including [Seedance 2.0 on reAPI](/models/seedance-2-0), fal, Replicate, Atlas Cloud, and ByteDance's own cloud surfaces. fal, for example, publishes per-second rates for standard and fast variants, while Replicate provides hosted endpoints and client libraries.\[7]\[8] Choose Seedance 2.0 when your deadline is real and 2.5's announced improvements are not yet a requirement. Put the model identifier behind configuration so the later upgrade is a controlled test, not an application rewrite. ## 3. Veo 3.1: best for Google Cloud and Gemini workflows Google positions Veo 3.1 as a video model with native audio, reference-image guidance, first-and-last-frame control, and scene extension. It is available through the Gemini API and Vertex AI, making it a natural choice for teams already managing access, observability, and billing in Google Cloud.\[3] Its most useful distinction is ecosystem fit. If your media assets already live in Google Cloud and Gemini handles adjacent reasoning tasks, Veo can reduce platform sprawl. If you primarily want Seedance-style camera behavior or a broad multi-provider gateway, the operational advantage is smaller. Read [Veo 3.1 vs Seedance](/blog/veo-3-1-vs-seedance-2-0-2026) for a more detailed workflow comparison. ## 4. Sora 2: best for a simple synced-audio contract Sora 2 generates video with synchronized audio through OpenAI's video API. Its model page publishes $0.10-per-second pricing for 720×1280 or 1280×720 output, while the API reference provides fixed 4, 8, and 12-second durations.\[4] That small parameter surface is a feature when predictable integration matters. It is less appealing when you need arbitrary durations, 2K delivery, or a large mixed-reference budget. Also distinguish the Sora API model from the standalone Sora consumer product; product availability does not define API availability. ## 5. Runway Gen-4.5: best for a focused production suite Runway added Gen-4.5 text-to-video and image-to-video to its API in February 2026, with two-to-ten-second generation documented in the changelog.\[5] Its advantage is not a single specification. It is the surrounding Runway workflow for generating, reviewing, and continuing creative work in one environment. Choose it when artists already use Runway and short shots are the unit of production. A developer building a model-agnostic backend may prefer H3 or a gateway with normalized job handling. ## 6. Kling 3: best for an established creator workflow Kling 3 is a practical alternative for creators who prioritize visual motion, image-led generation, and a mature web workflow. Exact capabilities, queues, and prices can vary by product surface and provider, so verify the model name and settings at checkout rather than treating every “Kling” option as identical. Kling becomes more compelling when the desired clip is short and motion-heavy. Seedance becomes more compelling when camera direction and continuity across a longer scene are the deciding factors. Our [Seedance 2.0 vs Kling 3 comparison](/blog/seedance-2-0-vs-kling-3-0-2026) covers that difference without assuming 2.5's unpublished API behavior. ## How to choose without guessing Use one representative prompt set and score the outputs on the failure that costs your team the most: 1. **Continuity:** identity, wardrobe, props, lighting, and screen direction. 2. **Instruction timing:** whether actions occur in the requested order and window. 3. **Audio:** speech intelligibility, synchronization, ambience, and unwanted sound. 4. **Recovery cost:** rerender time, failed-job billing, and manual editing. 5. **Integration:** request validation, webhooks or polling, storage, and rate limits. Do not average everything into a vague “quality” score. An ecommerce team may value product fidelity above cinematic motion. A narrative team may accept more rerolls to preserve character continuity. The best alternative is the one that removes the most expensive failure. ## FAQ ### What is the closest alternative to Seedance 2.5? MiniMax H3 is the closest newly released multimodal API alternative. Seedance 2.0 is the closest operational alternative because it belongs to the same model family. ### Is Seedance 2.5 available through an API? ByteDance has officially demonstrated it, but a final public model ID, schema, and price were not verified as of August 2, 2026. Check the live catalog rather than relying on a waitlist page. ### Which alternative creates the longest clips? This changes by model and product surface. H3 documents up to 15 seconds, Sora 2 up to 12 seconds in its API, and Runway Gen-4.5 up to 10 seconds. Seedance 2.5 demonstrates 30 seconds but is not yet a comparable public API contract. ### Which alternative has native audio? MiniMax H3, Veo 3.1, and Sora 2 all document video generation with audio. Test your language, voice, and synchronization needs rather than assuming every audio feature performs equally. ### Is Higgsfield a Seedance 2.5 alternative? Higgsfield is a creator platform, not a single model. It has a Seedance 2.5 coming-soon page, while its working Seedance workflow remains on 2.0; see [Seedance 2.5 on Higgsfield](/blog/seedance-2-5-on-higgsfield) for the availability distinction. ## The practical shortlist Start with H3 for a callable multimodal alternative, Seedance 2.0 for minimum migration risk, and Veo 3.1 for a Google-native stack. Product teams can run the first two from [reAPI's model catalog](/models) and compare accepted outputs under one task workflow. Add Sora 2, Runway Gen-4.5, or Kling 3 only when their particular workflow matches the project, then rerun the same benchmark when Seedance 2.5 publishes a model ID and price. ## References 1. ModelArk. *Doubao Seedance 2.5 official promotion.* Retrieved August 2, 2026. [ark.volcengine.com](https://ark.volcengine.com/promotion?modelName=seedance-2-5) 2. MiniMax. *MiniMax H3 launch and Video Generation Guide.* Published July 31, 2026. [minimax.io](https://www.minimax.io/blog/minimax-h3) 3. Google Developers Blog. *Introducing Veo 3.1 and new creative capabilities in the Gemini API.* [developers.googleblog.com](https://developers.googleblog.com/en/introducing-veo-3-1-and-new-creative-capabilities-in-the-gemini-api/) 4. OpenAI. *Sora 2 model and Videos API reference.* Retrieved August 2, 2026. [developers.openai.com](https://developers.openai.com/api/docs/models/sora-2) 5. Runway. *API changelog: Gen-4.5 text-to-video and image-to-video.* Updated February 10, 2026. [docs.dev.runwayml.com](https://docs.dev.runwayml.com/api-details/api_changelog/) 6. MiniMax API. *Pay-as-you-go pricing.* Retrieved August 2, 2026. [platform.minimax.io](https://platform.minimax.io/docs/guides/pricing-paygo) 7. fal. *ByteDance Seedance 2.0 text-to-video API.* Retrieved August 2, 2026. fal.ai 8. Replicate. *ByteDance Seedance 2.0 API.* Retrieved August 2, 2026. replicate.com ### Further reading * reAPI. *Seedance 2.5 launch status.* [reapi.ai/blog/seedance-2-5-release-status](/blog/seedance-2-5-release-status) * reAPI. *MiniMax H3 vs Seedance 2.5.* [reapi.ai/blog/minimax-h3-vs-seedance-2-5](/blog/minimax-h3-vs-seedance-2-5) * reAPI. *Best Higgsfield alternatives.* [reapi.ai/blog/best-higgsfield-alternatives-ai-video](/blog/best-higgsfield-alternatives-ai-video) --- # Best Together AI Alternatives in 2026: 5 Options Compared (https://reapi.ai/blog/best-together-ai-alternatives) Together AI is one of the strongest places to run open models. Its catalog lists 176 models weighted toward open-source LLMs, with per-token serverless, dedicated GPUs, fine-tuning, and a real OpenAI-compatible API\[1]\[2]. But it is open-model first, and that shapes where teams go looking for **Together AI alternatives**: there is no free trial and a $5 minimum to start, closed frontier models like GPT-5 and Claude are not on its serverless tier, and dedicated GPU time runs $6.49/hour for an H100\[1]. This guide compares five Together AI alternatives on what moves a decision: model range, pricing model, integration effort, and where each one beats Together. Four are independent platforms. The fifth is reAPI, which we build. Every figure below came from each vendor's own pricing page or docs on May 30, 2026. ## TL;DR * **Together AI** is the open-LLM and fine-tuning specialist: 176 models, per-token serverless (Llama 3.3 70B at $0.88 per million), OpenAI-compatible, but no free trial and a $5 minimum\[1]\[2]. * **OpenRouter** aggregates 400+ models across 60+ providers at pass-through pricing, plus a 5.5% credit-purchase fee, and includes free model variants\[3]\[4]. * **Replicate** spans community models and custom Cog deploys, billed per second of hardware\[5]. * **RunPod** and **Hugging Face** let you host your own model: raw GPUs from $1.99/hour, or Hub deploys on per-minute instances\[6]\[7]. * **reAPI** adds curated frontier closed models and media that Together's serverless does not host, behind one OpenAI-compatible key. ## What Together AI does well, and where it leaves gaps Together is built for teams that run open models seriously and sometimes train their own. Where it is strong: * **Open-model depth.** 176 models across chat, vision, image, audio, and code, tuned for inference\[2]. * **Fine-tuning.** LoRA, full, and vision-language fine-tuning with hosting for the result\[2]. * **OpenAI-compatible.** A drop-in endpoint at `https://api.together.ai/v1`\[2]. * **Per-token clarity.** Serverless rates like gpt-oss-20B at $0.05 in / $0.20 out, with dedicated H100s at $6.49/hour when you need them\[1]. Where teams hit walls: * **No free trial.** Together does not offer a free trial, and access requires a $5 minimum credit purchase\[1]. * **Open models only on serverless.** Closed frontier models like GPT-5 and Claude are not on the serverless tier, so a multi-vendor app still needs another provider. * **No media generation depth.** Image is supported, but Together is not a video-generation platform. * **Dedicated GPUs are pricey.** $6.49/hour for an H100 is fine for steady load and expensive for bursty traffic\[1]. ## How to evaluate a Together AI alternative Five questions sort the field: * **Open vs. closed.** Do you need GPT-5 and Claude alongside open models? * **Free entry.** A free balance to test, or a prepaid minimum? * **Train or just infer.** Is fine-tuning a requirement? * **Media.** Do you need image and video, not just text? * **Host vs. call.** A managed API, or your own GPU? ## The best Together AI alternatives in 2026 ### 1. OpenRouter: best for breadth across providers OpenRouter is the widest aggregator: 400+ models across 60+ providers behind one OpenAI-compatible key, including closed frontier models Together's serverless lacks\[3]. * **Features:** One API for open and closed models, automatic provider routing, free model variants, and bring-your-own-key support\[3]\[4]. * **Pricing:** Pass-through provider rates, so you pay the provider's own rate, plus a 5.5% ($0.80 minimum) fee on credit purchases. Rates vary by provider, for example Claude Opus 4.8 at $5 in / $25 out and Llama 3.3 70B from $0.10 in / $0.32 out\[4]. * **Performance:** Depends on the routed provider; OpenRouter normalizes the schema across them. * **Best for:** Teams that want to reach many open and closed models behind one key. * **Vs Together:** OpenRouter has far more models and closed frontier access; Together owns its inference and fine-tuning rather than reselling. ### 2. Replicate: best for custom models and media Replicate hosts thousands of community models and lets you deploy your own\[5]. * **Features:** Per-second hardware inference, per-output models, fine-tuning, and Cog packaging for custom models\[5]. * **Pricing:** Hardware per-second, for example A100 80GB at $5.04/hour, or per-output like FLUX 1.1 Pro at $0.04/image\[5]. * **Performance:** Flexible, with cost tied to runtime. * **Best for:** Teams that need custom models or media beyond Together's catalog. * **Vs Together:** Replicate is broader on media and custom deploys; Together is cleaner for open-LLM tokens and fine-tuning. ### 3. RunPod: best for hosting your own model RunPod rents GPUs by the second, the cheapest way to self-host an open model\[6]. * **Features:** GPU pods, serverless workers, 30+ regions, and bring-your-own-container deploys\[6]. * **Pricing:** Per-second, no egress fees. H100 PCIe from $1.99/hour, A100 80GB from $1.19/hour\[6]. * **Performance:** Full control over the serving stack. * **Best for:** Teams that want the lowest GPU-hour and will run their own inference. * **Vs Together:** RunPod is cheaper raw compute; Together gives you a managed endpoint and fine-tuning without ops. ### 4. Hugging Face Inference Endpoints: best for dedicated deploys Hugging Face deploys any Hub model onto dedicated, autoscaling instances billed by the minute\[7]. * **Features:** Dedicated and autoscaling instances with scale-to-zero, plus a serverless route that passes provider cost through directly\[7]\[8]. * **Pricing:** CPU from $0.033/hour; GPU runs T4 at $0.50/hour and A100 80GB at $2.50/hour, billed per minute\[7]. * **Performance:** Solid for steady traffic; scale-to-zero adds a cold start\[7]. * **Best for:** Hub-centric teams that want dedicated infrastructure. * **Vs Together:** Both deploy open models; Hugging Face is tied to the Hub, Together bundles fine-tuning and serverless tokens. ### 5. reAPI: best for unified frontier models and media reAPI covers what Together's serverless does not: curated frontier closed models and media, behind one OpenAI-compatible key at 20-50% below official rates. * **Features:** Frontier LLMs (GPT-5, Claude Opus 4.8, Gemini) plus curated media models (Veo 3.1, Seedance 2.0, Wan 2.7, Kling, GPT-Image-2, Gemini 3 Pro Image). Chat is OpenAI-compatible; image and video run on REST endpoints under the same key. * **Pricing:** Pay-as-you-go credits at 1 credit = $0.001, no subscription, free credits to start, so there is no $5 floor before the first call. Media is flat per-output, for example GPT-Image-2 from $0.0066/image and Seedance 2.0 from $0.0506/video. * **Performance:** Same upstream frontier models; the win is unified access plus media. * **Best for:** Teams that want closed frontier LLMs and video generation alongside open models. * **Vs Together:** reAPI reaches closed frontier models like GPT-5 and Claude plus video generation that Together's serverless does not host, all behind one OpenAI-compatible key, and starts with free credits. ## Together AI vs. the top alternatives at a glance | Platform | Catalog | Closed frontier models | Pricing model | Free to start | Best for | | ------------ | ------------------------- | ---------------------- | ------------------------- | ----------------------- | ------------------------- | | Together AI | 176 (open focus) | No (serverless) | Per-token + dedicated GPU | No ($5 min) | Open LLMs + fine-tuning | | OpenRouter | 400+ across 60+ providers | Yes | Pass-through + 5.5% fee | Small free allowance | Provider breadth | | Replicate | Thousands (community) | Some | Per-second or per-output | Limited free | Custom + community models | | RunPod | Bring your own | Self-hosted | Per-second GPU | No | Self-hosting open models | | Hugging Face | Hub models | Self-hosted | Per-minute instance | Serverless free credits | Dedicated Hub deploys | | reAPI | 200+ models | Yes | Pay-as-you-go credits | Free credits | Frontier models + media | Catalog and pricing figures are from each vendor's official pages as of May 2026; rates change, so confirm before you commit. ## What the numbers say about pricing Together's per-token rates are competitive for open models, so the comparison is less about cents and more about what you can reach and how you start. * **Together** is per-token serverless plus dedicated GPUs, but you prepay a $5 minimum and there is no trial\[1]. * **OpenRouter** passes provider rates through unchanged, then adds a 5.5% ($0.80 minimum) fee when you buy credits, so the headline rate is not the final cost\[4]. * **reAPI** runs on one pay-as-you-go credit balance with free starting credits and no minimum, which lowers the cost of testing to zero. * **RunPod** and **Hugging Face** bill for compute time, so they win only when you keep a GPU busy\[6]\[7]. The honest read: Together is excellent for open-model inference and fine-tuning. If you need closed frontier models, media, or a free way to start, an alternative fits better. ## Moving from Together AI to reAPI Both are OpenAI-compatible, so the swap is a base URL and key for text, plus reAPI's REST endpoints for image and video: ```python from openai import OpenAI client = OpenAI( base_url="https://api.reapi.ai/v1", api_key="YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="gpt-5", messages=[{"role": "user", "content": "Classify this support ticket."}], ) ``` If fine-tuning open models is core to your stack, keep that on Together and route frontier and media calls through reAPI. The OpenAI-compatible surface on both sides makes a hybrid setup low-effort. ## FAQ ### Does Together AI have a free trial? No. Together does not offer a free trial, and access requires a $5 minimum credit purchase\[1]. OpenRouter gives a small free allowance plus free model variants, and reAPI starts new accounts with free credits\[4]. ### Which Together AI alternative has GPT-5 and Claude? OpenAI's and Anthropic's closed models are not on Together's serverless tier. OpenRouter and reAPI both carry them behind one key; OpenRouter lists Claude Opus 4.8 at $5 in / $25 out, for example\[4]. ### Which Together AI alternative is cheapest? For open LLM tokens, Together and OpenRouter are close, though OpenRouter adds a 5.5% credit fee\[4]. For self-hosting, RunPod is cheapest per GPU-hour\[6]. Match the pricing model to your traffic before comparing rates. ### Can I fine-tune models on a Together AI alternative? Yes. Replicate supports fine-tuning with Cog, and Hugging Face and RunPod let you train and deploy on your own infrastructure\[5]\[6]. ### Does any Together AI alternative also do video? reAPI and Replicate both generate video; reAPI carries curated models like Veo 3.1 and Seedance 2.0 behind the same key as its LLMs\[5]. Together is text and image, not video. ## Choosing a Together AI alternative Together AI is a top choice for open-model inference and fine-tuning, and worth keeping if that is your core. The case for a Together AI alternative is usually reach or entry cost: closed frontier models, video generation, or a free way to start without a $5 floor. OpenRouter wins on provider breadth, Replicate on custom models, RunPod and Hugging Face on self-hosting, and reAPI on unified frontier-plus-media access with free starting credits. The right Together AI alternative is the one that matches the models and pricing model your app actually needs, so pilot two and compare real usage. ## Further reading * [reapi.ai/models](/models) — frontier LLMs plus image and video, behind one key. * [Claude Opus 4.8](/models/claude-opus-4-8) — frontier reasoning on the OpenAI-compatible gateway. * [Best CometAPI alternatives](/blog/best-cometapi-alternatives) — another unified-gateway comparison. ## References 1. Together AI. *Pricing — serverless tokens, dedicated GPUs, and minimums.* Retrieved May 2026 from together.ai/pricing 2. Together AI. *OpenAI compatibility, model catalog, and fine-tuning.* Retrieved May 2026 from docs.together.ai/docs/inference/openai-compatibility 3. OpenRouter. *Models — provider and modality catalog.* Retrieved May 2026 from openrouter.ai/models 4. OpenRouter. *Docs FAQ — pass-through pricing, fees, and free models.* Retrieved May 2026 from openrouter.ai/docs/faq 5. Replicate. *Pricing — hardware and per-output model rates.* Retrieved May 2026 from replicate.com/pricing 6. RunPod. *Pricing — GPU cloud and serverless rates.* Retrieved May 2026 from runpod.io/pricing 7. Hugging Face. *Pricing — Inference Endpoints instance rates.* Retrieved May 2026 from [huggingface.co/pricing](https://huggingface.co/pricing) 8. Hugging Face. *Inference Providers pricing and free credits.* Retrieved May 2026 from [huggingface.co/docs/inference-providers/pricing](https://huggingface.co/docs/inference-providers/pricing) --- # Best Venice.ai Alternatives in 2026: 5 Options Compared (https://reapi.ai/blog/best-venice-ai-alternatives) Venice.ai is a privacy-first, uncensored AI platform: one OpenAI-compatible key reaches text, image, video, audio, and embeddings, with a four-tier privacy architecture and a crypto economy on top\[1]\[2]. Its text side runs open-weight models like venice-uncensored, GLM, Qwen, Llama, DeepSeek, and Kimi, and its pitch is blunt: your prompts stay yours, and the models will not refuse you\[2]. Teams comparing **Venice.ai alternatives** usually want one of a few things: frontier commercial models Venice does not lead with, a cheaper open-weight API without a subscription or token, stronger or simpler privacy, or a unified gateway they can pay for in plain dollars. This guide compares five Venice.ai alternatives on what actually moves a decision: model range, privacy posture, pricing shape, and integration effort. Four are independent platforms. The fifth is reAPI, which we build, and I will be straight about it: reAPI is not a privacy or uncensored play, so if those are your hard requirements, the honest answer is Venice itself or a local model, not us. Where reAPI competes is the unified, OpenAI-compatible, below-official-price gateway, especially for commercial frontier and media models. Every figure below came from each vendor's own pages or docs on June 7, 2026. ## TL;DR * **OpenRouter** is the breadth option: 400+ models across 60+ providers behind one OpenAI-compatible key, pass-through pricing plus a 5.5% fee, with data-policy filters and zero-data-retention routes\[5]\[6]. * **Together AI** runs open-weight models with fine-tuning, OpenAI-compatible, per token\[7]. * **DeepInfra** is the cheapest open-weight API: OpenAI-compatible, pay-as-you-go, no subscription or token\[8]. * **Ollama and LM Studio** are the maximal-privacy answer: run open weights locally so nothing leaves your device\[9]\[10]. * **reAPI** is the unified commercial-media pick: 200+ models with deep video generation, OpenAI-compatible chat, and pay-as-you-go credits at 1 credit = $0.001, but no privacy tiers and no uncensored stance. ## What Venice.ai does well, and where it leaves gaps Venice's strength is privacy and permissionless access wrapped in a standard API. Where it is strong: * **One private API for every modality.** Text, image, video, audio, embeddings, and tools behind one OpenAI-compatible key, base URL `https://api.venice.ai/api/v1`\[2]. * **Real privacy architecture.** Four tiers: anonymized third-party models, zero-retention self-hosted models, TEE hardware enclaves, and end-to-end encryption\[1]. * **Uncensored by default.** Open-weight models with a `text:uncensored` trait and no content filtering\[2]. * **Agent-native.** MCP tools, wallet (x402) payments, and agents that can mint their own API key by staking VVV on Base\[2]. Where teams hit walls: * **Subscription-led access.** The free tier caps you at 10 text and 15 image prompts per day; deeper use means a $18-$200/month plan or staking the VVV token\[3]\[4]. * **Open-weight-first text.** The text catalog leans on open models; if you need a frontier commercial LLM as your default, that is not the center of gravity here\[2]. * **A crypto layer to learn.** VVV, DIEM, staking, and burns are optional but front-and-center, which is friction if you just want an API key\[4]. * **Tied to one provider's stack.** Privacy tiers are Venice-specific, so you cannot mix in another vendor's routing under the same roof. ## How to evaluate a Venice.ai alternative Five questions sort the field: * **Privacy requirement.** Do you need zero retention and uncensored output, or just a normal hosted API? * **Model reach.** Open-weight models, frontier commercial models, or both? * **Pricing shape.** Subscription plus credits, pass-through per token, or pay-as-you-go credits? * **Crypto or dollars.** Are you fine with a token economy, or do you want plain USD billing? * **Local vs. hosted.** Would running on your own hardware solve the privacy question outright? ## The best Venice.ai alternatives in 2026 ### 1. OpenRouter: best for model breadth and routing control OpenRouter is the largest aggregator and the closest match to Venice's API shape, with far more models and explicit privacy routing\[5]. * **Features:** 400+ models across 60+ providers behind one OpenAI-compatible key, with provider routing, free model variants, bring-your-own-key, data-policy filters, and zero-data-retention (ZDR) routes you can require\[5]\[6]. * **Pricing:** Pass-through at the provider's own rate, plus a 5.5% ($0.80 minimum) fee on credit purchases. Rates vary by provider, for example Claude Opus 4.8 at $5 in / $25 out per million\[5]. * **Performance:** Depends on the routed provider; the schema is normalized across them. * **Best for:** Teams that want the widest reach plus the ability to filter who can log or train on their data. * **Vs Venice:** Both are unified OpenAI-compatible APIs. Venice self-hosts open models with zero-retention and TEE tiers; OpenRouter routes to 60+ third-party providers and lets you filter by data policy, but it does not run its own private enclaves. ### 2. Together AI: best for open-weight inference and fine-tuning Together AI runs the same class of open weights Venice self-hosts, and lets you fine-tune them\[7]. * **Features:** Serverless inference for open-weight models (Llama, Qwen, DeepSeek, GLM, gpt-oss) across chat, vision, image, audio, video, and embeddings, plus fine-tuning, dedicated GPUs, and a batch API at lower cost, all OpenAI-compatible\[7]. * **Pricing:** Per token, for example Llama 3.3 70B at $1.04 per million in and out, gpt-oss-120B at $0.15 / $0.60, and GLM-5.1 at $1.40 / $4.40\[7]. * **Performance:** Strong on open-model chat and reasoning; Together owns its inference stack. * **Best for:** Open-weight-first teams that want to fine-tune rather than just call models. * **Vs Venice:** Together runs and trains the same open weights, but as a standard cloud, without Venice's TEE/E2EE tiers or its uncensored-by-default posture. ### 3. DeepInfra: best for a cheap open-weight API with no subscription DeepInfra delivers Venice's open-weight API value as pure pay-as-you-go, no plan and no token\[8]. * **Features:** OpenAI-compatible chat completions for open-source models ("just change the base URL and model name"), plus vision/OCR, embeddings, rerank, image, text-to-video, and speech, with private model deploys and LoRA on top\[8]. * **Pricing:** Per token with no contracts or upfront costs, for example DeepSeek-V4-Flash at $0.10 / $0.20, DeepSeek-V3.2 at $0.26 / $0.38, and Qwen3-VL-30B at $0.15 / $0.60 per million\[8]. * **Performance:** Tuned for low-cost open-source inference at scale. * **Best for:** Developers who used Venice's API mainly for cheap open-weight calls and want billing in plain dollars. * **Vs Venice:** DeepInfra matches the cheap, OpenAI-compatible open-weight API without a subscription or crypto, but has no privacy-tier architecture and no uncensored stance. ### 4. Ollama and LM Studio: best for fully private, local AI If your real requirement is that prompts never leave your machine, local inference solves it outright\[9]. * **Features:** Download and run open weights (Llama, Mistral, Qwen, DeepSeek, including uncensored fine-tunes) entirely on your own hardware. Ollama exposes an OpenAI-compatible server at `http://localhost:11434/v1`; LM Studio exposes `/v1/chat/completions`, `/v1/responses`, and `/v1/embeddings`\[9]\[10]. * **Pricing:** Free software; you pay only for your own hardware and electricity. * **Performance:** Bounded by your GPU and RAM, but with no network latency and no rate limits. * **Best for:** Anyone whose privacy bar is absolute, where there is no remote prompt to retain in the first place. * **Vs Venice:** Local tools are the maximal-privacy answer, since nothing leaves your device, but you give up Venice's hosted frontier and media models, managed scaling, and one-click access. ### 5. reAPI: best for a unified commercial-media API, pay-as-you-go reAPI is a unified, OpenAI-compatible gateway priced below official rates, with a deep curated video catalog and a transparent credit unit at 1 credit = $0.001. To be clear up front: it is not a privacy or uncensored product, and it carries mainstream commercial models with their own content policies. * **Features:** 200+ models, including frontier LLMs (GPT-5, Claude Opus 4.8, Gemini), image models (GPT-Image-2, Gemini 3 Pro Image), and a deep video catalog (Veo 3.1, Seedance 2.0, Wan 2.7, Kling, HappyHorse 1.0), several of which (Seedance 2.0, Wan 2.7, Kling) Venice also carries. Chat is OpenAI-compatible; image and video run on REST endpoints under the same key. * **Pricing:** Pay-as-you-go credits at 1 credit = $0.001, at 20-50% below official rates, with no subscription, no prepaid minimum, and free credits to start. Media is flat per output, for example GPT-Image-2 from $0.0066/image, Seedance 2.0 from $0.0506/video, and Veo 3.1 Fast from $0.207/generation. * **Performance:** Same upstream frontier models; the win is a curated commercial catalog and an explicit price unit. * **Best for:** Teams that used Venice's API for its frontier and media models and want them in plain USD credits with no plan to manage. * **Vs Venice:** reAPI matches the unified, OpenAI-compatible, below-official model and goes deeper on commercial media, but it does not offer Venice's privacy tiers, uncensored models, or crypto payments. If privacy or uncensored output is the requirement, Venice or a local model is the fit. ## Venice.ai vs. the top alternatives at a glance | Platform | Models | Pricing model | Privacy posture | OpenAI-compatible | Best for | | ------------------ | --------------------------------- | ------------------------------------ | ------------------------------------------------- | ----------------- | ----------------------------------- | | Venice.ai | 100+ text, plus image/video/audio | Subscription + credits, or stake VVV | Anonymized / private / TEE / E2EE, zero retention | Yes | Private, uncensored AI | | OpenRouter | 400+ across 60+ providers | Pass-through + 5.5% fee | Data-policy filters + ZDR routes | Yes | Breadth + routing control | | Together AI | Open-weight catalog | Per token + dedicated GPU | Standard hosted cloud | Yes | Open-weight inference + fine-tuning | | DeepInfra | Open-weight catalog | Per token, pay-as-you-go | Standard cloud, private deploys | Yes | Cheapest open-weight API | | Ollama / LM Studio | Open weights you download | Free (your own hardware) | Fully local, nothing leaves device | Yes (local) | Maximal privacy | | reAPI | 200+ models | Credits, 20-50% below official | Standard hosted gateway | Yes (chat) | Curated commercial media + LLMs | Model and pricing figures are from each vendor's official pages as of June 2026; rates change, so confirm before you commit. ## What the numbers say about pricing Venice and these alternatives price on different axes, and the cheapest one depends on what you call. * **Venice** is subscription-led: a free tier with daily caps, then Pro at $18, Plus at $68, and Max at $200 a month, each bundling monthly credits at 100 credits = $1; or you stake 100 VVV for Pro access instead of paying cash\[3]\[4]. * **OpenRouter** passes the provider's exact rate through unchanged, then adds a 5.5% ($0.80 minimum) fee on credit purchases\[5]. * **DeepInfra** and **Together** are per-token pay-as-you-go, where open models like DeepSeek and Qwen cost cents per million tokens and there is no plan to buy\[7]\[8]. * **Ollama and LM Studio** are free beyond the hardware you already own\[9]. * **reAPI** uses an explicit credit unit, 1 credit = $0.001, at 20-50% below official rates, with no subscription and free starting credits. The honest read: the deciding factor against Venice is rarely a few cents of token cost. It is whether you actually need the privacy tiers and uncensored stance, in which case Venice or a local model wins, or whether you mainly want a cheap unified API, in which case a per-token open-weight host or reAPI's curated commercial catalog is the better fit. ## Moving from Venice.ai to reAPI Because both speak the OpenAI format, switching text calls is a base-URL change, and media moves to reAPI's REST endpoints: ```python from openai import OpenAI client = OpenAI( base_url="https://reapi.ai/api/v1", api_key="rk_live_YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Rewrite this paragraph for clarity."}], ) ``` Image and video run on REST endpoints under the same base URL and key. Since reAPI is pay-as-you-go with free starting credits, the low-risk move is to run a real workload through it and compare model coverage and invoices before you consolidate. Keep in mind that reAPI does not replace Venice's privacy tiers or uncensored models, so split your traffic accordingly. ## FAQ ### Is Venice.ai legit and safe? Venice.ai is a working privacy-first, uncensored AI platform with an OpenAI-compatible API and a four-tier privacy architecture\[1]\[2]. The reasons to compare Venice.ai alternatives are usually wanting frontier commercial models, a cheaper open-weight API without a subscription, or fully local privacy, not doubts about whether it works. ### What is the most private Venice.ai alternative? Running models locally with Ollama or LM Studio is the most private option, because the prompt never leaves your device and there is no remote service to retain it\[9]\[10]. Venice's own zero-retention and TEE tiers are the strongest hosted answer\[1]. ### Which Venice.ai alternative is OpenAI-compatible? OpenRouter, Together AI, DeepInfra, local Ollama and LM Studio, and reAPI (for chat) all expose OpenAI-compatible APIs, so you reuse an existing client by changing the base URL\[5]\[7]\[8]\[9]. ### Do I need the VVV crypto token to use Venice? No. Venice sells standard USD subscriptions and credits; staking 100 VVV is an optional alternative route to Pro access\[4]. Alternatives like DeepInfra and reAPI bill in plain dollars with no token at all. ### Which Venice.ai alternative is best for uncensored models? Venice itself, local open-weight models via Ollama or LM Studio, or open-weight hosts like Together, DeepInfra, and select OpenRouter routes\[7]\[8]\[9]. Mainstream commercial gateways, reAPI included, apply each provider's content policies. ### Which Venice.ai alternative is cheapest for open-weight models? DeepInfra and Together AI price open models per token pay-as-you-go, for example DeepSeek and Qwen at cents per million tokens\[7]\[8]. Local inference with Ollama or LM Studio is free beyond your own hardware\[9]. ## Choosing a Venice.ai alternative Venice.ai does a specific job well: a private, uncensored, OpenAI-compatible API with a real privacy architecture and an optional crypto economy. The case for a Venice.ai alternative is usually the specifics: OpenRouter for the widest reach and routing control, Together AI for open-weight fine-tuning, DeepInfra for the cheapest pay-as-you-go open-weight API, and Ollama or LM Studio when privacy has to be absolute and local. If what you valued in Venice was the unified, OpenAI-compatible gateway with frontier commercial and media models, and you want it pay-as-you-go in transparent credits, reAPI is the alternative built for that, with the honest caveat that it does not match Venice on privacy or uncensored output. Run a real workload through two of them and let coverage, privacy needs, and invoices decide. ## Further reading * [reapi.ai/models](/models) — frontier LLMs plus image, video, and audio. * [Claude Opus 4.8](/models/claude-opus-4-8) — frontier reasoning on the OpenAI-compatible gateway. * [Best CometAPI alternatives](/blog/best-cometapi-alternatives) — the same comparison for a unified gateway. ## References 1. Venice AI. *Homepage — privacy architecture and capabilities.* Retrieved June 2026 from venice.ai 2. Venice AI. *API docs — OpenAI compatibility, endpoints, and models.* Retrieved June 2026 from docs.venice.ai 3. Venice AI. *Pricing — tiers, daily limits, and credits.* Retrieved June 2026 from venice.ai/pricing 4. Venice AI. *Venice Token (VVV) and DIEM — staking and access.* Retrieved June 2026 from venice.ai/lp/vvv 5. OpenRouter. *Models and pricing — provider catalog and fees.* Retrieved June 2026 from openrouter.ai/models 6. OpenRouter. *Privacy and provider logging — ZDR and data policy.* Retrieved June 2026 from openrouter.ai/docs/features/privacy-and-logging 7. Together AI. *Pricing — serverless tokens, dedicated GPUs, and fine-tuning.* Retrieved June 2026 from together.ai/pricing 8. DeepInfra. *Docs and pricing — OpenAI-compatible API and per-token rates.* Retrieved June 2026 from deepinfra.com/docs 9. Ollama. *OpenAI compatibility — local OpenAI-compatible API.* Retrieved June 2026 from [ollama.com/blog/openai-compatibility](https://ollama.com/blog/openai-compatibility) 10. LM Studio. *OpenAI compatibility endpoints.* Retrieved June 2026 from [lmstudio.ai/docs/app/api/endpoints/openai](https://lmstudio.ai/docs/app/api/endpoints/openai) --- # Best WaveSpeed Alternatives in 2026: 5 Options Compared (https://reapi.ai/blog/best-wavespeed-alternatives) WaveSpeed AI is fast. The platform runs 1,000+ models across image, video, audio, 3D, and language behind one OpenAI-compatible API, and it markets sub-second latency with no cold starts\[2]. If speed is the entire requirement, it delivers. Teams looking for **WaveSpeed alternatives** usually want something else: a larger free balance than the $1 trial, throughput that is not gated behind a four-figure prepayment, pricing that does not shift with resolution, or a different model curation. This guide compares five WaveSpeed alternatives on what moves a real decision: model range, pricing model, integration effort, and where each one beats WaveSpeed. Four are independent platforms. The fifth is reAPI, which we build. Every figure below came from each vendor's own pricing page or docs on May 30, 2026. ## TL;DR * **WaveSpeed** is the speed-first unified API: 1,000+ models, sub-second latency claims, pay-per-use (Seedance 2.0 Fast at $0.10/second, Nano Banana 2 at $0.07/image), but only $1 in trial credits and throughput tiers gated behind large prepayments\[1]\[2]. * **fal.ai** is the other fast managed media API, with output pricing and 1,000+ models, but no LLM layer and no OpenAI-compatible endpoint\[4]. * **Replicate** has the widest catalog and custom Cog deploys, billed per second of hardware\[5]. * **Together AI** and **RunPod** cover the edges: open LLM tokens, and raw GPU rental from $1.99/hour\[6]\[8]. * **reAPI** is the unified pick with flat per-output pricing and a single credit balance that does not gate throughput behind prepayment tiers. ## What WaveSpeed does well, and where it leaves gaps WaveSpeed is built around one promise: minimal latency on a broad, unified catalog. Where it is strong: * **Speed.** WaveSpeed advertises sub-second inference latency, zero cold starts, and images in under two seconds\[2]. * **Breadth and modalities.** 1,000+ models spanning image, video, audio, 3D, and language, including avatar and speech generators\[2]. * **OpenAI-compatible.** WaveSpeed positions its API as a drop-in replacement for the OpenAI SDK, with Python and JavaScript clients, webhooks, and ComfyUI and n8n integrations\[2]. * **Pay-per-use.** No subscription; you pay per image, per second of video, or per token, and new accounts get $1 in free credits\[1]. Where teams hit walls: * **The free trial is tiny.** $1 in trial credits, and some premium models are not available on trial credit at all\[1]. * **Throughput is gated by prepayment.** Default accounts are rate-limited; lifting limits means prepaying into tiers, for example $100 for Silver and $1,000 for Gold\[2]. * **Prices vary by parameters.** Listed rates are base prices that move with resolution and generation settings, so the headline number is a floor\[1]. * **Media-first.** The LLM catalog is a subset bolted onto a media platform, not the core. ## How to evaluate a WaveSpeed alternative Five questions sort the field: * **Free balance.** Enough to actually test, or a token trial? * **Throughput terms.** Is real concurrency gated behind a large prepayment? * **Pricing stability.** A flat per-output price, or one that drifts with parameters? * **API compatibility.** OpenAI format, or a bespoke client? * **Scope.** Unified media plus LLMs, or one or the other? ## The best WaveSpeed alternatives in 2026 ### 1. fal.ai: best for media speed fal.ai is WaveSpeed's closest match on the media side: a fast, managed API with 1,000+ optimized endpoints\[4]. * **Features:** Image, video, audio, and 3D, with a queue API, webhooks, streaming, and SDKs in five languages\[4]. * **Pricing:** Output-based, for example Veo 3 at $0.4/second and FLUX Kontext Pro at $0.04/image. Prepaid credits, billed only on success\[3]. * **Performance:** Claims the fastest inference for generative media, with 99.99% uptime\[4]. * **Best for:** Media-heavy apps that want speed without managing hardware. * **Vs WaveSpeed:** Comparable media speed and catalog, but fal.ai has no LLM layer and no OpenAI-compatible endpoint. ### 2. Replicate: best for catalog and custom models Replicate hosts thousands of community and proprietary models, the widest catalog of the group\[5]. * **Features:** Per-second hardware inference, per-output models, fine-tuning, and Cog for deploying your own models\[5]. * **Pricing:** Hardware per-second, for example A100 80GB at $5.04/hour, or per-output like FLUX 1.1 Pro at $0.04/image\[5]. * **Performance:** Reliable and flexible, though not tuned for WaveSpeed-style latency. * **Best for:** Teams that need an obscure model or want to ship a custom one. * **Vs WaveSpeed:** Far more models and custom deploys; slower and harder to forecast on per-second billing. ### 3. Together AI: best for open-source LLMs Together AI is the language-model pick, with 176 models weighted toward open LLMs and a real OpenAI-compatible API\[7]. * **Features:** Per-token serverless, dedicated GPUs, fine-tuning, and an OpenAI-compatible endpoint at `https://api.together.ai/v1`\[7]. * **Pricing:** Per-token, for example Llama 3.3 70B at $0.88 per million in and out. Dedicated H100 runs $6.49/hour\[6]. * **Performance:** Strong for chat, vision, and reasoning. * **Best for:** Open-source-first language stacks. * **Vs WaveSpeed:** Deeper on LLMs, but weaker on media generation, and it has no free trial and a $5 minimum\[7]. ### 4. RunPod: best for raw GPU control RunPod rents GPUs by the second, the cheapest route if you run your own containers\[8]. * **Features:** GPU pods, serverless workers that scale to zero, 30+ regions, and bring-your-own-container deploys\[8]. * **Pricing:** Per-second, no egress fees. H100 PCIe from $1.99/hour, A100 80GB from $1.19/hour, RTX 4090 from $0.34/hour\[8]. * **Performance:** Full control, at the cost of operating it yourself. * **Best for:** Teams that want the lowest GPU-hour and can do their own serving. * **Vs WaveSpeed:** Cheaper raw compute, but you build the latency that WaveSpeed sells out of the box. ### 5. reAPI: best for flat pricing across media and LLMs reAPI is the unified alternative without the prepayment gates: 200+ image, video, audio, and chat models behind one key, at 20-50% below the providers' official rates. * **Features:** Curated frontier media models (Veo 3.1, Seedance 2.0, Wan 2.7, Kling, HappyHorse 1.0, Imagen 4, Seedream 5.0, GPT-Image-2, Gemini 3 Pro Image) plus frontier LLMs (GPT-5, Claude Opus 4.8, Gemini). Chat is OpenAI-compatible; image and video run on REST endpoints under the same key. * **Pricing:** Flat per-output: GPT-Image-2 from $0.0066/image, Seedance 2.0 from $0.0506/video, Veo 3.1 Fast from $0.207/generation. Pay-as-you-go credits at 1 credit = $0.001, no subscription, free credits to start. * **Performance:** Same upstream frontier models, so quality matches the source; the win is a simpler cost and access model. * **Best for:** Teams that want unified media and LLM access without juggling throughput tiers. * **Vs WaveSpeed:** reAPI keeps flat per-output pricing and a single credit balance with no prepayment tiers gating concurrency, and it is OpenAI-compatible and unified across media and LLMs. ## WaveSpeed vs. the top alternatives at a glance | Platform | Catalog | Modalities | Pricing model | OpenAI-compatible | Best for | | ----------- | --------------------- | ---------------------------- | --------------------------------- | ----------------- | ------------------------- | | WaveSpeed | 1,000+ models | Image, video, audio, 3D, LLM | Pay-per-use, tiered throughput | Yes | Speed-first unified API | | fal.ai | 1,000+ media models | Image, video, audio, 3D | Per-output + prepaid credits | No | Media speed | | Replicate | Thousands (community) | Image, video, some LLMs | Per-second hardware or per-output | No | Custom + community models | | Together AI | 176 models | Chat, vision, image, audio | Per-token + dedicated GPU/hour | Yes | Open-source LLMs | | RunPod | Bring your own | Anything you deploy | Per-second GPU + serverless | Partial | Raw GPU control | | reAPI | 200+ models | Image, video, audio, chat | Pay-as-you-go credits | Yes (chat) | Simple unified pricing | Catalog and pricing figures are from each vendor's official pages as of May 2026; rates change, so confirm before you commit. ## What the numbers say about pricing WaveSpeed and reAPI price the same way on the surface, both pay-per-use with per-image and per-second rates. The difference is the terms around the number. * **WaveSpeed** is pay-per-use, but real throughput is gated: default accounts are rate-limited, and lifting the cap means prepaying into $100, $1,000, or higher tiers\[2]. Listed prices are also base rates that move with resolution\[1]. * **reAPI** runs on one pay-as-you-go credit balance with flat per-output prices and no prepayment tier gating concurrency. * **fal.ai** is output-based and prepaid; **Replicate** is per-second hardware; **Together AI** is per-token; **RunPod** is per-second GPU\[3]\[5]\[6]\[8]. The honest read: WaveSpeed is a strong pick when latency is the priority and you will prepay for throughput. If you want unified access without the tier ladder, flat pricing is the cleaner deal. ## Moving from WaveSpeed to reAPI Both platforms are OpenAI-compatible and unified, so a move is mostly a base-URL swap for text, plus switching media calls to reAPI's REST endpoints. ```python from openai import OpenAI client = OpenAI( base_url="https://api.reapi.ai/v1", api_key="YOUR_REAPI_KEY", ) resp = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Write the product blurb."}], ) ``` Image and video run on REST endpoints under the same base URL and key. Because both are pay-per-use, a hybrid trial is easy: keep latency-critical jobs on WaveSpeed, route the rest through reAPI, and compare real invoices before committing. ## FAQ ### Is WaveSpeed AI good? For latency-sensitive generation, yes. WaveSpeed advertises sub-second inference and zero cold starts across a 1,000+ model catalog\[2]. The reasons to consider a WaveSpeed alternative are the $1 trial, the prepayment-gated throughput tiers, and pricing that moves with parameters\[1]. ### Which WaveSpeed alternative is OpenAI-compatible? Together AI and reAPI both expose OpenAI-compatible APIs, so you can reuse an existing OpenAI client by changing the base URL\[7]. fal.ai and Replicate use their own clients. ### Which WaveSpeed alternative has the best free tier? reAPI starts new accounts with free credits, and Hugging Face offers free serverless inference credits. WaveSpeed's own trial is $1\[1]. fal.ai, Replicate, and Together AI are prepaid, with Together requiring a $5 minimum\[7]. ### Does any WaveSpeed alternative cover both media and LLMs? reAPI does, behind one key with an OpenAI-compatible chat surface. Replicate spans both as well, per-model on community infrastructure\[5]. fal.ai is media-only. ### Which is cheaper, WaveSpeed or its alternatives? It depends on volume and throughput needs. RunPod is cheapest for raw GPU time, and flat per-output pricing on reAPI avoids WaveSpeed's prepayment tiers\[8]. Compare the pricing model against your traffic, not just the headline rate. ## Choosing a WaveSpeed alternative WaveSpeed earns its niche on speed, and it is a fair pick if low latency justifies prepaying for throughput. The case for a WaveSpeed alternative is usually the terms: a real free balance, no tier ladder gating concurrency, or stable per-call pricing. fal.ai matches it on managed media, Replicate on catalog, Together AI on open LLMs, and RunPod on raw GPU cost. If you want unified media and LLM access on one flat-priced credit balance, reAPI is the WaveSpeed alternative built for that. Pilot two, and let your own invoices decide. ## Further reading * [reapi.ai/models](/models) — image, video, audio, and chat models behind one key. * [What is reAPI?](/blog/what-is-reapi) — quickstart, pricing, and how the API works. * [Best fal.ai alternatives](/blog/best-fal-ai-alternatives) — the same comparison for fal.ai. ## References 1. WaveSpeed AI. *Pricing — pay-per-use rates and trial credits.* Retrieved May 2026 from wavespeed.ai/pricing 2. WaveSpeed AI. *Platform overview, performance, and API.* Retrieved May 2026 from wavespeed.ai/about 3. fal.ai. *Pricing — per-model rates for image and video.* Retrieved May 2026 from fal.ai/pricing 4. fal.ai. *Documentation — platform overview, model APIs, and SDKs.* Retrieved May 2026 from fal.ai/docs 5. Replicate. *Pricing — hardware and per-output model rates.* Retrieved May 2026 from replicate.com/pricing 6. Together AI. *Pricing — serverless tokens and dedicated GPUs.* Retrieved May 2026 from together.ai/pricing 7. Together AI. *OpenAI compatibility and model catalog.* Retrieved May 2026 from docs.together.ai/docs/inference/openai-compatibility 8. RunPod. *Pricing — GPU cloud and serverless rates.* Retrieved May 2026 from runpod.io/pricing --- # Can You Run Seedance 2.0 Locally? What Actually Works (https://reapi.ai/blog/can-you-run-seedance-locally) No, you cannot run Seedance locally, and it is worth being precise about why: ByteDance has never released the weights for any Seedance 2.0 model. Its official Hugging Face organizations carry no Seedance checkpoints at all\[1], and the official model page routes to exactly two destinations, the Dreamina app and the paid enterprise API\[2]. Anything advertised as a "local Seedance install," a torrent, or a one-click desktop build is a different model wearing the name, or worse. That is the short answer to a search a lot of people run. The longer, more useful answer covers what the "local Seedance" downloads actually are, which open-weight video models genuinely do run on your own GPU in 2026, what they cost you in hardware, and when the honest arithmetic points back to an API. ## TL;DR * **Seedance 2.0 is closed-weight.** No checkpoint exists on ByteDance's Hugging Face orgs or anywhere official\[1]; access is the Dreamina app or API platforms, full stop\[2]. * **"Local Seedance" packages are relabels or malware bait**, in the same family as the squatter domains that top Seedance search results\[3]. * **Real local alternatives exist and are good**: Wan 2.2 and Mochi 1 under pure Apache-2.0, HunyuanVideo-1.5, LTX-2.3, and CogVideoX1.5 under community licenses\[4]\[5]. * **The hardware bill is real**: from about 10GB of VRAM for CogVideoX1.5-5B up to 80GB-class cards for Wan 2.2's larger variant\[4]\[8]. * **If the requirement is Seedance quality specifically**, the per-second API route starts at $0.03/s on reAPI\[6], which buys a lot of clips before it matches a GPU invoice. ## Why there is no local Seedance, verifiably Three checks anyone can repeat. First, ByteDance's Hugging Face organizations, both the corporate account and the ByteDance-Seed research org, return nothing for Seedance; the company open-sources plenty, just not this\[1]. Second, the official Seedance 2.0 page offers two buttons, try it in Dreamina or get API access, with no downloads section\[2]. Third, no license exists that would even permit redistribution, which is what makes every "download Seedance weights" link a red flag by definition. The why is straightforward business: Seedance 2.0 sits at the top of the blind-test leaderboards\[7], powers paid products across ByteDance's apps, and spent its launch spring in copyright disputes serious enough to pause the global rollout. Companies do not open-weight that asset, and the tight content controls the model ships with, face detection and IP screening among them, only work while the weights stay behind an API. So when a YouTube tutorial promises Seedance on your RTX card, one of two things is inside: an open-weight model relabeled for clicks, or a paid wrapper around the same APIs everyone uses. The same ecosystem that spawned fake "official Seedance" subscription sites feeds this niche too; the receipts on those are in our [platform guide](/blog/what-is-seedance-2-0-and-how-to-use-it)\[3]. ## What you can actually run at home in 2026 The good news: local video generation is real, and two of the credible options carry a clean Apache-2.0 license. Verified against each project's official Hugging Face card on July 3, 2026\[4]\[5]\[8]: | Model | License | VRAM reality | | ------------------ | ------------------------- | -------------------------------------------------------------------------------- | | Wan 2.2 (TI2V-5B) | Apache-2.0 | \~24GB class\[4] | | Wan 2.2 (T2V-A14B) | Apache-2.0 | 80GB class\[4] | | Mochi 1 | Apache-2.0 | \~22GB in bf16 via diffusers, 60GB reference\[5] | | HunyuanVideo-1.5 | Tencent community license | from \~14GB with offloading\[8] | | CogVideoX1.5-5B | custom CogVideoX license | from \~10GB in BF16\[8] | | LTX-2.3 | LTX-2 community license | not stated on the card\[8] | Two honest footnotes. License first: only Wan and Mochi are unrestricted Apache-2.0; the community licenses on the others carry use conditions worth reading before commercial work. Quality second: these are capable models, and none of them is Seedance 2.0; the gap that keeps Seedance at #1 on the arenas\[7] does not close because the copy runs in your garage. A neat wrinkle if you like the Wan family: the open-weight Wan 2.2 you can self-host and the newer [Wan 2.7 served on reAPI](/models/wan-2-7-video) bracket the same lineage from both directions, local control on one side, current-generation quality on the other. ## The arithmetic that settles it Local costs hardware, power, and your evenings; APIs cost cents per second. A used 24GB card for the smaller local models runs several hundred dollars before electricity. On the API side, Seedance 2.0 Mini bills from $0.03/s and the full model from $0.0400/s with references on reAPI\[6]; the [full price map](/blog/cheapest-seedance-2-0-2026) works out to roughly 15 to 90 cents for a typical 5-second clip depending on tier. The decision rule I would actually use: run local when the point is unlimited experimentation, full pipeline control, offline privacy, or fine-tuning on an open model. Run the API when the point is Seedance-grade output shipping to an audience. Plenty of shops do both, prototyping prompts against a local Wan and rendering finals through the [Seedance 2.0 API](/models/seedance-2-0), one curl call per clip. ## FAQ ### Can I download Seedance 2.0 weights anywhere? No. ByteDance has released no Seedance weights, its Hugging Face orgs carry none\[1], and no redistribution license exists. Any download claiming otherwise is mislabeled or malicious. ### Is there an official Seedance desktop app? Access runs through Dreamina (and Jimeng in China) or API platforms\[2]. There is no offline desktop build; anything installable that generates without internet is not running Seedance. ### What is the closest local model to Seedance 2.0? For unrestricted licensing, Wan 2.2 (Apache-2.0) is the strongest open-weight family; HunyuanVideo-1.5 and LTX-2.3 are credible under community licenses\[4]\[8]. None matches Seedance's leaderboard position\[7]; all beat it on control and privacy. ### How much VRAM do I need for local video generation? Entry points start around 10GB (CogVideoX1.5-5B in BF16) and 14GB (HunyuanVideo-1.5 with offloading); comfortable Wan 2.2 5B work wants a 24GB card, and the 14B-class models want datacenter GPUs\[4]\[8]. ### Will Seedance ever go open weight? Nothing suggests it. The successor, Seedance 2.5, is arriving as another closed enterprise-beta release; our [pre-launch guide](/blog/seedance-2-5-what-we-know-2026) tracks it. ### What is the cheapest way to use the real Seedance 2.0? Per-second API billing: from $0.03/s for Mini with a video reference on reAPI, with signup credits to test the endpoint\[6]. ## Local for freedom, API for Seedance Wanting to run Seedance locally is really two wishes wearing one search query: control and quality. The control wish has genuine answers now, Wan 2.2 and Mochi 1 chief among them, and a hardware bill attached. The quality wish has exactly one answer, the hosted model, reachable for cents through the [Seedance 2.0 API on reAPI](/models/seedance-2-0). Pick per project, and stop downloading things named "seedance\_local\_v2.zip"; nobody who has the weights is giving them away, because nobody outside ByteDance has them. ## References 1. Hugging Face. *ByteDance and ByteDance-Seed organizations — model listings (no Seedance checkpoints).* Retrieved July 2026 from [huggingface.co/ByteDance](https://huggingface.co/ByteDance) 2. ByteDance Seed. *Seedance 2.0 — official model page (app and API access only).* Retrieved July 2026 from [seed.bytedance.com/en/seedance2\_0](https://seed.bytedance.com/en/seedance2_0) 3. reAPI. *What Is Seedance 2.0 and How to Use It — squatter-site documentation.* Retrieved July 2026 from [reapi.ai/blog/what-is-seedance-2-0-and-how-to-use-it](/blog/what-is-seedance-2-0-and-how-to-use-it) 4. Wan-AI. *Wan 2.2 model cards (T2V-A14B, TI2V-5B) — license and hardware notes.* Retrieved July 2026 from [huggingface.co/Wan-AI/Wan2.2-TI2V-5B](https://huggingface.co/Wan-AI/Wan2.2-TI2V-5B) 5. Genmo. *Mochi 1 model card — Apache-2.0, memory requirements.* Retrieved July 2026 from [huggingface.co/genmo/mochi-1-preview](https://huggingface.co/genmo/mochi-1-preview) 6. reAPI. *Seedance 2.0 Mini — model page and live pricing.* Retrieved July 2026 from [reapi.ai/models/seedance-2-0-mini](/models/seedance-2-0-mini) 7. Artificial Analysis. *Text to Video Leaderboard.* Retrieved July 2026 from [artificialanalysis.ai/video/leaderboard/text-to-video](https://artificialanalysis.ai/video/leaderboard/text-to-video) 8. Tencent, Lightricks, Zhipu. *HunyuanVideo-1.5, LTX-2.3, CogVideoX1.5-5B model cards.* Retrieved July 2026 from [huggingface.co/tencent/HunyuanVideo-1.5](https://huggingface.co/tencent/HunyuanVideo-1.5) ### Further reading * reAPI. *Cheapest Seedance 2.0 in 2026: Real Prices, Compared.* [reapi.ai/blog/cheapest-seedance-2-0-2026](/blog/cheapest-seedance-2-0-2026) * reAPI. *How to Use Seedance 2.0 for Free: What Actually Works.* [reapi.ai/blog/how-to-use-seedance-2-0-for-free](/blog/how-to-use-seedance-2-0-for-free) * reAPI. *Wan 2.7 Video on reAPI.* [reapi.ai/models/wan-2-7-video](/models/wan-2-7-video) --- # Can You Tell If a Writer Used ChatGPT? Patterns, Not Proof (https://reapi.ai/blog/can-you-tell-if-writer-used-chatgpt) You probably cannot prove that a writer used ChatGPT by circling one sentence. You can, however, notice when an article repeatedly chooses the safest possible opening, the neatest possible transition, and the vaguest possible conclusion. That distinction matters. A cluster of predictable writing habits may justify a closer read. It does not establish who—or what—wrote the page. Even purpose-built classifiers can produce false positives, and ordinary readers are less consistent than classifiers. The better question is not “Which forbidden phrase gives ChatGPT away?” It is “Does this article contain enough specific thought, evidence, and editorial judgment to earn trust?” This guide answers that question without pretending style is forensic evidence. ## TL;DR * **No single word, transition, metaphor, or punctuation mark proves ChatGPT use.** Human writers share every commonly cited “AI phrase.” * Suspicion usually comes from a **repeated combination**: interchangeable opening, over-signposting, symmetrical lists, vague authority, inflated significance, and a conclusion that restates rather than decides. * A polished article can be human, AI-assisted, heavily edited, or fully generated. The finished text rarely reveals a clean binary history. * AI detectors are useful as screening signals, not verdicts. OpenAI withdrew its own classifier in 2023 because of low accuracy, and published research has found false-positive risks for non-native English writers.\[2]\[3] * For editorial review, test **claims, sources, specificity, provenance, and revision history** before arguing over “AI-sounding” vocabulary. ## Why readers think they can spot ChatGPT writing Once a verbal habit has been labeled “AI,” it becomes difficult to stop seeing it. A transition such as “However, it is important to note” feels diagnostic because it is common, formal, and easy to remember. The same happens with em dashes, three-part lists, rhetorical questions, and endings about “the future.” The trouble is base rates. Those devices were common in corporate copy, student essays, journalism, and search-optimized articles long before ChatGPT. Language models learned them because people wrote them. Finding one in a new article is therefore compatible with several explanations: * the writer used ChatGPT and pasted the result; * the writer used an AI draft, then revised it; * the writer used AI only for grammar or structure; * the writer follows a conventional editorial template; * the writer simply likes that phrase. Matt Lillywhite's essay about commenters acting as “AI detectives” captures the social version of the problem: once someone learns a few supposed tells, almost any polished sentence can be made to look suspicious.\[1] The observation is useful. The certainty is not. ## Seven patterns that make writing feel AI-generated These are editorial symptoms, not proof of authorship. One occurrence means little. Repetition across the whole page is what makes the prose feel manufactured. ### 1. The opening could introduce almost any topic An interchangeable introduction announces that a subject is changing the world, asks whether the reader has ever wondered about it, then promises a comprehensive exploration. Replace the topic with cloud computing, espresso, or retirement planning and the paragraph still works. A stronger opening spends its first lines on a claim the article can actually defend: | Interchangeable opening | Specific opening | | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | “In today's rapidly evolving digital landscape, AI is transforming how we write.” | “A reader cannot prove ChatGPT use from one phrase; the useful evidence is a repeated lack of specificity.” | | Announces a broad trend | Makes a contestable claim | | Delays the answer | Starts with the answer | ### 2. Every paragraph arrives with a signpost Transitions are helpful until they begin narrating the existence of the article: “First and foremost,” “It is also worth noting,” “On the other hand,” “Ultimately,” “In conclusion.” The reader can feel the outline under every paragraph. Human editing often removes half of these bridges. When the next sentence logically follows, it does not need a crossing guard. ### 3. The rhythm never changes Generated prose often settles into similarly sized paragraphs and similarly balanced sentences. Each section explains a point, adds a caveat, and closes with a tidy implication. Nothing is technically wrong. Nothing surprises the ear. Good prose is not random, but it has pressure. A short sentence can stop an argument. A longer one can carry evidence and qualification together. A fragment, used deliberately, can change pace. Uniform rhythm makes even accurate information feel preassembled. ### 4. Lists are suspiciously complete Three benefits. Five challenges. Seven best practices. The number is chosen before the reporting is done, so every item receives equal visual weight even when only two matter. This is not an argument against lists. It is an argument for hierarchy. If one finding changes the decision and four are minor, the article should say so instead of presenting five democratic bullets. ### 5. Authority is invoked but never located Phrases such as “experts agree,” “studies show,” and “research suggests” create the shape of evidence without giving the reader anything to inspect. This problem is more serious than style because it can hide a fabricated or distorted claim. Replace vague authority with a named source, date, method, and limit. “A 2023 study tested seven detectors on TOEFL essays” is auditable. “Research proves AI detectors are biased” is a slogan. ### 6. Every observation becomes historic AI drafts are prone to significance inflation: a feature is “groundbreaking,” a workflow is a “game changer,” and every launch “marks a pivotal moment.” When every paragraph reaches for consequence, none of the consequences feel earned. Concrete effects are more persuasive. Say that a change removes one API call, cuts a batch from 20 minutes to 12, or lets an editor verify a source. Scale the adjective to the evidence. ### 7. The conclusion summarizes but never chooses Weak conclusions repeat the headings, say the future is exciting, and advise readers to embrace innovation responsibly. Strong conclusions resolve the tension introduced at the start. For this article, the resolution is simple: readers can recognize weak, generic writing, but should not convert that editorial judgment into a confident claim about authorship. ![A visual framework separating writing signals from evidence of authorship](https://cdn.reapi.ai/media/blog/can-you-tell-if-writer-used-chatgpt/can-you-tell-if-writer-used-chatgpt-signals-vs-proof.png) ## What is not reliable evidence of ChatGPT use Online checklists often treat ordinary language features as fingerprints. None of the following is reliable on its own: * em dashes or semicolons; * words such as “delve,” “nuanced,” “landscape,” or “tapestry”; * a three-item list; * grammatically clean prose; * headings and bullet points; * an analogy or decorative metaphor; * a low or high score from one detector; * publication frequency without access to the writer's workflow. The last item deserves care. Publishing several researched pieces every day may raise a reasonable operational question, especially for a solo author. It still does not tell you whether the work was generated, dictated, ghostwritten, collaboratively edited, or assembled from prior research. Ask for provenance rather than inventing it. ## Why AI detectors should not be treated as verdicts AI-text detection is classification under uncertainty. A tool estimates whether statistical patterns resemble examples in its training data. It does not recover a document's revision history. OpenAI retired its public AI-writing classifier after reporting a low accuracy rate. In its own challenge set, it caught only 26% of AI-written text as “likely AI-written” and mislabeled 9% of human text.\[2] Those figures describe one old classifier, not every current product, but they illustrate why a score needs context. A peer-reviewed 2023 study also found that several detectors disproportionately mislabeled writing by non-native English speakers.\[3] Later detector designs and evaluations may perform differently. The responsible conclusion is not “all detectors are useless.” It is that consequences should not rest on one opaque score. Use a detector to prioritize review, compare passages, or evaluate your own content pipeline. The [reAPI AI text detector](/docs/ai-text-detector), for example, returns a score that can be combined with editorial checks. Do not describe that score as proof. ## A fairer five-step review for suspicious writing ### 1. Separate quality from authorship Mark generic claims, repetition, weak sourcing, and factual errors without guessing how they were produced. A poor article remains poor even if a human wrote every word. A useful, accurately sourced article does not become useless merely because software assisted with a draft. ### 2. Verify the consequential claims Open the sources. Check whether the cited page supports the number, whether the date is current, and whether a comparison uses the same conditions. Fabricated references and confident mismatches are stronger editorial evidence of an unreliable process than any transition word. ### 3. Look for information gain Ask what the page contributes beyond the first five search results. Original testing, a worked example, a decision framework, a primary-source comparison, or a clear limitation all count. A beautifully formatted summary of summaries does not. Google's current guidance takes the same practical position: generative AI can help with research and structure, but scaled pages without added value may violate its spam policy; accuracy, quality, relevance, and context matter more than the mere presence of automation.\[4] ### 4. Check provenance when stakes are high For a newsroom, school, regulated workflow, or competition, ask for outlines, source notes, version history, or a disclosure of allowed tools. Process evidence is more useful than stylistic intuition because it addresses what actually happened. ### 5. Use a human decision Treat tool output and stylistic patterns as inputs. Let a qualified reviewer weigh the stakes, policy, evidence, and the author's response. If a false accusation could affect a grade, job, or reputation, the review threshold should be correspondingly high. ## A compact editor's checklist Before publishing, ask: * Does the first paragraph make a claim specific to this topic? * Does each section add evidence or a decision, rather than restate the premise? * Can the reader identify the source behind every important number? * Are limitations stated next to the claims they limit? * Does sentence length and paragraph shape vary naturally? * Have decorative transitions and inflated adjectives been cut? * Does the conclusion decide something? * If AI assisted the work, has a human verified every factual claim? If the answer is no, improve the article. Do that regardless of who drafted it. ## FAQ ### Can people accurately tell when writing is from ChatGPT? People can notice generic or repetitive prose, but style alone cannot reliably establish authorship. Human and AI writing overlap, and many documents are produced through mixed workflows. ### What words make writing look AI-generated? Words such as “delve,” “landscape,” and “nuanced” are frequently cited online, but no word proves AI use. Repetition, vagueness, weak evidence, and uniform structure are more useful editorial signals than vocabulary blacklists. ### Are AI detectors accurate? Accuracy varies by detector, text length, language, model, editing, and evaluation set. Use detector scores as screening signals and combine them with source checks and process evidence, especially when a false positive has consequences. ### Does Google penalize AI-written content? Google's guidance focuses on whether content is accurate, useful, original, and made for people. It warns against scaled generation without added value rather than declaring all AI-assisted content ineligible.\[4] ### Should writers disclose ChatGPT use? Follow the policy of the publisher, employer, school, or platform. When automation materially shaped reporting or the final text, a clear disclosure can give readers useful context. Grammar assistance may be treated differently from generated claims or passages. ## The useful tell is editorial, not forensic You may instantly know that a page is generic. You may know that it lacks sources, flattens every idea into the same cadence, and reaches a conclusion without making a decision. Those are valid reasons to stop reading or send the draft back. They are not proof that ChatGPT wrote it. The fairest standard is also the more demanding one: inspect what the article claims, what it adds, and how its author can support the process. That catches low-value content whether it came from a model, a content farm, or a tired human working from a template. ## References 1. Matt Lillywhite. *I'll Instantly Know A Writer Used ChatGPT When I See This.* The Daily Draft, July 2026. [medium.com](https://medium.com/the-daily-draft/ill-instantly-know-a-writer-used-chatgpt-when-i-see-this-7130506fe37e) 2. OpenAI. *New AI classifier for indicating AI-written text.* Updated July 2023. [openai.com](https://openai.com/index/new-ai-classifier-for-indicating-ai-written-text/) 3. Weixin Liang et al. *GPT detectors are biased against non-native English writers.* Patterns, 2023. [pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/37521038/) 4. Google Search Central. *Guidance on using generative AI content on your website.* Updated December 2025. [developers.google.com](https://developers.google.com/search/docs/fundamentals/using-gen-ai-content) ### Further reading * reAPI. *AI text detector API.* [reapi.ai/docs/ai-text-detector](/docs/ai-text-detector) * reAPI. *Humanize API.* [reapi.ai/docs/humanize](/docs/humanize) * reAPI. *Best Compilatio alternatives.* [reapi.ai/blog/best-compilatio-alternatives](/blog/best-compilatio-alternatives) --- # Cheapest Seedance 2.0 in 2026: Real Prices, Compared (https://reapi.ai/blog/cheapest-seedance-2-0-2026) "Where is Seedance 2.0 cheapest" is one of the most-searched questions about ByteDance's video model, and most answers you will find are subscription ads. So I priced every route I could verify on July 3, 2026, from the official token-billed API to per-second platforms to creative-suite subscriptions, using each provider's own published numbers. The cheapest Seedance 2.0 rate on the market right now is $0.03 per output second, and where you land between that and $1.00 per second depends on three choices: resolution, tier, and whether you attach references. Every number below has a source link, and the promotional prices are flagged, because two platforms were mid-sale when I checked. Prices move; the sourcing method doesn't. ## TL;DR * **The floor is $0.03/s** for Seedance 2.0 Mini at 480p with a video reference on reAPI, and $0.0400/s for the Fast tier at 480p with any reference\[1]\[2]. * **For pure text-to-video at 720p**, the official BytePlus API charges $0.1512/s\[3], Replicate $0.18/s\[4], fal.ai $0.3034/s\[5], reAPI Standard $0.1796/s or Fast $0.1444/s\[2]. * **References flip the ranking.** Replicate charges MORE with video input ($0.22/s at 720p)\[4]; reAPI charges less with any reference attached ($0.1086/s Standard, $0.0865/s Fast at 720p)\[2]. Most production workflows use references. * **Need 4K?** Only the official API ($0.7776/s) and Replicate ($1.00/s) list it; reAPI's Seedance lineup tops out at 1080p\[3]\[4]. * **Subscriptions rarely win on unit price.** Higgsfield's implied best case is $0.145/s at 720p, and that requires the $99/mo Ultra plan on annual billing\[6]; OpenArt and Pollo don't publish per-clip consumption at all\[7]\[8]. * Anything sold on a "seedance"-branded lookalike domain is a resold generation at a markup; see our [platform guide](/blog/what-is-seedance-2-0-and-how-to-use-it). ## The cheapest Seedance 2.0 rates, July 2026 All rates in USD per output second, text-to-video (no video input), as published on July 3, 2026. The official API bills per token; I converted using ByteDance's own formula, and the results match its published 5-second examples exactly\[3]. | Platform | 480p | 720p | 1080p | 4K | | ---------------------------------------------------------------------- | ------- | ------- | ------- | ------- | | BytePlus / Volcano (official)\[3] | $0.0703 | $0.1512 | $0.3742 | $0.7776 | | Replicate\[4] | $0.08 | $0.18 | $0.45 | $1.00 | | fal.ai\[5] | — | $0.3034 | $0.682 | — | | Higgsfield (implied, Ultra annual)\[6] | — | $0.145 | $0.297 | $0.726 | | reAPI Standard\[2] | $0.0834 | $0.1796 | $0.4048 | — | | reAPI Fast\[2] | $0.0672 | $0.1444 | — | — | | reAPI Mini\[1] | $0.048 | $0.103 | — | — | Three readings of that table. For pure 720p text-to-video on the Standard model, the official API is the sharpest per-second listing at $0.1512. For budget tiers, nothing beats Mini at $0.048 to $0.103. And fal.ai is the most expensive per-second route at every resolution it lists, roughly double the official rate at 720p. The official API's catch is the billing unit: you pay per token, computed from resolution times duration times 24fps\[9], prepaid through enterprise resource packs. Fine for platform engineering teams, overkill for shipping one feature. ## Reference inputs flip the ranking Here is the axis most price comparisons skip: what happens to the rate when you attach reference material, which is the whole point of Seedance 2.0. The platforms disagree on the *direction*. Replicate charges a surcharge for video input: 720p goes from $0.18/s to $0.22/s\[4]. The official API switches to a lower per-token price but adds your input duration into the token count\[3]. fal.ai discounts reference mode to 0.6x\[5]. And reAPI bills reference-mode generations lower across every cell: Standard 720p drops from $0.1796/s to $0.1086/s, Fast 720p from $0.1444/s to $0.0865/s, Fast 480p to $0.0400/s\[2]. So the "cheapest Seedance 2.0" answer depends on your workflow. If you generate from bare text prompts, official and reAPI Fast are within a cent of each other at 720p. If you attach character sheets, product shots, or video references, which is how most production pipelines run, reAPI's reference rates undercut the official text-to-video price by 28 to 43 percent, and the absolute floor is Mini at $0.03/s with a video reference\[1]. ## What 1,000 clips a month actually costs The worked example: 1,000 Seedance 2.0 clips of 5 seconds at 720p, a typical month for a faceless-content channel or an e-commerce catalog pipeline. That is 5,000 output seconds. | Route | Text-to-video | With references | | ----------------- | ------------- | -------------------------------------------------------------- | | Official BytePlus | $756 | $756+ (input tokens added)\[3] | | Replicate | $900 | $1,100\[4] | | fal.ai | $1,517 | \~$910\[5] | | reAPI Standard | $898 | $543\[2] | | reAPI Fast | $722 | $433\[2] | | reAPI Mini | $515 | $315 (video ref)\[1] | And the subscription route for the same job: Higgsfield prices a 5-second 720p generation at 22 credits, so 1,000 clips is 22,000 credits, while its largest plan includes 3,000 credits a month\[6]. The volume simply does not fit inside a creative-suite subscription; those plans are sized for tens of clips a month, not a thousand. If your clips tolerate the Fast or Mini tier, and for social-length content they usually do, the same monthly workload runs $315 to $722 instead of $756 to $1,517. Tier choice moves more money than platform choice. ## When a subscription does make sense Fairness to the subscription platforms: they bundle an editor, storage, and other models. If a person, not a pipeline, is making a handful of Seedance 2.0 videos inside a creative workflow, Higgsfield Plus or Krea Basic is a reasonable spend, and Krea's $9/mo entry (roughly 20 videos) is the cheapest way to *touch* Seedance 2.0 at all\[10]. The unit math just never wins. Higgsfield's best implied rate, $0.145/s at 720p, requires committing $1,188/year to the Ultra plan, and its $19 Starter tier does not include Seedance 2.0 at all\[6]. OpenArt and Pollo.ai advertise Seedance access from $14 to $15 a month but publish no per-clip credit cost, so their implied per-second price cannot be computed from public pages\[7]\[8]; opaque consumption is not where I would point a monthly budget. Both were also mid-promotion when I checked, so treat any price you see there as a sale price with an expiry. One more spend to avoid: the "seedance"-branded lookalike domains selling $15 to $100 monthly plans. They are unaffiliated resellers by their own terms pages, reselling generations you can buy directly for less. The receipts are in our [Seedance 2.0 platform guide](/blog/what-is-seedance-2-0-and-how-to-use-it). ## FAQ ### Where is Seedance 2.0 cheapest overall? At current published rates, the cheapest Seedance 2.0 generation anywhere is the Mini tier on reAPI: $0.048/s at 480p text-to-video, $0.03/s with a video reference\[1]. For the full-quality Standard model with references, reAPI's $0.1086/s at 720p leads\[2]; for bare text-to-video on Standard, the official API's $0.1512/s is the benchmark\[3]. ### How much does a 5-second Seedance 2.0 video cost? At 720p text-to-video: $0.76 official, $0.90 on Replicate, $1.52 on fal.ai, $0.90 on reAPI Standard or $0.72 on Fast, and $0.52 on Mini\[2]\[3]\[4]. A 15-second 1080p clip on the Standard tier runs $5.61 to $6.75 depending on route. ### What is the cheapest Seedance 2.0 API for 4K? The official BytePlus API at $0.7776/s; Replicate ($1.00/s) is the listed alternative\[3]\[4]. A 5-second 4K clip is $3.89 official. If 1080p is acceptable, reference mode on reAPI cuts the bill to $0.2456/s\[2]. ### Is the official Seedance API cheaper than resellers? For text-to-video on the Standard tier, usually yes. But it bills per token with prepaid resource packs, offers no cheaper reference mode for image refs, and requires enterprise onboarding. Per-second platforms with reference discounts beat it the moment references enter the workflow. ### Why does Seedance 2.0 pricing use tokens? ByteDance bills video like an LLM: tokens = pixels × frames ÷ 1,024, so cost scales exactly with resolution and duration\[9]. Per-second platforms pre-bake that math into flat rates, which is easier to budget but hides the resolution scaling until you switch tiers. ### Can I use Seedance 2.0 for free? Dreamina gives logged-in users daily credits, several API platforms include signup credit (reAPI included), and Krea's free tier allows under one clip a day\[10]. Free is for evaluation; every sustained route is metered. ### Is Seedance 2.0 Mini good enough to save the money? Mini serves 480p and 720p only and skips the priciest capabilities, but it shipped as a below-Fast price tier that pre-launch platform reporting claimed would outperform Fast. For social formats and drafts, start with Mini at $0.048/s and escalate only the clips that need Standard\[1]. ### Will Seedance 2.5 change these prices? Almost certainly, and nobody knows how yet: ByteDance has published no Seedance 2.5 pricing, and circulating guesses span $0.022 to $0.50 per second. Our [Seedance 2.5 pre-launch guide](/blog/seedance-2-5-what-we-know-2026) tracks what is actually confirmed. ## Where the floor actually is Match the tier to the job and the platform to the workflow. Bare text prompts at Standard quality: official API or reAPI Fast, a cent apart. Reference-driven production: reAPI's reference rates, $0.0400/s to $0.1086/s, are the working floor. Volume drafts and social clips: Mini at $0.03 to $0.103/s ends the discussion. The [live pricing table](/models/seedance-2-0#pricing) is always current, signup credits cover your own benchmark run, and that is the honest map of the cheapest Seedance 2.0 routes in July 2026. ## References 1. reAPI. *Seedance 2.0 Mini — model page and live pricing.* Retrieved July 2026 from [reapi.ai/models/seedance-2-0-mini](/models/seedance-2-0-mini) 2. reAPI. *Seedance 2.0 — model page and live pricing.* Retrieved July 2026 from [reapi.ai/models/seedance-2-0](/models/seedance-2-0) 3. BytePlus. *ModelArk — Seedance model pricing (token rates and 5-second examples).* Retrieved July 2026 from [docs.byteplus.com/en/docs/ModelArk/1544106](https://docs.byteplus.com/en/docs/ModelArk/1544106) 4. Replicate. *bytedance/seedance-2.0 — pricing.* Retrieved July 2026 from replicate.com/bytedance/seedance-2.0 5. fal.ai. *Seedance 2.0 — Text to Video.* Retrieved July 2026 from fal.ai/models/bytedance/seedance-2.0/text-to-video 6. Higgsfield. *Pricing.* Retrieved July 2026 from higgsfield.ai/pricing 7. OpenArt. *Pricing.* Retrieved July 2026 from openart.ai/pricing 8. Pollo.ai. *Pricing.* Retrieved July 2026 from pollo.ai/pricing 9. BytePlus. *ModelArk — video generation token calculation.* Retrieved July 2026 from [docs.byteplus.com/en/docs/ModelArk/1520757](https://docs.byteplus.com/en/docs/ModelArk/1520757) 10. Krea. *Video generation and plans.* Retrieved July 2026 from krea.ai/video ### Further reading * reAPI. *What Is Seedance 2.0 and How to Use It (2026 Guide).* [reapi.ai/blog/what-is-seedance-2-0-and-how-to-use-it](/blog/what-is-seedance-2-0-and-how-to-use-it) * reAPI. *Seedance 2.1 and Seedance 2.0 Mini: What's Actually Coming.* [reapi.ai/blog/seedance-2-1-and-seedance-2-0-mini-preview](/blog/seedance-2-1-and-seedance-2-0-mini-preview) * reAPI. *Seedance 2.0 API documentation.* [reapi.ai/docs/seedance-2-0](/docs/seedance-2-0) --- # Cheapest Veo 3.1 API in 2026: Every Provider's Real Price (https://reapi.ai/blog/cheapest-veo-3-1-api-2026) Search for the cheapest Veo 3.1 API and most roundups land you on $0.40 per second. That's Google's Standard tier on the Gemini API, and it's the most expensive way to call the model. If you don't need audio, 4K, or precise first/last-frame control, the same Veo 3.1 weights run for under 5 cents per 8-second 1080p clip on third-party gateways. Roughly a 95% cut. Google opened Veo 3.1 to the Gemini API in October 2025 and added Veo 3.1 Lite on March 31, 2026\[6]. Below is what every public tier actually costs in May 2026, with citations to each provider's pricing page. ## TL;DR * **Google Gemini API direct (audio bundled):** $0.05/sec (Lite 720p), $0.10–$0.12/sec (Fast 720p/1080p), $0.40/sec (Standard 1080p), $0.60/sec (Standard 4K)\[1]. * **fal.ai (audio toggleable):** $0.10/sec (Fast 1080p no audio), $0.20/sec (Standard 1080p no audio)\[2]. * **Replicate:** Veo 3.1 Fast at $0.10/sec without audio\[3]. * **reAPI per-generation tier:** $0.046 flat for an 8-second 1080p Lite clip, $0.092 flat for an 8-second 1080p Fast clip. Lowest rates I could find anywhere in May 2026\[4]. * The cheap rate forces a fixed 8-second clip with no audio. If you need audio, 4 or 6-second cuts, or first/last-frame control, you'll pay per second instead. The per-second tiers still beat Google's Standard rate by 20–60% on most providers. ## How Google prices Veo 3.1 Google bills per second of generated video. Three things change the rate: which model tier you pick (Standard, Fast, or Lite), the output resolution (720p, 1080p, or 4K), and whether audio is bundled. On Google direct, audio is always bundled; on most gateways, it's a toggle. Google's per-second rates from the Gemini API docs\[1]: | Tier | 720p | 1080p | 4K | | -------- | ----- | ----- | ------------- | | Standard | $0.40 | $0.40 | $0.60 | | Fast | $0.10 | $0.12 | $0.30 | | Lite | $0.05 | $0.08 | not supported | Audio is bundled in every cell. You can't strip it out to save money on Google direct. There's no free tier either; every successful generation gets billed from second one. Eight seconds is what most users actually generate. At that length: * Standard 1080p with audio: **$3.20** per video * Fast 1080p with audio: **$0.96** per video * Lite 720p with audio: **$0.40** per video That's the floor going through Google. The third-party gateways are cheaper. ## What gateways charge ### fal.ai fal.ai breaks the price down by tier and an audio on/off toggle\[2]: | Tier | Audio | 720p / 1080p | 4K | | -------- | ----- | -------------------- | -------------------- | | Standard | off | $0.20/s → $1.60 / 8s | $0.40/s → $3.20 / 8s | | Standard | on | $0.40/s → $3.20 / 8s | $0.60/s → $4.80 / 8s | | Fast | off | $0.10/s → $0.80 / 8s | $0.30/s → $2.40 / 8s | | Fast | on | $0.15/s → $1.20 / 8s | $0.35/s → $2.80 / 8s | Stripping audio saves 50% on Standard and about 33% on Fast. Google doesn't expose that control. ### Replicate Replicate charges $0.10/sec for Veo 3.1 Fast without audio\[3]. Same as fal.ai's no-audio Fast rate. The Standard tier and 4K cells aren't listed publicly on Replicate. ### OpenRouter OpenRouter shows "from $0.40/sec" and routes the call to whatever underlying provider it picks\[5]. The floor lines up with Google's Standard tier. ### reAPI reAPI runs two billing modes side by side\[4]. **Per-generation tier — flat price for one 8-second clip, no audio:** | Tier | 720p / 1080p | 4K | | ------- | ------------ | ------ | | Lite | **$0.046** | $0.138 | | Fast | **$0.092** | $0.276 | | Quality | $0.69 | $2.21 | **Per-second tier — same billing model as Google, with first/last-frame control and optional audio:** | Tier | 720p/1080p no audio | 720p/1080p audio | 4K (audio) | | ---------------- | ------------------- | ---------------- | ---------- | | Fast Official | $0.092/s | $0.138/s | $0.322/s | | Quality Official | $0.184/s | $0.368/s | $0.552/s | $0.046 for an 8-second 1080p Lite clip on the per-generation tier is the lowest Veo 3.1 rate I could find publicly listed anywhere in May 2026. ## What 1,000 videos a month costs Take a workload that's actually common: 1,000 eight-second 1080p clips, no audio. Think ads, social loops, B-roll for voice-over. | Provider | Tier | 1,000 × 8s 1080p | Notes | | ----------------- | ---------------------- | ---------------- | -------------------------------------- | | Google Gemini API | Fast (audio mandatory) | **$960** | Cheapest Google option; audio bundled. | | fal.ai | Fast (no audio) | $800 | | | Replicate | Fast (no audio) | $800 | | | reAPI | Fast (per-generation) | **$92** | Fixed 8s, no audio. | | reAPI | Lite (per-generation) | **$46** | 720p ceiling at this rate. | If you can live with a fixed 8-second clip and no audio, the per-generation tiers run 88–95% cheaper than the next-cheapest option. ## When you'll need the per-second tier The per-generation rate has limits. If any of these matter, price on per-second: * **Audio.** Per-generation tiers don't include synthesized audio. A Fast Official 1080p run with audio comes out to $0.138 × 8 = $1.10 — 73% below Google Standard, 8% below fal.ai's Fast with audio, but \~15% above Google Fast. * **Variable duration.** Per-generation locks at 8 seconds. Per-second exposes 4 / 6 / 8 second outputs. * **First/last-frame interpolation.** Per-generation Fast supports up to 3 reference frames for image-to-video. First-frame plus last-frame anchoring is per-second only. * **4K resolution.** Per-generation 4K cells exist at $0.138 (Lite), $0.276 (Fast), $2.21 (Quality). For premium-quality 4K with audio, the per-second 4K cell at $0.322/s × 8 = $2.58 is the comparable choice. * **Negative prompts, seed, sample\_count, person\_generation.** Per-second only. Even on the per-second side, reAPI's Fast Official no-audio cell at $0.092/sec is 8% cheaper than fal.ai or Replicate, and 23% cheaper than Google's $0.12/sec 1080p Fast (which forces you to pay for audio). ## Faceless-channel math Picture a daily 90-second video stitched from twelve 8-second 1080p clips, audio dubbed in post. That's 360 clips a month: * Google Gemini API Fast: 360 × $0.96 = **$345.60 / month** * fal.ai Fast (no audio): 360 × $0.80 = **$288.00 / month** * reAPI Fast (per-generation): 360 × $0.092 = **$33.12 / month** * reAPI Lite (per-generation, 720p): 360 × $0.046 = **$16.56 / month** reAPI Lite is 95% cheaper than Google direct for this exact workload. The 720p ceiling stings less than it sounds: Shorts, Reels, and TikTok all re-encode aggressively at delivery and most strip down to 1080p × 30fps no matter what you fed in. Paying for 4K on short-form vertical content is mostly dead money. ## When Google direct still wins Some workloads still belong on Google's first-party API: 1. You're inside an enterprise contract with negotiated Vertex AI rates. 2. You need data residency guarantees Vertex offers and gateways don't. 3. You're using Veo 3.1 alongside Gemini text models in a single billable account for procurement reasons. 4. You need the latest preview model the same hour Google ships it. Gateways generally catch up within hours, occasionally a day or two. ## Calling the cheapest Veo 3.1 API tier reAPI exposes Veo 3.1 through one OpenAI-compatible endpoint: ```bash curl https://reapi.ai/api/v1/videos/generations \ -H "Authorization: Bearer rk_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "model": "veo3.1-lite", "prompt": "A dolphin leaping through cobalt ocean waves at sunrise", "aspect_ratio": "16:9", "resolution": "720p" }' ``` The endpoint returns a `task_id` immediately; poll `GET /api/v1/tasks/{task_id}` until status is `completed`. Full schema and SDK examples in Python, Node.js, and Go are on the [Veo 3.1 docs page](/docs/veo3-1). To switch to Fast per-generation, change `"model": "veo3.1-lite"` to `"veo3.1-fast"` and bump `resolution` to `1080p`. The request shape is identical across the family. ## FAQ ### What's the absolute cheapest Veo 3.1 API price in 2026? $0.046 for an 8-second 1080p Veo 3.1 Lite clip on reAPI's per-generation tier (no audio, fixed duration). I could not find a lower per-second or per-generation listed rate across Google, fal.ai, Replicate, or OpenRouter in May 2026. ### Does Veo 3.1 have a free tier? No. Veo 3.1 is paid-tier only on the Gemini API and Vertex AI. New Google Cloud accounts get a $300 / 90-day credit that can be applied to Veo, which works out to roughly 6,000 seconds of Lite 720p generation. Third-party gateways generally don't offer free Veo generations either. ### Why is the per-generation rate so much cheaper than the per-second rate? Per-generation pricing locks the output to the most common shape: 8 seconds, 1080p or below, no audio. That fixed shape lets the gateway batch and forecast compute differently. You give up flexibility (variable duration, audio, first/last-frame anchoring) for the lower headline price. If your product only ever needs an 8-second clip, per-generation is the cheaper math. ### Can I get Veo 3.1 with audio under $0.10/second? Not from any provider I checked in May 2026. Google Gemini API Fast at $0.10–$0.12/sec for 720p–1080p is the cheapest public per-second rate that bundles audio. reAPI's Fast Official with audio is $0.138/sec; fal.ai's Fast with audio is $0.15/sec. ### How does Veo 3.1 Lite compare to Veo 3.1 Fast on quality? Google's release post says Lite delivers "the same speed" as Fast at "less than 50% of the cost," and supports both Text-to-Video and Image-to-Video at 720p and 1080p\[6]. Lite caps at 1080p (no 4K). Subjective output is about a half-tier below Fast on motion fidelity and physical plausibility. Fine for short loops and B-roll. Less ideal for hero shots. ### Do third-party gateways add latency vs Google direct? Barely. Generation itself takes 60 to 180 seconds for an 8-second clip, so the API hop is noise compared to that. Gateway overhead is single-digit percent of wall-clock time, mostly job queueing rather than network round-trip. ### What happens if a Veo 3.1 generation fails? On Google direct, you're not billed for failed generations. Same on reAPI: failed jobs trigger an automatic credit refund. Confirm the failure semantics on your provider before scaling, because client-side retry loops on partial failures can stack costs if the provider charges for upstream-attempted-but-failed jobs. ### Is there a way to mix tiers in one application? Yes. Default to the cheapest tier that satisfies your output spec, then upgrade per-request when needed. On reAPI, the same endpoint serves all five Veo 3.1 model strings — switching from `veo3.1-lite` to `veo3.1-fast-official` is a one-field change, no SDK swap. ## Picking a tier in practice Most product workloads can live with a fixed 8-second clip and no audio. For those, reAPI's per-generation Lite or Fast tier ($0.046–$0.092 per 8-second 1080p clip) runs 88–95% cheaper than Google direct, fal.ai, or Replicate. If you need audio, variable duration, or first/last-frame anchoring, you're on a per-second tier across all providers. reAPI's $0.092/sec Fast Official no-audio cell is still the cheapest of those. The Standard tier at $0.40/sec really only makes sense inside an enterprise Vertex contract. The cheapest Veo 3.1 API path for almost every other workload is one of the per-generation tiers above. ## References 1. Google. *Gemini API pricing — Veo 3.1 per-second rates by tier and resolution.* Retrieved May 2026 from [ai.google.dev/gemini-api/docs/pricing](https://ai.google.dev/gemini-api/docs/pricing) 2. fal.ai. *Veo 3.1 — Text to Video.* Retrieved May 2026 from fal.ai/models/fal-ai/veo3.1 3. Replicate. *Google Veo 3.1.* Retrieved May 2026 from replicate.com/google/veo-3.1 4. reAPI. *Veo 3.1 — Model page (live pricing).* Retrieved May 2026 from [reapi.ai/models/veo3-1](/models/veo3-1) 5. OpenRouter. *Veo 3.1 — API pricing & providers.* Retrieved May 2026 from openrouter.ai/google/veo-3.1 6. Google. *Build with Veo 3.1 Lite, our most cost-effective video generation model.* The Keyword (Google blog), March 31, 2026. [blog.google/innovation-and-ai/technology/ai/veo-3-1-lite](https://blog.google/innovation-and-ai/technology/ai/veo-3-1-lite/) ### Further reading * Google Cloud. *Vertex AI generative AI pricing.* [cloud.google.com/vertex-ai/generative-ai/pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing) * Google Cloud. *Veo 3.1 — Vertex AI model documentation.* [docs.cloud.google.com/vertex-ai/.../veo/3-1-generate](https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models/veo/3-1-generate) * fal.ai. *Veo 3.1 Fast — Text to Video.* fal.ai/models/fal-ai/veo3.1/fast * reAPI. *Veo 3.1 — API reference.* [reapi.ai/docs/veo3-1](/docs/veo3-1) --- # What Is the Context Window in Claude, and What Counts (https://reapi.ai/blog/claude-context-window) The context window is everything Claude can reference while generating a response, including the response itself. Anthropic calls it working memory, as distinct from the training corpus\[1]. The part worth internalizing is the sentence Anthropic puts right after that definition: **more context is not automatically better**. As token count grows, accuracy and recall degrade, a phenomenon the documentation names *context rot*\[1]. Curating what goes in matters as much as how much room there is. ## TL;DR * **1M tokens on current models**: Opus 5, Opus 4.8/4.7/4.6, Sonnet 5, Sonnet 4.6, Fable 5, Mythos 5. Others including Sonnet 4.5 are 200k\[1]. * **1M is the default.** No beta header, and long-context requests bill at standard pricing\[1]. * **Output counts too**, including extended thinking, and `max_tokens` caps 128k on 1M-window models\[1]. * **Everything in the request counts**: system prompt, every message, tool results, images, documents, and tool definitions\[1]. * **Newer models keep previous thinking blocks** by default, so they bill as input on later turns\[1]. * **Sonnet models get a live token budget injected; Opus and Fable do not**\[1]. ## What actually counts ![What occupies a Claude context window: system prompt, tool definitions, messages with tool results and images, retained thinking blocks billed as input again, and this turn output capped at 128k](https://cdn.reapi.ai/media/blog/claude-context-window/counts.png) The common mistake is budgeting only for the conversation. The full list\[1]: * The **system prompt** * Every message in `messages`, including **tool results, images, and documents** * Your **tool definitions** * The **output** Claude generates this turn, including its extended thinking Every response reports what the request consumed in its `usage` field. With prompt caching the input count splits across `input_tokens`, `cache_read_input_tokens`, and `cache_creation_input_tokens`, and **all three count toward the window**\[1]. Cached does not mean free of the window; it means cheaper per token. To size a request before sending it, use the token counting API rather than estimating from character count. ## Sizes, and what 1M actually costs | Models | Context window | | ------------------------------------ | -------------- | | Opus 5, Opus 4.8, Opus 4.7, Opus 4.6 | 1M | | Sonnet 5, Sonnet 4.6 | 1M | | Fable 5, Mythos 5 | 1M | | Sonnet 4.5 and other earlier models | 200k | Two details that save money and confusion\[1]: **1M is the default on those models.** There is no beta header to send, and a 900k-token request bills at the same per-token rate as a 9k one. There is no long-context surcharge. **Max output is 128k** on any 1M-window model, regardless of how much input room remains. A single request can carry up to **600 images or PDF pages** (100 on 200k-window models), and large payloads can hit request-size limits before they hit the token limit\[1]. ## Thinking changes the arithmetic Thinking tokens are a subset of `max_tokens`, bill as output, and count toward rate limits. With adaptive thinking the allocation varies per request, so the usage is not predictable from prompt length alone\[1]. The behavior that surprises people is what happens to *previous* turns' thinking. **On Opus 4.5 and later, Sonnet 4.6 and later, Fable 5, and Mythos 5, the API keeps previous thinking blocks by default**, and they count toward the window like any other input tokens. They were billed once as output when generated, and the kept blocks are then billed as input on every later request that carries them\[1]. On earlier Opus and Sonnet models and all Haiku models, the API strips them automatically when you pass them back. If a long agentic conversation is consuming context faster than the visible transcript explains, retained thinking is usually why. Thinking block clearing overrides the default in either direction. ## Context awareness: some models know, some do not This is the split most people are unaware of\[1]. **Sonnet 5, Sonnet 4.6, Sonnet 4.5, and Haiku 4.5 track their remaining budget.** The API injects the total into the system prompt of every request: ```xml 200000 ``` and updates it after each tool call: ```xml Token usage: 35000/200000; 165000 remaining ``` This is automatic. You never send these tags yourself, and image tokens are included in the counts. **Opus 4.7 and later, Fable 5, and Mythos 5 do not receive these tags.** For those, give the model an explicit budget with task budgets, currently in beta. The practical consequence: a Sonnet model can pace a long task against the space that remains, while an Opus model cannot unless you tell it. That is a real behavioral difference between tiers that has nothing to do with capability scores. ## When conversations outgrow the window Two server-side mechanisms, both worth knowing before you build your own truncation\[1]. **Compaction** automatically summarizes earlier parts of the conversation on the server so it can continue past the limit. Beta, on Claude 4.6 and later. **Context editing** offers more targeted strategies, including clearing old tool results in agentic workflows, which is usually where the bulk of a long conversation's tokens actually live. Reaching for either is better than a homegrown "drop the oldest messages" loop, which tends to discard the system-level context that made the conversation coherent. ## Working with it **Curate, do not fill.** Context rot is documented behavior, not a rumor. A 900k-token prompt is not automatically better than a well-chosen 90k one. **Count tool definitions.** They are in every request, and a large tool schema is a fixed tax on every turn. **Watch retained thinking** on newer models during long agentic runs. **Pick the tier with the behavior you need.** If a model needs to pace itself across a long task, Sonnet's injected budget does that natively. ```python from openai import OpenAI client = OpenAI(api_key="YOUR_REAPI_KEY", base_url="https://api.reapi.ai/v1") resp = client.chat.completions.create( model="claude-opus-5", messages=[{"role": "user", "content": "Read this repository and summarize the architecture."}], max_tokens=16000, ) print(resp.usage) # the number to reconcile against ``` Rates for the 1M-window models are on [reapi.ai/models](/models). ## FAQ ### What is the context window in Claude? All the text the model can reference while generating a response, including the response itself. It is working memory, not training data\[1]. ### How big is Claude's context window? 1M tokens on Opus 5, Opus 4.8/4.7/4.6, Sonnet 5, Sonnet 4.6, Fable 5, and Mythos 5. Earlier models including Sonnet 4.5 are 200k\[1]. ### Does using the full 1M window cost extra? No. On models with a 1M window, 1M is the default and requests bill at standard pricing with no long-context surcharge\[1]. ### What counts toward the context window? System prompt, all messages including tool results and images and documents, tool definitions, and the output including extended thinking. Cached input counts too\[1]. ### Why is my context filling faster than the conversation suggests? On newer models the API keeps previous thinking blocks by default, and they count as input on later turns\[1]. ### Is more context always better? No. Anthropic documents that accuracy and recall degrade as token count grows, a phenomenon called context rot\[1]. ### How many images can one request carry? Up to 600 images or PDF pages on 1M-window models, 100 on 200k-window models, subject to request size limits\[1]. ### What happens when a conversation exceeds the window? Use server-side compaction, which summarizes earlier turns so the conversation continues, or context editing to clear old tool results\[1]. ## Budgeting the window instead of filling it The number everyone quotes about the context window in Claude is 1M, and it is the least interesting fact about it. What decides whether a long-context integration works is the accounting: tool definitions riding along on every turn, retained thinking blocks billing as input, cached tokens still consuming space, and output competing for the same budget. Anthropic's own framing is the right one to adopt. The window is working memory, more of it is not automatically better, and what you choose to put in it matters more than how much room is left. ## References 1. Anthropic. *Context windows — sizes by model, what counts, thinking behavior, context awareness, compaction, and overflow.* Retrieved July 2026 from [docs.claude.com/en/docs/build-with-claude/context-windows](https://docs.claude.com/en/docs/build-with-claude/context-windows) ### Further reading * reAPI. *How to use Claude Opus 5.* [reapi.ai/blog/how-to-use-claude-opus-5](/blog/how-to-use-claude-opus-5) * reAPI. *Which Claude model is best for coding.* [reapi.ai/blog/best-claude-model-for-coding](/blog/best-claude-model-for-coding) * reAPI. *Model catalog.* [reapi.ai/models](/models) --- # CLAUDE.md: The Simple File That Makes Coding Agents Better (https://reapi.ai/blog/claude-md-coding-agent-guide) A good `CLAUDE.md` does not make the model smarter. It makes the assignment less ambiguous every time the agent enters your repository. That modest mechanism explains why a repository built around four plain-language coding rules became one of 2026's most visible agent projects. The instructions tell the agent to surface assumptions, prefer simple implementations, keep changes surgical, and define verifiable success. None is novel software engineering. Putting all four into context before every task is the useful part. The viral headline said one file reached 91,000 GitHub stars. By August 2, 2026, the repository had moved from `forrestchang` to `multica-ai`, grown into plugins and editor rules, and reached **198,529 stars** according to GitHub's API.\[1] The number will keep changing. The durable lesson is how small, persistent instructions change agent behavior. ## TL;DR * `CLAUDE.md` is a Markdown file containing persistent instructions that Claude Code loads as context.\[2] * The viral repository condensed common agent failures into four rules: **think before coding, simplicity first, surgical changes, and goal-driven execution**.\[3] * The file works best when it contains facts and rules needed in almost every session: commands, architecture, conventions, boundaries, and verification. * `CLAUDE.md` is context, not enforcement. Use permissions or hooks for actions that must be technically blocked.\[2] * Keep task-specific procedures in skills and file-specific guidance in `.claude/rules/`; loading everything globally wastes context. * A useful file is short enough to maintain, specific enough to test, and revised whenever the agent repeats a mistake. ## What is CLAUDE.md? `CLAUDE.md` is Claude Code's project instruction file. It is ordinary Markdown, usually committed at the repository root, that gives the agent durable context such as: * how to install, test, build, and format the project; * the parts of the architecture that are not obvious from filenames; * naming and code-style conventions; * which generated files should not be edited manually; * which checks must pass before a task is complete; * repository-specific safety boundaries. Claude Code reads the file at the beginning of a session. Anthropic describes it as one of two memory mechanisms: people write `CLAUDE.md` instructions, while Claude's auto memory stores patterns it learns from corrections.\[2] That sounds like configuration, but Anthropic makes an important distinction. These instructions enter the model's context; they are not hard controls. If “never deploy production” must be guaranteed, a `PreToolUse` hook or permission boundary is the appropriate layer. A sentence in Markdown can guide behavior. It cannot provide a security guarantee. ## Why the four-rule file went viral The repository now called `multica-ai/andrej-karpathy-skills` says its guidelines were derived from Andrej Karpathy's public observations about coding-model failure modes.\[3] Its popularity is easy to overcomplicate. Each rule maps a familiar frustration to a behavior the agent can perform. | Common failure | Persistent instruction | Observable result | | ----------------------------------------- | ---------------------- | ---------------------------------------------- | | Agent silently guesses what you meant | Think before coding | Assumptions and ambiguity surface before edits | | Small request turns into a framework | Simplicity first | Fewer speculative abstractions and less code | | Unrelated files change “while we're here” | Surgical changes | Smaller diffs that trace to the request | | Agent declares success without proving it | Goal-driven execution | Tests and success criteria close the loop | These rules do not teach TypeScript, database design, or debugging. They shape how the model approaches uncertainty and scope. That makes them reusable across repositories. The simplicity is also social. A team can read four principles in two minutes, disagree with one, edit it, and review the change in Git. There is no hidden prompt platform to administer. ## The four principles, translated into project behavior ### 1. Think before coding The original guideline asks the agent to state assumptions, present multiple interpretations when necessary, push back on unnecessary complexity, and stop when genuinely confused.\[3] Project-specific wording makes it stronger: ```md Before changing an API contract, identify every in-repo consumer and state whether the change is backward compatible. If product behavior is ambiguous, stop and ask; do not choose a behavior silently. ``` The generic principle sets posture. The concrete addition tells the agent where wrong assumptions are expensive. ### 2. Simplicity first “Do not overengineer” is directionally useful but difficult to verify. Add the repository's local definition of simple: ```md Prefer an existing utility over a new abstraction. Do not introduce a service, factory, or configuration flag for one call site. Implement only the requested behavior; list optional follow-ups instead of building them. ``` This reduces a predictable model tendency: solving a hypothetical family of future problems instead of the current one. ### 3. Surgical changes Agents see nearby cleanup opportunities because they read broadly. That does not mean a task authorizes every cleanup. ```md Every changed line must trace to the request. Preserve surrounding formatting and naming. Remove imports made unused by your edit, but report unrelated dead code instead of deleting it. ``` Small diffs are easier to review, test, revert, and assign. They also reduce the chance that an agent breaks something whose purpose it did not understand. ### 4. Goal-driven execution An instruction such as “make it work” leaves the end state undefined. Translate the task into a result the agent can check: ```md For bug fixes, reproduce the failure with a test before changing production code. Run the narrowest relevant checks during iteration and the required project checks before completion. Report commands and outcomes. ``` This is where autonomy becomes useful. When success is observable, the agent can iterate on failures instead of stopping after the first plausible edit. ![A project-instruction map showing commands, boundaries, style, and verification flowing into coding-agent behavior](https://cdn.reapi.ai/media/blog/claude-md-coding-agent-guide/claude-md-coding-agent-guide-instruction-map.png) ## What belongs in CLAUDE.md Anthropic recommends keeping facts in `CLAUDE.md` that Claude should hold in every session, and moving multi-step or narrow procedures to more targeted mechanisms.\[2] A useful test is: “Would I repeat this during onboarding for almost every task?” ### Put these in the root file * one-paragraph project and architecture description; * package manager and canonical install, dev, test, type-check, and build commands; * directory ownership and generated-file boundaries; * rules that apply across languages or packages; * definition of done; * high-frequency mistakes and their correction; * where to find deeper instructions. ### Put these somewhere else | Information | Better location | Why | | ---------------------------------------- | ----------------------------------- | ------------------------------------------------------------- | | Personal sandbox URL or local preference | `CLAUDE.local.md` | Applies to one developer and should usually be ignored by Git | | Rules only for `src/api/**` | `.claude/rules/api.md` with `paths` | Loads when relevant instead of every session | | A release or migration procedure | Skill | Multi-step workflow is invoked only when needed | | A command that must never run | Permission or hook | Enforcement should not depend on model compliance | | Temporary task details | Current prompt or issue | They will become stale in persistent context | | Long design documentation | Existing docs, linked concisely | Avoid paying the context cost on every task | ## A concise CLAUDE.md template Copy this as a starting point, then replace every bracketed item. Delete sections that do not constrain your project. ```md # Project instructions ## Project [One paragraph: what this repository ships, its main runtime, and the most important architectural boundary.] ## Commands - Install: `[command]` - Develop: `[command]` - Focused test: `[command with file or pattern]` - Full test: `[command]` - Type-check: `[command]` - Build: `[command]` ## Before editing - Read the nearest existing implementation and tests before proposing a change. - State assumptions that affect public behavior, data, security, or compatibility. - If the request has multiple materially different interpretations, ask. ## Scope - Implement only the requested behavior. - Prefer existing patterns and utilities over new abstractions. - Keep diffs surgical; do not refactor adjacent code unless required. - Remove only dead code created by your change. ## Project boundaries - `[path]` is generated; change `[source path or command]` instead. - `[package]` owns `[responsibility]`; do not duplicate it in `[other package]`. - Never expose `[secret or private data category]` in logs or fixtures. ## Style - [Two to five rules that differ from formatter defaults or are easy to miss.] - Match the surrounding file when no explicit rule applies. ## Verification - For a bug fix, add or update a test that fails before the fix. - During iteration, run the narrowest relevant check. - Before completion, run: `[required commands]`. - Report changed files, commands run, outcomes, and any unverified risk. ## Deeper instructions - API work: `.claude/rules/api.md` - Database changes: `[skill or documentation path]` - Releases: `[skill or documentation path]` ``` The template is intentionally plain. A `CLAUDE.md` should not read like a motivational manifesto. It should reduce decisions the agent would otherwise have to guess. ## How Claude Code loads multiple instruction files Claude Code walks up the directory tree from the current working directory and loads `CLAUDE.md` and `CLAUDE.local.md` files it finds. Instructions closer to the launch directory appear later in context. Nested files below the working directory load when Claude reads files in those subdirectories.\[2] For a monorepo, that allows a useful hierarchy: ```text repo/ ├── CLAUDE.md # Organization-wide project facts ├── .claude/ │ └── rules/ │ ├── testing.md # Unscoped shared rule │ └── api.md # paths: packages/api/** ├── packages/ │ ├── web/ │ │ └── CLAUDE.md # Web-specific architecture and checks │ └── worker/ │ └── CLAUDE.md # Worker runtime constraints └── CLAUDE.local.md # Developer-only local notes ``` Files are concatenated as context rather than behaving like a strict configuration override. Contradictory rules may therefore produce inconsistent behavior. Review the hierarchy periodically and remove stale instructions. ## How to improve the file from real failures Do not attempt to predict every possible mistake on day one. Start small and use repeated friction as the backlog. 1. **Record the failure.** What did the agent do, and what did you expect? 2. **Find the right layer.** Is this a universal instruction, path-specific rule, task procedure, or hard safety control? 3. **Write an observable rule.** Replace “be careful” with the action and condition. 4. **Test it on a similar task.** Confirm behavior improves without blocking trivial work. 5. **Delete stale rules.** Context has a cost; an obsolete instruction can be worse than no instruction. Anthropic's practical trigger is memorable: add something when Claude makes the same mistake a second time, when code review catches knowledge the agent should have had, or when you repeat the same correction across sessions.\[2] ## Five CLAUDE.md mistakes to avoid ### Writing aspirations instead of instructions “Write excellent, robust code” gives no new information. “Run `pnpm test --filter api` after changes under `packages/api`” can be followed and checked. ### Copying a giant generic rulebook A public template can provide ideas, but every unconditional line consumes context and may conflict with the project. Keep the four broad behavioral principles if they help; replace generic technology advice with local facts. ### Encoding facts the agent can cheaply discover You rarely need to list every directory. Explain boundaries that filenames do not reveal, such as which package owns authorization or which source generates a checked-in client. ### Treating instructions as security controls Never rely on “do not read secrets” or “do not deploy” as the only protection. Use scoped credentials, permissions, sandboxing, and hooks for hard boundaries. ### Never reviewing the file Commands change, packages move, and old exceptions become default behavior. Assign ownership and review `CLAUDE.md` like code. ## How to know whether it is working Avoid judging the file by whether one demo looks impressive. Measure work the team already reviews: * median changed lines per completed task; * unrelated files touched; * review comments caused by repository-convention violations; * first-pass test success; * tasks reopened after a claimed completion; * repeated clarifications that should become persistent context. The viral repository suggests the same outcome-level tests: fewer unnecessary diff changes, fewer rewrites caused by overcomplication, and clarification before implementation rather than after mistakes.\[3] ## FAQ ### Where should CLAUDE.md go? For team-shared project instructions, place it at `./CLAUDE.md` or `./.claude/CLAUDE.md` and commit it. Use `~/.claude/CLAUDE.md` for personal instructions across projects and `CLAUDE.local.md` for personal notes in one project.\[2] ### Does CLAUDE.md work with Cursor or other coding agents? `CLAUDE.md` is a Claude Code convention. The viral repository also ships Cursor rules and a plugin, while other agents may use files such as `AGENTS.md` or product-specific rule directories. Keep a canonical source and adapt it deliberately rather than assuming every tool loads the same file. ### How long should CLAUDE.md be? There is no universal line count. It should contain only information valuable in nearly every session. If a section applies to one directory or one workflow, move it to a path-scoped rule or skill. ### Can CLAUDE.md stop destructive commands? It can instruct Claude not to run them, but Anthropic explicitly describes the file as context rather than enforced configuration. Use permissions or hooks for reliable prevention.\[2] ### How do I create the first file? Run `/init` in Claude Code to generate a starter `CLAUDE.md`, or create the Markdown file manually. Then run `/context` to confirm it loaded and `/memory` to inspect or edit memory files.\[4] ## The file is simple because the problem is repetitive Coding agents do not need a 500-line constitution before they can fix a bug. They need a few project facts they cannot infer, a clear boundary around the requested change, and a check that distinguishes completion from confidence. That is why four ordinary rules traveled so far. They address mistakes developers see every day, live in a format the whole team can edit, and load before the agent starts making decisions. Begin there. Add project knowledge only when it prevents a real failure, and enforce critical boundaries outside the prompt. If you are new to the tool itself, start with the broader [guide to using Claude Code](/blog/how-to-use-claude-code). Use this article when the installation is finished and the next question is what your agent should know every time it enters the repo. ## References 1. GitHub REST API. *multica-ai/andrej-karpathy-skills repository metadata.* Retrieved August 2, 2026. [api.github.com](https://api.github.com/repos/multica-ai/andrej-karpathy-skills) 2. Anthropic. *How Claude remembers your project.* Claude Code Docs. Retrieved August 2026. [code.claude.com](https://code.claude.com/docs/en/memory) 3. multica-ai. *Karpathy-Inspired Claude Code Guidelines.* GitHub. Retrieved August 2026. [github.com](https://github.com/multica-ai/andrej-karpathy-skills) 4. Anthropic. *Claude Code commands.* Retrieved August 2026. [code.claude.com](https://code.claude.com/docs/en/commands) 5. Sumit Pandey. *A Single CLAUDE.md File Went Viral. The Reason Is Embarrassingly Simple.* Towards Deep Learning, May 2026. [towardsdeeplearning.com](https://www.towardsdeeplearning.com/a-single-claude-md-file-went-viral-the-reason-is-embarrassingly-simple-5b515c9e4cca) ### Further reading * reAPI. *How to use Claude Code.* [reapi.ai/blog/how-to-use-claude-code](/blog/how-to-use-claude-code) * reAPI. *How to get a Claude API key.* [reapi.ai/blog/how-to-get-claude-api-key](/blog/how-to-get-claude-api-key) * reAPI. *Claude model catalog.* [reapi.ai/models](/models) --- # Claude Opus 5 vs GPT-5.6 Sol: Which Is Better for Coding? (2026) (https://reapi.ai/blog/claude-opus-5-vs-gpt-5-6-sol) **Claude Opus 5 is the better default for long-running software work, while GPT-5.6 Sol has the stronger result on one important agentic coding benchmark and a more ambitious orchestration stack.** That is the practical answer to Claude Opus 5 vs GPT-5.6 Sol. It is also less decisive than either vendor's launch page makes it sound. Anthropic's own comparison has Opus 5 ahead on Frontier-Bench, computer use, knowledge work, and business automation. The same table has GPT-5.6 Sol ahead on DeepSWE v1.1. Prices split differently depending on where you call them: their official input rates match, but Opus output is cheaper; on reAPI, Opus 5 is substantially less expensive on both dimensions.\[1]\[2] ## TL;DR * **Choose Claude Opus 5 for long-horizon coding, code review, computer use, and workflows that benefit from careful self-verification.** * **Choose GPT-5.6 Sol when DeepSWE-style repository work, OpenAI's Responses API tools, or native multi-agent orchestration matter most.** * **The benchmark result is split.** Opus 5 leads Frontier-Bench 43.3% to 34.4%; Sol leads DeepSWE v1.1 72.7% to 68.8%.\[1] * **Official prices:** Opus 5 is $5 input / $25 output; Sol is $5 / $30 per million tokens.\[2]\[3] * **Current reAPI prices:** Opus 5 is $2.40 / $12; Sol is $4 / $24 per million tokens. * **Do not pick from one score.** Run the same repository tasks at the same effort level and compare accepted-result cost, not token rate alone. ## Claude Opus 5 vs GPT-5.6 Sol at a glance | Category | Claude Opus 5 | GPT-5.6 Sol | | --------------------- | ------------------------------------------------- | ----------------------------------------------------------- | | Best fit | Long-running coding, review, enterprise workflows | Frontier coding, tool-heavy agents, orchestration | | Context window | 1M tokens | 1.05M tokens | | Max output | 128K tokens | 128K tokens | | Reasoning controls | `low` through `max`; default `high` | `none` through `max`; Pro mode and multi-agent in Responses | | Thinking default | Adaptive thinking on | Medium reasoning when omitted | | Official input/output | $5 / $25 per MTok | $5 / $30 per MTok | | reAPI input/output | $2.40 / $12 per MTok | $4 / $24 per MTok | | Clear benchmark win | Frontier-Bench, OSWorld, AutomationBench | DeepSWE v1.1 | Both accept text and image input and expose tool calling. Both also have a million-token-class context window, so context size is not a useful tie-breaker by itself.\[3]\[4] ## What the official coding benchmarks actually show Anthropic published a direct table containing both models. It is vendor-run, and several rows use different harnesses or fallback behavior, so the numbers are evidence—not a neutral final verdict.\[1] | Evaluation | Opus 5 | GPT-5.6 Sol | Lead | | ------------------------ | -----------: | ----------: | ----------- | | Frontier-Bench v0.1 | **43.3%** | 34.4% | Opus 5 | | GDPval-AA v2 | **1861 Elo** | 1736 Elo | Opus 5 | | ARC-AGI-3 | **30.2%** | 7.8% | Opus 5 | | BrowseComp | **90.8%** | 90.4% | Near tie | | OSWorld 2.0 | **70.6%** | 62.6% | Opus 5 | | DeepSWE v1.1 | 68.8% | **72.7%** | GPT-5.6 Sol | | AutomationBench | **26.0%** | 18.1% | Opus 5 | | HealthBench Professional | 59.8% | **60.5%** | GPT-5.6 Sol | The split is useful. Frontier-Bench measures long, open-ended engineering tasks; Opus 5's lead supports Anthropic's positioning around persistence and self-verification. DeepSWE is closer to autonomous repository-level software engineering, where Sol holds a 3.9-point lead. BrowseComp differs by 0.4 points and should be treated as a tie. A purchasing decision built on that margin would be false precision. ![Decision matrix for choosing Claude Opus 5 or GPT-5.6 Sol by coding workflow, cost, and tool orchestration](https://cdn.reapi.ai/media/blog/claude-opus-5-vs-gpt-5-6-sol/claude-opus-5-vs-gpt-5-6-sol-decision-matrix.png) ## Which model is better for real coding work? ### Feature development and difficult debugging: Opus 5 Opus 5 is the safer first choice when the job lasts many turns and the model must keep checking its own work. Anthropic specifically designed it for complex agentic coding and long-horizon tasks, and its largest official gains appear on evaluations that reward persistence rather than a single answer.\[1] That makes it well suited to code review, root-cause debugging, migrations, and feature work where requirements change during implementation. Thinking is on by default, and effort is the main cost dial. Start at `high`, then compare `medium` and `xhigh` against your own acceptance tests. ### Repository agents and OpenAI-native tooling: GPT-5.6 Sol Sol deserves the first test when DeepSWE-style performance or the Responses API ecosystem is the priority. GPT-5.6 adds Programmatic Tool Calling, persisted reasoning controls, Pro mode, and beta multi-agent orchestration.\[3] Those features matter when one agent must coordinate searches, shell work, file operations, and subagents without an orchestration layer built entirely in application code. They do not make every coding answer better, but they change what one API request can coordinate. ### Frontend and computer use: Opus 5 Opus 5 leads OSWorld 2.0 by eight points in Anthropic's table and is also ahead on the vendor's Frontier-Bench and automation results. For browser-based QA, visual debugging, and workflows that alternate between code and UI inspection, the evidence points toward Opus 5.\[1] Still test your own stack. Browser harnesses, screenshot resolution, tool latency, and retry rules can move the result more than a small model upgrade. ## Price comparison: official API and reAPI | Route | Input / MTok | Output / MTok | | ----------------------- | -----------: | ------------: | | Anthropic Claude Opus 5 | $5.00 | $25.00 | | OpenAI GPT-5.6 Sol | $5.00 | $30.00 | | reAPI Claude Opus 5 | **$2.40** | **$12.00** | | reAPI GPT-5.6 Sol | **$4.00** | **$24.00** | At official list prices, the input rate is identical and Opus output is 16.7% cheaper. On reAPI, Opus costs 40% less for input and 50% less for output than Sol. That changes the default for high-volume agent loops, where reasoning and tool transcripts create a large output bill. Price per token is only the first layer. The useful metric is: ```text cost per accepted task = token cost × attempts + tool fees + human review ``` If Sol solves a repository task once and Opus needs two attempts, the cheaper rate loses. If both pass, Opus has the clearer cost advantage. ## Reasoning controls are not interchangeable Claude Opus 5 exposes `low`, `medium`, `high`, `xhigh`, and `max`, defaulting to `high`. Thinking is adaptive and on by default. Disabling it while asking for `xhigh` or `max` returns an error, and `max_tokens` must cover hidden thinking plus visible text.\[4] GPT-5.6 supports `none`, `low`, `medium`, `high`, `xhigh`, and `max`, with `medium` as the default. OpenAI recommends preserving the current effort during migration and testing one level lower because the new family can maintain quality with fewer output tokens.\[3] For a fair evaluation, match by cost or latency—not by identical setting names. `high` on one vendor is not a standardized amount of compute on the other. ## Calling both models through one API reAPI exposes both models through an OpenAI-compatible Chat Completions endpoint. The integration difference is the model string: ```python from openai import OpenAI client = OpenAI( api_key="YOUR_REAPI_KEY", base_url="https://api.reapi.ai/v1", ) def run(model: str, prompt: str): return client.chat.completions.create( model=model, messages=[{"role": "user", "content": prompt}], max_tokens=16000, ) opus = run("claude-opus-5", "Review this migration for rollback risks.") sol = run("gpt-5.6-sol", "Review this migration for rollback risks.") ``` Use the same prompt, repository snapshot, tools, timeout, and acceptance rubric. Record total tokens and retries rather than comparing two attractive outputs by eye. ## FAQ ### Is Claude Opus 5 better than GPT-5.6 Sol for coding? For long-horizon coding and computer use, the official evidence favors Opus 5. For DeepSWE v1.1 repository tasks, GPT-5.6 Sol leads. The better production model depends on your task distribution and agent harness. ### Which model is cheaper? Opus 5. Official input prices match, but Opus output is $25 versus Sol's $30. On reAPI, Opus is $2.40/$12 and Sol is $4/$24 per million input/output tokens. ### Do both models support one-million-token context? Yes. Opus 5 has a 1M window and Sol has a 1.05M window. Long-context pricing and performance still depend on the route and request size. ### Which model is better for multi-agent workflows? Sol has native beta multi-agent orchestration in OpenAI's Responses API. Opus 5 can work in multi-agent systems, but orchestration is generally supplied by the application or Claude tooling. ### Can I switch between them without rewriting my app? On reAPI, yes for standard Chat Completions workloads. Keep one OpenAI SDK client and change `model` between `claude-opus-5` and `gpt-5.6-sol`. Vendor- specific reasoning and tool features still need conditional request fields. ## Verdict The Claude Opus 5 vs GPT-5.6 Sol decision is conditional, but it is not vague. Start with Opus 5 for long-running development, review, computer use, and lower token cost. Start with Sol for DeepSWE-like repository agents and workflows that benefit from OpenAI's native orchestration features. Then keep the winner only if it reduces cost per accepted task on your own code. ## References 1. Anthropic. *Introducing Claude Opus 5 — official benchmark table and methodology notes.* [anthropic.com/news/claude-opus-5](https://www.anthropic.com/news/claude-opus-5) 2. Anthropic. *Claude model pricing.* [platform.claude.com/docs/en/about-claude/pricing](https://platform.claude.com/docs/en/about-claude/pricing) 3. OpenAI. *GPT-5.6 model guidance, pricing, and Responses API features.* [developers.openai.com/api/docs/guides/latest-model](https://developers.openai.com/api/docs/guides/latest-model) 4. Anthropic. *What's new in Claude Opus 5.* [platform.claude.com/docs/en/about-claude/models/whats-new-opus-5](https://platform.claude.com/docs/en/about-claude/models/whats-new-opus-5) ### Further reading * reAPI. *How to use Claude Opus 5.* [reapi.ai/blog/how-to-use-claude-opus-5](/blog/how-to-use-claude-opus-5) * reAPI. *How to use GPT-5.6.* [reapi.ai/blog/how-to-use-gpt-5-6](/blog/how-to-use-gpt-5-6) * reAPI. *Claude Opus 5 model page.* [reapi.ai/models/claude-opus-5](/models/claude-opus-5) --- # DeepSeek V4 1M Context: max_tokens, Billing, and Concurrency (https://reapi.ai/blog/deepseek-v4-1m-context-guide) **DeepSeek V4's 1M context window is a shared input-and-output budget. It does not mean you can send 1M input tokens and then generate another 384K.** The 384K figure is the maximum output, while `max_tokens` is the output ceiling you choose for one request. Actual output is also limited by the space left in the 1M window\[1]\[2]. This guide answers the practical questions behind that specification: how to budget input and output, how to set `max_tokens`, what thinking tokens do to usage, how cache billing works, and why Flash and Pro have different concurrency limits. ## DeepSeek V4 limits at a glance | Item | Official specification | | ---------------------- | ------------------------------------------------------------------------------------- | | Model IDs | `deepseek-v4-flash`, `deepseek-v4-pro` | | Context window | 1M tokens, shared by input and generated output | | Maximum output | 384K tokens | | `max_tokens` | Per-request completion cap; cannot exceed remaining context or the model output limit | | Default mode | Thinking enabled; ordinary requests default to `reasoning_effort: high` | | Cache | Context disk cache is enabled automatically | | Direct API concurrency | Flash 2,500; Pro 500, per account | | Interfaces | OpenAI Chat Completions and Anthropic-compatible | DeepSeek released the V4 preview on April 24, 2026 with Flash and Pro variants and a 1M context window\[3]. The official pricing page lists the same 384K output cap for both models, together with JSON Output, tool calls, prefix completion, and FIM completion\[1]. ## Does 1M mean input only? No. DeepSeek's Chat Completions reference says the total length of input tokens and generated tokens is limited by the model context length\[2]. Use this mental model: ```text input tokens + generated tokens <= 1M context generated tokens <= max_tokens generated tokens <= 384K model output limit ``` If the prompt nearly fills the context window, the model cannot also return a 384K answer. Reserve room for system instructions, tool schemas, conversation history, and the completion. A large window also does not remove the value of retrieval and chunking. Sending less, better-organized context often improves latency, cost, and answer focus. ## How to set `max_tokens` `max_tokens` is the maximum completion length for one request. A `finish_reason` of `length` can mean the request reached this cap or exhausted the available context\[2]. Reasonable starting points: | Workload | Starting cap | | ----------------------------------------- | ------------------------------------------------: | | Classification, extraction, short answers | 1K–4K | | Code review and document summaries | 4K–16K | | Long reports and migration plans | 16K–64K | | Extreme long-form generation | Increase only after measuring cost and truncation | These are engineering starting points, not official requirements. Measure `finish_reason`, actual completion tokens, latency, and useful-output rate before raising the cap. ```python from openai import OpenAI client = OpenAI( api_key="YOUR_REAPI_KEY", base_url="https://api.reapi.ai/v1", ) response = client.chat.completions.create( model="deepseek-v4-pro", messages=[ { "role": "user", "content": "Review this repository inventory and produce a risk-ranked migration plan.", } ], max_tokens=16_384, reasoning_effort="high", extra_body={ "thinking": {"type": "enabled"}, "group": "default", }, ) ``` See the [DeepSeek V4 API reference](/docs/deepseek-v4) for reAPI request fields, and the [DeepSeek V4 model page](/models/deepseek-v4) for the playground and live gateway prices. ## Thinking tokens and completion usage Thinking mode is enabled by default. DeepSeek returns reasoning in `reasoning_content`, and the usage object can report it separately as `completion_tokens_details.reasoning_tokens`\[4]\[2]. Plan completion capacity around reasoning as well as the visible final answer. In thinking mode, `temperature`, `top_p`, `presence_penalty`, and `frequency_penalty` are accepted for compatibility but do not take effect\[4]. For deterministic extraction or low-latency work, test Flash with thinking disabled. Keep thinking enabled for planning, coding, and multi-step tool use where the additional reasoning is useful. ## How billing works DeepSeek Direct bills three token buckets: 1. cached input; 2. uncached input; 3. output. The official USD rates on July 30, 2026 were\[1]: | Model | Cached input / 1M | Uncached input / 1M | Output / 1M | | ----------------- | ----------------: | ------------------: | ----------: | | DeepSeek V4 Flash | $0.0028 | $0.14 | $0.28 | | DeepSeek V4 Pro | $0.003625 | $0.435 | $0.87 | The general formula is: ```text cost = cached_input / 1M × cached_rate + uncached_input / 1M × uncached_rate + output / 1M × output_rate ``` These are DeepSeek's direct prices. reAPI is a separate gateway with its own live USD rates, so use the pricing card on the [reAPI DeepSeek V4 page](/models/deepseek-v4) for gateway billing. ## Getting value from context caching DeepSeek's disk cache is enabled automatically. A later request receives a cache hit only when it fully matches a stored prefix unit; similar wording is not enough\[5]. Put stable content first: ```text stable system prompt + stable tool schemas + unchanged repository or document corpus + the question that changes per request ``` Use the response fields `prompt_cache_hit_tokens` and `prompt_cache_miss_tokens` to calculate the real hit rate. Do not estimate savings from prompt similarity alone. ## Flash and Pro concurrency DeepSeek Direct publishes account-level concurrency limits of 2,500 for Flash and 500 for Pro. A request occupies one concurrency slot until its response finishes. The limit is per account, not per API key, and excess requests receive HTTP 429\[6]. The optional `user_id` can isolate safety, cache, and scheduling behavior, but ordinary accounts still share the total account concurrency across all user IDs. Creating more keys or user IDs does not increase capacity. Those figures apply to DeepSeek Direct. Gateway concurrency and queueing can differ; when using reAPI, follow the limits and responses published by reAPI. ## Production checklist for 1M-context requests * Count tokens instead of treating characters as tokens. * Reserve context for output, tool schemas, and follow-up turns. * Set `max_tokens` to the task, not automatically to 384K. * Record `finish_reason` and distinguish truncation from natural stops. * Keep reusable prefixes stable and track cache hit tokens. * Measure reasoning usage separately from visible answer length. * Retry 429 responses with exponential backoff and jitter. * Route high-volume routine work to Flash and reserve Pro for harder tasks. * Use the current V4 model IDs; DeepSeek's announced deprecation date for `deepseek-chat` and `deepseek-reasoner` was July 24, 2026\[3]. ## FAQ ### Does DeepSeek V4 Flash support 1M context? Yes. Both Flash and Pro have a 1M context window and a 384K maximum output\[1]. ### Is the 1M context all input? No. Input and generated output share the model context limit\[2]. ### Can I set `max_tokens` to 384K? 384K is the model output ceiling, but the request must also have enough space left in the 1M context window. The setting does not guarantee a 384K completion. ### Do reasoning tokens count toward completion usage? Capacity and billing plans should include them. DeepSeek reports reasoning tokens within completion usage details\[2]. ### Are concurrency limits per API key? No. DeepSeek Direct limits concurrency per account: 2,500 for Flash and 500 for Pro\[6]. ### Do I need to enable prompt caching? No. The context disk cache is automatic. Keep shared prefixes stable and inspect the cache hit fields in `usage`\[5]. ## Further reading * [DeepSeek V4 model and live pricing](/models/deepseek-v4) * [DeepSeek V4 API reference](/docs/deepseek-v4) * [Browse reAPI chat models](/models) ## References 1. DeepSeek. *Models & Pricing — V4 context, output, features, prices, and concurrency.* Retrieved July 30, 2026 from [api-docs.deepseek.com/quick\_start/pricing](https://api-docs.deepseek.com/quick_start/pricing/) 2. DeepSeek. *Create Chat Completion — max\_tokens, context limits, finish reasons, and usage.* Retrieved July 30, 2026 from [api-docs.deepseek.com/api/create-chat-completion](https://api-docs.deepseek.com/api/create-chat-completion) 3. DeepSeek. *DeepSeek-V4 preview release.* April 24, 2026. [api-docs.deepseek.com/news/news260424](https://api-docs.deepseek.com/news/news260424/) 4. DeepSeek. *Thinking Mode — controls, reasoning effort, and reasoning content.* Retrieved July 30, 2026 from [api-docs.deepseek.com/guides/thinking\_mode](https://api-docs.deepseek.com/guides/thinking_mode/) 5. DeepSeek. *Context Caching — prefix matching and usage fields.* Retrieved July 30, 2026 from [api-docs.deepseek.com/guides/kv\_cache](https://api-docs.deepseek.com/guides/kv_cache/) 6. DeepSeek. *Rate Limit & Isolation — account-level concurrency and user\_id.* Retrieved July 30, 2026 from [api-docs.deepseek.com/quick\_start/rate\_limit](https://api-docs.deepseek.com/quick_start/rate_limit/) --- # DeepSeek V4 Flash Official Release: 0731 Agent and Codex Upgrades (https://reapi.ai/blog/deepseek-v4-flash-official-release) **DeepSeek V4 Flash 0731 is now the official Flash model served by DeepSeek's API.** The July 31, 2026 update replaces the April preview behind the existing `deepseek-v4-flash` model ID, adds native Responses API support, and substantially retunes the model for coding agents and tool-driven work. DeepSeek calls the release official, but the API service is still labeled **public beta**.\[1] This is an API-only rollout. DeepSeek V4 Pro, the DeepSeek app, and the web chat were not upgraded as part of the 0731 release. The architecture also did not change: Flash remains a 284B-parameter mixture-of-experts model with 13B active parameters and a one-million-token context window.\[1]\[2] ## TL;DR * **The official model is `DeepSeek-V4-Flash-0731`.** Existing API calls keep using `deepseek-v4-flash`; no model-name migration is required.\[1] * **This is a post-training upgrade, not a new architecture.** Total parameters, active parameters, and the 1M context window remain unchanged.\[1]\[2] * **Agent performance is the headline.** DeepSeek reports 82.7 on Terminal Bench 2.1, 54.4 on DeepSWE, and 70.3 on Toolathlon Verified, using its unreleased minimal harness and maximum reasoning effort.\[1] * **Responses API support is native.** Flash can now back Codex without the protocol-conversion proxy that the preview required.\[3]\[4] * **The compatibility layer is not complete OpenAI parity.** The API is stateless, accepts text rather than image/file inputs, and ignores or rejects several Responses API fields.\[3] * **Pro and consumer chat did not change.** DeepSeek says the official V4 Pro release will follow separately.\[1] ## DeepSeek V4 Flash 0731 specifications | Item | Official release status | | ---------------------- | ----------------------------------------------------- | | Release date | July 31, 2026 | | Service status | Official API release in public beta | | API model ID | `deepseek-v4-flash` | | Checkpoint name | `DeepSeek-V4-Flash-0731` | | Architecture | Mixture of experts, unchanged from preview | | Parameters | 284B total, 13B activated | | Context window | 1M tokens | | Maximum output | 384K tokens | | Reasoning modes | Non-thinking, Think High, Think Max | | API formats | Chat Completions, Anthropic-compatible, Responses API | | Input on Responses API | Text; image and file inputs are not supported | | Open weights | MIT-licensed model weights available | The distinction between the model ID and checkpoint name is deliberate. `DeepSeek-V4-Flash-0731` identifies the updated weights, while `deepseek-v4-flash` is the stable service name applications send to the API.\[5] This lets DeepSeek update the backend without forcing every developer to change production configuration. ## What changed from DeepSeek V4 Flash Preview ![DeepSeek V4 Flash 0731 upgrade map showing unchanged architecture, new post-training, stronger agent behavior, and native Responses API support](https://cdn.reapi.ai/media/blog/deepseek-v4-flash-official-release/deepseek-v4-flash-official-release-upgrade-map.png) The 0731 release changes behavior and integration more than raw model scale. | Area | April preview | 0731 official Flash | | ----------------- | ----------------------------------------------- | ------------------------------------------ | | Architecture | 284B total / 13B active MoE | Unchanged | | Context | 1M tokens | Unchanged | | Model ID | `deepseek-v4-flash` | Unchanged | | Training stage | Preview post-training | Re-post-trained for the official release | | Agent capability | Strong general agent baseline | Major coding-agent and tool-use retuning | | Responses API | No native endpoint | Native support | | Codex integration | Required an adapter or another compatible route | Officially documented direct configuration | | Rollout scope | Flash and Pro preview APIs | Flash API only | DeepSeek says 0731 “was only re-post-trained.”\[1] That phrase is easy to undersell. For agent models, post-training controls whether the model plans effectively, calls the right tool, reads the result, recovers from failure, and continues until the task is complete. Architecture sets the capacity; post-training determines how reliably that capacity appears inside a working agent. The release therefore does not make the model larger. It makes the existing Flash model more useful for repository work, terminal tasks, patch generation, search, and multi-step automation. ## DeepSeek's new agent benchmarks—and how to read them DeepSeek published nine scores for the official release:\[1] | Benchmark | DeepSeek V4 Flash 0731 | | ----------------------- | ---------------------: | | Terminal Bench 2.1 | 82.7 | | NL2Repo | 54.2 | | CyberGym | 76.7 | | DeepSWE | 54.4 | | Toolathlon Verified | 70.3 | | Agent Last Exam | 25.2 | | Automation Bench Public | 25.1 | | DSBench FullStack | 68.7 | | DSBench Hard | 59.6 | These figures support the claim that agent work was the focus of the update. They do not establish a universal ranking. DeepSeek used its own “Harness minimal mode,” which the company says will be released later, with maximum reasoning effort, `top_p: 0.95`, and `temperature: 1.0`. Two of the reported datasets—DSBench FullStack and DSBench Hard—are internal.\[1] Until the harness and internal tasks are available, those results cannot be independently reproduced end to end. For a production evaluation, keep the same repository set, tool permissions, timeout, retry policy, reasoning effort, and token budget across models. Measure completed tasks and accepted patches, not just whether an agent produced a plausible-looking diff. ## Native Responses API is the most important developer change DeepSeek V4 Flash now accepts the Responses API format at the standard DeepSeek base URL. That removes a significant integration gap for Codex and other clients built around `/v1/responses` rather than Chat Completions.\[3] A minimal direct call uses the OpenAI SDK: ```python from openai import OpenAI client = OpenAI( api_key="YOUR_DEEPSEEK_API_KEY", base_url="https://api.deepseek.com", ) response = client.responses.create( model="deepseek-v4-flash", instructions="Review code conservatively and explain every proposed edit.", input="Find the race condition in this queue worker.", reasoning={"effort": "high"}, max_output_tokens=8_192, ) print(response.output_text) ``` Streaming returns semantic events such as `response.output_text.delta`, `response.function_call_arguments.delta`, and `response.completed`. Unlike the familiar Chat Completions stream, it does not end with `data: [DONE]`.\[3] Native support matters because an adapter no longer has to translate tool calls, reasoning events, and output items between two wire formats. Fewer translation layers mean fewer places for tool-call IDs, streaming state, or reasoning history to break. ## Responses API compatibility has important limits “Native Responses API” does not mean that every OpenAI Responses feature works. DeepSeek documents the compatibility boundary in detail.\[3] Supported features include: * text input and developer/system instructions; * streaming; * function tools and server-side web search; * required or specific tool choice; * reasoning effort; * structured text formats; * the `apply_patch` custom tool used for Codex compatibility. Important limitations include: * `previous_response_id` and `conversation` are not supported, so the API is stateless; * `store`, background mode, metadata, prompt templates, and service tiers are not supported; * image and file input items are replaced with placeholder text rather than processed; * MCP, computer use, code interpreter, and file search tools are ignored; * `parallel_tool_calls` is ignored because parallel tool use is always enabled; * requests that exceed the context window return HTTP 400 instead of being automatically truncated. Some unsupported parameters are silently ignored. That makes initial connection easier, but it also means a request can return successfully without honoring every control your application sent. Integration tests should verify behavior, not only HTTP status. ## How to use DeepSeek V4 Flash 0731 with Codex DeepSeek now publishes a dedicated Codex configuration guide. As of August 2, only Flash is supported; V4 Pro support is expected separately.\[4] The official setup creates a DeepSeek provider in `~/.codex/config.toml` and a model catalog in `~/.codex/models.json`. The important runtime values are: ```toml model = "deepseek-v4-flash" model_provider = "deepseek" [model_providers.deepseek] name = "DeepSeek" base_url = "https://api.deepseek.com" wire_api = "responses" env_key = "DEEPSEEK_API_KEY" ``` DeepSeek's catalog gives Flash a 1,048,576-token maximum context, enables parallel tool calls, and exposes low, high, and max reasoning levels.\[4] Keep the API key in an environment variable rather than writing it into a shared configuration file. For repository work, begin with `high` reasoning. Move to `max` only for tasks that justify extra latency and output tokens, such as a cross-service migration or a difficult intermittent bug. ## Pricing and context limits did not receive a new release tier The current DeepSeek Direct price sheet lists Flash at:\[6] | Token category | Price per 1M tokens | | -------------- | ------------------: | | Cached input | $0.0028 | | Uncached input | $0.14 | | Output | $0.28 | Flash retains a 1M shared context window, a 384K maximum output, and an account-level concurrency limit of 2,500.\[6]\[7] The low headline token price does not make maximum-context agent runs free: tool schemas, repository files, reasoning tokens, retries, and long outputs all contribute to usage. For a detailed explanation of context budgeting and cache behavior, see [DeepSeek V4 1M Context: max\_tokens, Billing, and Concurrency](/blog/deepseek-v4-1m-context-guide). These are DeepSeek Direct rates. reAPI has its own product contract and live rate card on the [DeepSeek V4 model page](/models/deepseek-v4). Do not copy a vendor price into a gateway cost calculator without checking the route you are actually using. ## Calling DeepSeek V4 Flash through reAPI The existing reAPI integration uses the same stable model name through an OpenAI-compatible Chat Completions endpoint: ```bash curl https://api.reapi.ai/v1/chat/completions \ -H "Authorization: Bearer $REAPI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek-v4-flash", "messages": [ { "role": "system", "content": "Work through the repository methodically. Return a minimal patch." }, { "role": "user", "content": "Trace this authentication failure and identify the smallest safe fix." } ], "max_tokens": 8192, "reasoning_effort": "high" }' ``` See the [DeepSeek V4 API documentation](/docs/deepseek-v4) for the current reAPI request contract. Gateway rollout and vendor-direct rollout are separate operational events, so confirm the active route and model discovery response when an application depends on the exact 0731 revision. ## Who should switch to the official Flash release? Existing DeepSeek Direct API users do not need to switch model IDs; the stable Flash name already selects the latest version. They should rerun evaluations because behavior changed even though configuration did not. The release is particularly relevant for: * coding-agent teams using terminal, search, and patch tools; * developers who previously maintained a Chat Completions-to-Responses proxy; * high-volume workloads that need a smaller active parameter footprint than V4 Pro; * long-context agents that can benefit from automatic prefix caching; * Codex users willing to operate within DeepSeek's documented compatibility limits. Wait before treating it as a drop-in replacement when your workflow requires image understanding, durable Responses conversations, background jobs, code interpreter, MCP through the API, or exact OpenAI feature parity. Those features are absent or handled outside the model endpoint today.\[3] ## Production migration checklist 1. Keep `deepseek-v4-flash`; do not invent a `deepseek-v4-flash-0731` API ID unless a provider explicitly exposes it. 2. Rerun agent evaluations because the backend behavior changed under the stable name. 3. Pin the harness, tool definitions, reasoning effort, token budget, and timeout when comparing results. 4. Test every Responses API field your application relies on; several unsupported fields are silently ignored. 5. Preserve conversation history client-side because `previous_response_id` is not supported. 6. Reject or pre-process image and file inputs rather than assuming the model can inspect them. 7. Track cached and uncached input separately in cost telemetry. 8. Roll out behind a feature flag and keep the previous production route available until acceptance tests pass. ## Frequently asked questions ### Is DeepSeek V4 Flash 0731 the official version? Yes. DeepSeek calls it the official V4 Flash release, served through an API public beta from July 31, 2026.\[1] “Official release” describes the model revision; “public beta” describes the current service stage. ### Do I need to change the API model name? No. DeepSeek Direct continues to use `deepseek-v4-flash`, which now routes to DeepSeek-V4-Flash-0731.\[5] ### Is DeepSeek V4 Flash 0731 a larger model? No. It keeps the preview architecture and size: 284B total parameters and 13B activated. The update comes from additional post-training.\[1] ### Does the official Flash release support the Responses API? Yes. DeepSeek provides a native Responses API surface for Flash and documents direct Codex integration.\[3]\[4] ### Can DeepSeek V4 Flash process images through Responses API? No. The official compatibility table says image and file input parts are replaced with placeholder text. Treat the endpoint as text input.\[3] ### Was DeepSeek V4 Pro upgraded too? No. DeepSeek says the 0731 update applies only to the Flash API. The Pro API and App/Web models were unchanged, with the official Pro release planned separately.\[1] ## What this release actually means The DeepSeek V4 Flash official release is a focused agent upgrade. It keeps the efficient Flash architecture and stable API name, then changes the part developers feel most: tool use, terminal work, coding behavior, and integration with Responses-based clients. The practical headline is not merely that benchmark numbers rose. `deepseek-v4-flash` can now plug directly into Codex through a documented native protocol. Teams should still test the compatibility gaps, reproduce performance on their own repositories, and remember that the service is in public beta. That is a substantial release, but it is not yet the full DeepSeek V4 product-line rollout. ## References 1. DeepSeek. *Change Log — DeepSeek-V4-Flash Update.* July 31, 2026. [api-docs.deepseek.com/updates](https://api-docs.deepseek.com/updates/) 2. DeepSeek. *DeepSeek-V4-Flash model card — architecture, parameters, context, reasoning modes, and license.* Retrieved August 2, 2026 from [huggingface.co/deepseek-ai/DeepSeek-V4-Flash](https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash) 3. DeepSeek. *Using the Responses API — supported fields, tools, streaming, and compatibility limits.* Retrieved August 2, 2026 from [api-docs.deepseek.com/guides/responses\_api](https://api-docs.deepseek.com/guides/responses_api/) 4. DeepSeek. *Integrate with Codex — official provider and model configuration.* Retrieved August 2, 2026 from [api-docs.deepseek.com/quick\_start/agent\_integrations/codex](https://api-docs.deepseek.com/quick_start/agent_integrations/codex/) 5. DeepSeek. *Your First API Call — `deepseek-v4-flash` now routes to the 0731 model.* Retrieved August 2, 2026 from [api-docs.deepseek.com/guides/function\_calling](https://api-docs.deepseek.com/guides/function_calling/) 6. DeepSeek. *Models & Pricing — Flash token rates, context, maximum output, and features.* Retrieved August 2, 2026 from [api-docs.deepseek.com/quick\_start/pricing](https://api-docs.deepseek.com/quick_start/pricing/) 7. DeepSeek. *Rate Limit & Isolation — account-level Flash concurrency.* Retrieved August 2, 2026 from [api-docs.deepseek.com/quick\_start/rate\_limit](https://api-docs.deepseek.com/quick_start/rate_limit/) ### Further reading * reAPI. *DeepSeek V4 model page and live gateway pricing.* [reapi.ai/models/deepseek-v4](/models/deepseek-v4) * reAPI. *DeepSeek V4 API reference.* [reapi.ai/docs/deepseek-v4](/docs/deepseek-v4) * reAPI. *MiniMax M3 API: 1M Context, Pricing, and Coding Guide.* [reapi.ai/blog/minimax-m3-api-guide](/blog/minimax-m3-api-guide) --- # Does Midjourney Have an API? V8.2 Options Without Discord (2026) (https://reapi.ai/blog/does-midjourney-have-an-api) **No—Midjourney does not offer a general public API.** Its official community guidelines say that, except for rare explicitly granted cases, Midjourney does not provide an API or third-party apps and prohibits automated interaction with the service.\[1] That answer matters more than any code sample claiming you can call Midjourney V8.2 without Discord. Midjourney itself now works on the web as well as Discord, so Discord is no longer required for ordinary creation. Programmatic access is different. A gateway may expose a Midjourney-compatible route, but that does not turn it into an official Midjourney API. Before production use, verify that the provider can document authorization and that your workflow complies with the current terms. ## TL;DR * **Midjourney has no general public API.** Unauthorized account automation and third-party scripts can lead to blocking.\[1] * **You can use Midjourney without Discord** through the official Midjourney website and its Create page.\[2] * **V8.2 launched on July 24, 2026**, focusing on aesthetics, image quality, and improved personalization.\[3] * **Do not automate a personal Midjourney account.** Browser bots, token reuse, and Discord self-bots are not substitutes for an authorized API. * **reAPI exposes a separate route labeled Midjourney V8** with V8.2 selection, async tasks, structured parameters, and follow-up operations. It is not the official Midjourney API. * **For production procurement, request written provenance.** Ask who is authorized to provide the route, what happens if upstream access changes, and which terms cover your usage. ## What Midjourney V8.2 changed Midjourney announced V8.2 on July 24, one week before this article. The release focuses on more creative and sophisticated aesthetics, fewer random low-quality outputs, and stronger personalization based on a user's preference profile.\[3] V8.2 follows V8.1, which introduced much faster standard jobs, better prompt adherence, and native 2K HD rendering. Midjourney's version documentation says V8.1 standard jobs were about four to five times faster than earlier versions; V8.2's announcement emphasizes quality and taste rather than another measured speed increase.\[4] | Version | Main change | Current status | | ---------- | ---------------------------------------------------- | ---------------------- | | V8.0 Alpha | First V8 preview | Legacy alpha | | V8.1 | Faster generation, stronger prompt detail, native HD | Supported | | V8.2 | Aesthetic quality, consistency, personalization | Latest project default | Do not copy V8.1 speed claims onto V8.2 unless Midjourney publishes a separate measurement. The releases have different stated goals. ## Official ways to use Midjourney without Discord The official web app is the compliant answer for creators who simply do not want Discord. Midjourney's getting-started guide directs subscribers to the Create page, where the Imagine bar, settings, image references, editing, and video tools are available.\[2] The official paths are: 1. **Midjourney website.** Create images, adjust settings, organize results, edit, and animate from the browser. 2. **Discord bot.** Use `/imagine`, settings commands, and follow-up actions in Discord. 3. **Explicitly authorized access.** A limited integration may exist where Midjourney has granted permission, but it should be documented as such. What is not an official path: logging in with a script, copying an account token, driving Discord through a self-bot, or using headless browser automation against a personal subscription. ![Official Midjourney web and Discord paths compared with prohibited account automation and separately authorized API access](https://cdn.reapi.ai/media/blog/does-midjourney-have-an-api/does-midjourney-have-an-api-official-paths.png) ## Why unofficial Midjourney API tutorials are risky Many “Midjourney API” tutorials automate the consumer service rather than call a documented vendor endpoint. They may send Discord messages using a user token, scrape task status, or replay private browser requests. The code can work temporarily and still violate the service rules. The operational risks are concrete: * the account may be blocked; * private tokens can leak through logs or a hosted script; * undocumented endpoints can change without notice; * rate limits and billing behavior are not contractual; * the provider may disappear when upstream enforcement changes. An API wrapper is not made safe by looking like REST. Ask what authority sits behind it. ## What the reAPI Midjourney V8 route exposes reAPI currently has a model route named `midjourney` and a landing page labeled Midjourney V8. The route is asynchronous: submit an image task, receive a `task_id`, and poll until completion. It exposes V8.2 and V8.1 plus earlier versions, three speed modes, structured equivalents of common Midjourney parameters, and follow-up actions such as upscale, variation, reroll, zoom, pan, and remix. That is a description of reAPI's product surface, not a claim that Midjourney publishes or endorses the endpoint. Any team using it should verify the provider relationship and acceptable-use basis before relying on it. The request shape is: ```bash curl https://reapi.ai/api/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "midjourney", "prompt": "editorial product photograph, warm daylight, restrained styling", "version": "8.2", "size": "16:9", "speed": "fast" }' ``` The call returns a task rather than final images. Poll: ```text GET https://reapi.ai/api/v1/tasks/{task_id} ``` Generation may return up to four images and bills once per request. Exact rates vary by relax, fast, or turbo mode and should be read from the live [Midjourney V8 model page](/models/midjourney-v8). ## Parameters developers actually need | JSON field | Midjourney concept | Use | | --------------- | --------------------------- | ---------------------------------------- | | `version` | `--v` | Select `8.2`, `8.1`, or an older model | | `size` | `--ar` | Choose aspect ratio | | `speed` | GPU mode | `relax`, `fast`, or `turbo` | | `stylize` | `--s` | Control Midjourney's aesthetic influence | | `chaos` | `--c` | Increase variation across the grid | | `weird` | `--w` | Push unconventional results | | `raw` | Raw mode | Reduce automatic styling | | `image_urls` | Image prompt | Guide content and composition | | `sref` / `cref` | Style / character reference | Carry visual identity across tasks | Start with version, aspect ratio, and speed. Add one advanced control at a time; changing five aesthetic parameters at once makes failures hard to diagnose. ## How to evaluate a Midjourney API provider Before integrating any third-party route, ask seven questions: 1. Can the provider document authorization to supply Midjourney access? 2. Does it require your personal Discord or Midjourney credentials? 3. Are account tokens stored or replayed? 4. What is the upstream model and version guarantee? 5. What happens to queued tasks if upstream access is interrupted? 6. Are generated files retained, and for how long? 7. Does the contract cover commercial use, privacy, support, and refunds? Avoid any service that asks for a Discord user token. That is both a security warning and a strong sign the integration is automating a consumer account. ## FAQ ### Does Midjourney have an official API? No general public API. Midjourney says it grants only rare explicit exceptions and prohibits unauthorized automation and third-party apps. ### Can I use Midjourney without Discord? Yes. The official Midjourney website supports image creation, settings, editing, organization, and video workflows. ### Is Midjourney V8.2 available? Yes. Midjourney announced V8.2 on July 24, 2026, with improvements to aesthetics, quality consistency, and personalization. ### Is a third-party Midjourney API legal or authorized? The existence of an endpoint does not answer that. Ask the provider for a documented authorization and review Midjourney's current terms for your use case. Do not automate your personal account. ### What is the safest API alternative? If documented authorization is unavailable, use a model with a first-party public API, such as GPT Image, Imagen, Seedream, FLUX, or another image model whose vendor explicitly supports programmatic access. ## Conclusion So, does Midjourney have an API? Officially, not a general public one. Use the Midjourney website if the goal is simply to work without Discord. For programmatic V8.2 access, treat authorization—not the elegance of the JSON—as the deciding requirement, and never build production automation on a personal Midjourney account. ## References 1. Midjourney. *Community Guidelines — unauthorized automation and third-party apps.* [docs.midjourney.com](https://docs.midjourney.com/hc/en-us/articles/32013696484109-Community-Guidelines) 2. Midjourney. *Getting Started Guide — official web workflow.* [docs.midjourney.com](https://docs.midjourney.com/hc/en-us/articles/33329261836941-Getting-Started-Guide) 3. Midjourney. *Version 8.2 announcement, July 24, 2026.* [updates.midjourney.com/version-8-2](https://updates.midjourney.com/version-8-2/) 4. Midjourney. *Version documentation — V8.1 speed, HD, and compatibility.* [docs.midjourney.com](https://docs.midjourney.com/hc/en-us/articles/32199405667853-Version) ### Further reading * reAPI. *Midjourney V8 documentation.* [reapi.ai/docs/midjourney-v8](/docs/midjourney-v8) * reAPI. *Midjourney V8 model page.* [reapi.ai/models/midjourney-v8](/models/midjourney-v8) * reAPI. *How to use GPT Image 2.* [reapi.ai/blog/how-to-use-gpt-image-2](/blog/how-to-use-gpt-image-2) --- # Dreamina Seedance 2.5 Prompt Guide: References & Timing (https://reapi.ai/blog/dreamina-seedance-2-5-prompt-guide) **The best Seedance 2.5 prompt is a production brief, not a long cinematic sentence.** State the goal, assign one role to every reference, divide longer action into stages, define the visible end state of each stage, and finish with the identities, props, spatial relationships, and audio that must remain unchanged. That structure follows ByteDance's official Dreamina prompt guide and gives the model fewer relationships to guess.\[1] Dreamina's official guide also documents support for combining up to 50 reference materials—up to 30 images, 10 videos, and 10 audio clips—although using the maximum is rarely the most stable starting point.\[1] This article turns those rules into reusable prompt patterns without pretending that Dreamina's creator controls are already a public Seedance 2.5 API contract. ## TL;DR * Begin with **subject + action + scene**. Add style, camera, and audio only when they change the result. * Give every uploaded asset a narrow role: identity, clothing, product geometry, environment, motion, voice, ambience, or music. * For 30-second video, write consecutive stages with **one main state change** and an observable end state in each stage. * Use time ranges for pacing, an exact timestamp for a single transition, and relative timing for an event triggered by another event. * For editing, name the source video as the master, define the smallest edit scope, and list everything to preserve. * For extension, match the boundary frame first; describe new action second. * For automation today, use [Seedance 2.0 on reAPI](/models/seedance-2-0); the [Seedance 2.5 route](/models/seedance-2-5) is not yet callable. ## The Seedance 2.5 prompting workflow ![Seedance 2.5 prompt workflow from reference roles through stages and end states to preserved identity, props, and space](https://cdn.reapi.ai/media/blog/dreamina-seedance-2-5-prompt-guide/dreamina-seedance-2-5-prompt-workflow.png) The sequence is deliberate: **reference roles → stages → end states → preserve list**. If the model does not know which image owns a face, no amount of camera language will rescue consistency later. If a stage has no end state, the next stage has no reliable place to begin. ## Official reference limits and practical starting ranges ByteDance's Dreamina guide distinguishes documented input ceilings from recommended ranges intended to improve stability.\[1] | Material | Official input limit | Practical starting range | | ------------- | ------------------------------------------ | --------------------------------------------------------------- | | Images | Up to 30, each no larger than 4K | Start with 1–8 distinct subjects | | Videos | Up to 10, no more than 30 seconds combined | Start with 1–5 subjects and 5–10 seconds per motion reference | | Audio | Up to 10, no more than 30 seconds combined | Keep only dialogue, voice, ambience, or music used by the scene | | Video editing | One source video plus reference images | Prefer a source under 20 seconds and 1–5 reference images | The ceiling is not a target. Ten loosely related character images can create more ambiguity than three carefully labeled views. Add a reference only when you can complete this sentence: **“Use this asset for \_\_\_, and ignore \_\_\_.”** ### Use separate views for one subject When several images show the same person or product, say that explicitly. Do not let the model decide whether four views represent one object or four objects. ```text [Product identity] @Image 1 defines the front of the same travel speaker. @Image 2 defines its left-side controls. @Image 3 defines its rear ports. All three images describe one speaker. Keep exactly one speaker in the video. ``` That last sentence is a useful cardinality constraint. It prevents a reference pack from becoming a cast list. ## The core prompt formula The official formula is flexible: subject, action or event, environment, visual style, camera treatment, and audio.\[1] In practice, it works best in descending order of importance: ```text [Goal] Create a product demonstration of a compact travel speaker unfolding on a hotel desk. [Subject and event] One graphite speaker opens from its folded position, powers on, and remains centered. [Scene] Early morning hotel room, walnut desk, soft window light, uncluttered background. [Camera] Locked medium shot for the opening; slow push-in only after the speaker powers on. [Audio] Quiet room tone, one soft power-on chime, no music. ``` Remove any block that does not matter. Generation controls that already exist in the interface do not need to be repeated as prose unless the wording carries creative meaning. ## Assign every reference a job The most reliable reference prompt has two halves: what to inherit and what to ignore. ```text [Character] @Image 1 defines the baker's face, short dark hair, and blue apron. Ignore the image background and camera angle. [Product] @Image 2 defines the shape, glaze, and pale-green label of the tea tin. Ignore the hand holding it. [Environment] @Image 3 defines the bakery counter, shelf layout, and warm side light. Do not copy any people or products from this image. [Motion] @Video 1 defines the pace of opening the tin and measuring tea. Do not copy the performer, clothing, or room from the video. [Audio] @Audio 1 defines the baker's calm English voice. ``` Do not write “Images 1–4 define the characters respectively.” “Respectively” hides the mapping that the model needs. Name each subject and asset pair independently. ### Create a subject profile once For a long prompt, define the important subject once and reuse the same label: ```text = face and hair from @Image 1 + blue apron from @Image 4. = shape and label from @Image 2. = layout and lighting from @Image 3. ``` Then each scene can say which profiles it uses. This keeps the prompt readable and reduces accidental attribute swaps. ## Audio, dialogue, and subtitle syntax Natural language works, but Dreamina's guide provides compact delimiters when a prompt mixes sound categories.\[1] | Content | Syntax | Example | | ------------ | ------ | ------------------------------ | | Music | `( )` | `(Sparse brushed drums begin)` | | Sound effect | `< >` | `` | | Dialogue | `{ }` | `{Your order is ready.}` | | Subtitle | `【 】` | `【Morning batch】` | For non-Chinese speech, declare the language before the line. Add regional variety and delivery only if they matter: ```text Dialogue language: natural Mexican Spanish. speaks warmly and at a relaxed pace: {Tu pedido está listo.} ``` This is clearer than asking for “authentic speech” and hoping the model infers the language, speaker, accent, and tone. ## A 30-second Seedance 2.5 prompt template For a multi-event clip, each stage should make one principal change. The end state must be something a reviewer can see, not an abstract mood.\[1] ```text [Goal] Create a 30-second instructional video showing one barista preparing a cold brew order. [0–10 seconds] Initial state: the glass, ice scoop, and coffee carafe are on the counter. Primary event: fills the glass halfway with ice. End state: the scoop is back on the tray; the half-filled glass remains centered. [10–20 seconds] Continue with the same person, clothing, glass, and counter layout. Primary event: pours cold brew to the upper mark, then stops. End state: the carafe is upright on the left; the filled glass remains centered. [20–30 seconds] Primary event: adds the lid and moves the drink to the pickup mat. End state: the completed drink is centered on the pickup mat; both hands have left frame. [Preserve] Keep identity, apron, glass design, liquid color, prop ownership, screen direction, counter geometry, camera axis, lighting, and room ambience consistent. ``` Notice what is absent: three actions squeezed into every second, a new camera move in every stage, and vague endings such as “the scene feels complete.” The model needs a state it can hand from one segment to the next. ## Three ways to use time The official guide treats time as a pacing budget rather than frame-accurate editing.\[1] 1. **Time range:** `0–6s`, `6–14s`, `14–22s`. Use this to allocate story beats. 2. **Exact point:** “At 12 seconds, the practical light switches from blue to amber.” Use this for one transition. 3. **Relative timing:** “Two seconds after the lid closes, the pickup bell rings.” Use this when one event triggers another. Keep ranges consecutive and non-overlapping. A range can drift slightly around its boundary, so do not use it to demand impossible event frequency. For camera-specific troubleshooting, see [Seedance 2.5 camera control](/blog/seedance-2-5-camera-control). ## How to prompt a video edit Editing prompts fail when the requested change is clear but the protected content is not. Use a four-part contract: ```text [Edit goal] Edit @Video 1. From 5–8 seconds, change only the desk lamp from white to orange. [Master] @Video 1 is the sole editing master for people, action, composition, camera, occlusion, audio, and event order. [Edit scope] Modify only the lamp body and the light it casts on the desk. [Preserve] Keep the person's identity, clothing, expression, position, hand motion, room geometry, camera movement, dialogue, and ambience unchanged. ``` For subject replacement, add two more rules: keep the number of target objects fixed, and make the replacement inherit every appearance, occlusion, movement, and exit of the original object. For background replacement, exclude the subject silhouette from the edit scope. Dreamina's editing modes are product workflows, not evidence of fields in a public Seedance 2.5 API. Keep the conceptual prompt separate from any future request schema. ## How to prompt video extension An extension has one non-negotiable job: connect at the boundary. ### Forward extension ```text @Video 1 is the source video to extend forward. The first extension frame continues the last source frame. Preserve the cyclist's pose and direction, bicycle position, road geometry, camera height, afternoon light, and forward motion. Then the cyclist passes beneath the bridge and slows beside the orange marker. Keep one continuous cyclist and one bicycle; do not duplicate either subject. ``` ### Backward extension For a backward extension, describe the new preceding event first. Then define the source video's first frame as the required final state of the extension. Also list any character or effect that must not appear before the source video begins. Boundary continuity does not mean pixel identity. Review the last frames before the join, the first frames after it, and the full extended sequence. ## First frame, last frame, and multiple keyframes In multimodal reference mode, define anchor images separately:\[1] ```text @Image 1 is the first frame. It defines the opening composition and object positions. @Image 2 is the last frame. It defines the final composition and object positions. @Image 3 defines the courier's identity and orange jacket only. The courier carries one parcel from the van to the doorway in one continuous action. Begin from @Image 1 and arrive naturally at @Image 2. Preserve identity, parcel count, building geometry, lighting, and camera direction. ``` Use the same aspect ratio for first and last frames. If several images define intermediate stages, state that they are keyframes in order, define the visible state of each one, and ask for continuous transitions between them. Independent images are usually clearer than a dense storyboard collage. ## A practical prompt review checklist Before generating, check eight things: 1. Is there one clear output goal? 2. Does every reference have one named role and an exclusion? 3. Are repeated views explicitly identified as the same subject? 4. Does each stage contain only one main state change? 5. Is every end state visible and testable? 6. Are dialogue language, speaker, and delivery explicit? 7. Does the preserve list cover identity, count, ownership, space, camera, and audio? 8. For edits or extensions, is the source video's control boundary unambiguous? If a generation fails, remove ambiguity before adding adjectives. Reduce the reference set, narrow the edit scope, or split an overloaded stage. ## Reuse the prompt structure in an automated workflow The reference manifest, staged timeline, end states, and preserve list are useful whether a creator generates manually or a product submits tasks through an API. For automation today, use [Seedance 2.0 on reAPI](/models/seedance-2-0), keep the model identifier configurable, and save successful prompts as an evaluation set for the future [Seedance 2.5 route](/models/seedance-2-5). ## FAQ ### What is the best Seedance 2.5 prompt structure? Use goal, subject and event, scene, reference roles, staged timeline, camera, audio, end states, and a preserve list. Omit blocks that do not affect the result. ### How many references can Dreamina Seedance 2.5 use? The official prompt guide lists up to 30 images, 10 videos, and 10 audio clips—50 materials in total. Video and audio inputs each have a combined 30-second limit.\[1] ### Should I upload all 50 references? Usually not. Start with the smallest set that defines identity, product, scene, motion, and audio. More assets create more relationships that must be mapped and preserved. ### How do I write a 30-second prompt? Use consecutive time ranges. Give each range one main event, an observable end state, and the state inherited from the previous range. ### Can I control an action at an exact second? You can request an exact timestamp, but treat it as direction rather than frame-accurate editing. The official guide warns that actions may land slightly around a time boundary.\[1] ### How do I stop reference characters from swapping? Map each character to a specific asset, give each a unique label, state which props belong to whom, and explicitly prohibit identity, clothing, position, action, and dialogue swaps. ### Is the Seedance 2.5 API available on reAPI? Not yet. The page is a coming-soon preview. Use [Seedance 2.0 on reAPI](/models/seedance-2-0) for a production API and monitor [Seedance 2.5](/models/seedance-2-5) for a verified launch. ## The shorter prompt is often the more controlled prompt Seedance 2.5 does not need more prose; it needs fewer unstated relationships. Label the inputs, give each stage one job, describe the state that survives the cut, and protect everything outside the requested change. That is the difference between asking for a video and directing one. Keep the reference manifest and prompt template alongside the project files, then reuse them across revisions instead of rebuilding the brief from memory. ## References 1. ByteDance Dreamina. *Dreamina Seedance 2.5 Prompt Guide.* Modified July 31, 2026. Retrieved August 2, 2026 from [bytedance.larkoffice.com](https://bytedance.larkoffice.com/docx/A88jd0B47oAd8zxWp5ycZFMfnxh) ### Further reading * reAPI. *Dreamina Seedance 2.5 User Guide.* [reapi.ai/blog/dreamina-seedance-2-5-user-guide](/blog/dreamina-seedance-2-5-user-guide) * reAPI. *Seedance 2.5 camera control.* [reapi.ai/blog/seedance-2-5-camera-control](/blog/seedance-2-5-camera-control) * reAPI. *Seedance 2.5 for ecommerce video.* [reapi.ai/blog/seedance-2-5-ecommerce-video](/blog/seedance-2-5-ecommerce-video) * reAPI. *Seedream-to-Seedance handoff.* [reapi.ai/blog/seedream-seedance-handoff](/blog/seedream-seedance-handoff) --- # Dreamina Seedance 2.5 User Guide: 30s & Long-Video Modes (https://reapi.ai/blog/dreamina-seedance-2-5-user-guide) **Dreamina Seedance 2.5 is best understood as a production workflow, not a single text box.** You can build a complete scene of up to 30 seconds, extend eligible source videos into a longer sequence, plan an Ultra Long Video project of up to 180 seconds, direct events with timestamps, combine multimodal references, and repair selected parts without regenerating everything.\[1] The practical skill is choosing the smallest workflow that solves the shot. If this is your first AI video, you can begin with the eight-second copy-and-change example below. If you already run professional productions, the same guide expands into beat sheets, asset manifests, continuity locks, editing passes, and scene-level review. Every major workflow includes a reusable example and a concrete way to fix common failures. ## TL;DR: choose the workflow before writing the prompt * Use **standard generation** for one location, one main event, and roughly three to five consecutive beats inside 30 seconds. * Use **Extend Video** when an existing clip already has the correct cast, framing, environment, and motion. Dreamina's guide says the source must be shorter than 30 seconds, and describes continued extensions up to a 60-second result; the extension prompt controls the newly added segment.\[1] * Use **Ultra Long Video** for a structured project of up to 180 seconds. Plan it as connected scenes with shared continuity rules, not as one enormous paragraph. * Assign one job to every image, video, and audio reference. Also state what each reference must not control. * Use **time ranges** for sustained action, **exact moments** for a visible beat, and **relative timing** when one event triggers another. * Choose **Smart Edit** for an outcome-level change, **Edit with Marks** for a specific object or region, and **Edit Video** for a change tied to source footage or time. * For every edit, write three lists: **change**, **preserve**, and **validate**. * Treat subtitles, dialogue, sound effects, ambience, and BGM as separate layers. Name the layer to remove and the layers to protect. ## Seedance 2.5 workflow at a glance ![Dreamina Seedance 2.5 workflow covering creation, extension, timestamp direction, editing, localization, and storyboard or Clay Renderer blocking](https://cdn.reapi.ai/media/blog/dreamina-seedance-2-5-user-guide/dreamina-seedance-2-5-user-guide-feature-map.png) The six modules solve different production problems. **Create** establishes the shot. **Extend** protects continuity across a boundary. **Direct** assigns events to time. **Edit** changes the smallest possible target. **Localize** controls language and sound. **Block** supplies spatial structure through storyboards or Clay Renderer references. ## How to use this guide as a beginner or a professional You do not need a production vocabulary to start. Beginners can copy the smallest example, change the subject and scene, and generate a short result. Experienced creators can use the same example as a base layer, then add references, timed beats, continuity locks, editing passes, and formal review criteria. | Your experience | Start here | Add only after the baseline works | Skip at first | | -------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ----------------------------------------------------- | | First AI video | One subject, one action, one scene, 5–10 seconds | One camera instruction and one end state | Large reference packs and multi-scene stories | | Some generation experience | 15–30-second beat sheet and 1–3 references | Audio, exact timing, first/last frames | Ultra-long projects before continuity is stable | | Professional creator | Continuity sheet, asset manifest, scene cards, review rubric | Editing passes, Clay blocking, audio plan, transition design | Nothing by default—choose controls by production need | ### Beginner example: make one clear eight-second shot Copy this complete example, then replace the subject, action, and location with your own.
**Input — complete prompt** ```text Create an 8-second realistic video. One golden retriever walks into a sunny kitchen, stops beside a blue food bowl, and looks toward the camera. Use a fixed eye-level medium shot. Keep the dog fully visible. Natural morning room sound, no dialogue, no music. End with the dog standing beside the bowl and looking at camera. ```
Why it works: * **One subject:** the model does not need to track a cast. * **One action chain:** enter, stop, look. * **One location:** there is no scene transition to invent. * **One camera rule:** a fixed medium shot reduces competing direction. * **One end state:** you can immediately decide whether the result passed. If the dog never reaches the bowl, shorten the entrance or remove “looks toward the camera.” Do not solve an overloaded action by adding decorative adjectives. ### Advanced version: build on the same shot Once the baseline works, add controls instead of replacing the whole prompt:
**Input — complete prompt** ```text Create a 12-second realistic video. @Image 1 defines the same golden retriever's face, coat color, and red collar only. @Image 2 defines the sunny kitchen layout and blue bowl only. Do not copy the people, camera angle, or background objects from the references. 0–5 seconds: the dog enters from frame left and walks toward the blue bowl. End state: all four paws stop beside the bowl. 5–9 seconds: the dog looks down at the bowl, then raises its head. End state: the dog's head faces forward. 9–12 seconds: make one slow camera push-in as the dog looks at camera. End state: the same dog and one blue bowl remain centered. Preserve identity, red collar, bowl count, kitchen layout, morning light, screen direction, floor contact, and natural room ambience. ```
The professional version adds identity ownership, reference exclusions, timing, camera movement, cardinality, and continuity. The story remains simple; only the control becomes more precise. ### Find the example that matches your task | Task | Example in this guide | | ------------------------------------- | ------------------------------------------------ | | First text-to-video generation | Eight-second dog-and-bowl example above | | Image-referenced character or product | Advanced dog example and asset-manifest section | | Full 30-second scene | Travel-bottle timed prompt | | Continue a successful clip | 10-second source plus 5-second athlete extension | | Change one object | Marked suitcase replacement | | Remove subtitles or BGM | Cleanup examples with protected layers | | Two-person dialogue | Mina and Owen identity-and-voice example | | Replace a green background | Rainy station composite example | | Guide complex motion | Clay Renderer handoff example | | Build a long story | 180-second designer scene-card example | ## Before generating: make a one-page production brief A good production brief prevents more failures than a longer prompt. Write the information that must survive every generation, extension, or edit before uploading any references. ### Build a continuity sheet | Continuity item | What to record | Example lock | | --------------- | ----------------------------------------- | ------------------------------------------------------ | | Character | Face, hair, clothing, age range, voice | Mina keeps the same short black hair and orange jacket | | Prop | Shape, color, count, owner | One silver parcel, always carried by Mina | | Space | Entrance, exits, relative positions | Counter remains left; pickup door remains frame right | | Camera | Axis, height, direction, movement | Eye-level camera; no axis reversal | | Light | Direction, color, time of day | Soft morning light from frame left | | Audio | Dialogue language, voice, ambience, music | English dialogue, quiet store ambience, no BGM | | Start state | What is visible before the action | Mina stands outside with the parcel in her right hand | | End state | What must be visible after the action | Parcel is centered on the counter; both hands leave it | Use observable locks. “Keep the scene cinematic” cannot be verified. “The orange jacket, one parcel, left-to-right movement, and morning light remain unchanged” can. ### Create an asset manifest Dreamina's official prompt guide documents up to 30 images, 10 videos, and 10 audio clips, with 50 materials in total. Video references and audio references each have a combined limit of 30 seconds.\[2] The maximum is capacity, not a recommended starting point. | Asset | Its only job | Inherit | Do not inherit | | ---------- | ------------------ | -------------------------------------- | ----------------------------- | | `@Image 1` | Character identity | Face, hair | Background, pose, clothing | | `@Image 2` | Wardrobe | Orange jacket, black trousers | Model's face, studio lighting | | `@Image 3` | Location | Counter layout, doorway, morning light | People, signs, products | | `@Video 1` | Motion | Walking pace, parcel handoff | Performer, room, camera color | | `@Audio 1` | Voice | Speaker tone and delivery | Words from the sample | Start with the smallest set that fully defines the scene. Add another asset only when it resolves a specific failure. ### Define pass conditions before generation Reviewers need a shared definition of “done.” A compact pass list might be: 1. The same character appears in every beat. 2. Exactly one parcel remains in the scene. 3. The action order matches the beat sheet. 4. The camera stays on the same side of the action. 5. Dialogue belongs to the correct speaker. 6. The last frame reaches the stated end condition. These checks turn subjective rerolling into a repeatable review process. ## Start a project in Dreamina 1. Open the [official Dreamina creator site](https://dreamina.capcut.com/ai-tool/home) and enter **AI Video**. 2. Select Seedance 2.5, then choose the input path that matches the job: text, multimodal references, first and last frames, an existing source video, extension, or an editing workflow. 3. Set duration and aspect ratio before building references. Anchor images should use the same ratio as the intended output. 4. Upload the smallest useful reference pack and label each asset's role in the prompt. 5. Generate once, compare the result with the pass conditions, then choose between a prompt revision and a localized edit. Do not respond to every failure by adding more text. If the identity is wrong, improve identity mapping. If the event order is wrong, simplify the beat sheet. If only one object is wrong, edit that object instead of regenerating the scene. ## Choose between 30 seconds, extension, and Ultra Long Video The duration options represent different production methods. | Workflow | Described ceiling | Best for | Planning unit | Main risk | | ------------------- | ---------------------------------------------------------- | ---------------------------- | ------------------------------- | -------------------------------------- | | Standard generation | Up to 30 seconds | One complete scene | Timed beats | Too many events for one timeline | | Continued extension | Source under 30 seconds; continued result up to 60 seconds | Continuing a successful clip | Boundary state plus new segment | Visible jump at the join | | Ultra Long Video | Up to 180 seconds | Multi-scene stories | Scene cards and transitions | Character, prop, light, or audio drift | ### Build one complete scene in 30 seconds Thirty seconds works best when the viewer stays in one location and follows one main change. Begin with the final frame you need, then work backward into three or four stages.
**Input — complete 30-second prompt** ```text [Goal] Create a 30-second product story for one reusable travel bottle. [References] @Image 1 defines the bottle shape, matte-blue finish, and white logo placement only. @Image 2 defines the kitchen layout and morning window light only. Keep exactly one bottle. Do not copy people from either image. [0–7 seconds] One runner enters the kitchen and places the closed bottle at the center of the counter. End state: the bottle stands upright; both hands leave it. [7–16 seconds] The runner opens the bottle, adds water, and closes the lid. End state: the lid is fully closed; no water is spilled. [16–24 seconds] The runner picks up the same bottle and walks toward the door. End state: the runner reaches the doorway with the bottle in the right hand. [24–30 seconds] Slow push-in as the runner turns the bottle label toward camera. End state: one bottle fills the center third; the label is readable; the runner stops moving. [Audio] Natural kitchen ambience, lid click at 14 seconds, no dialogue, no BGM. [Preserve] Bottle geometry, matte-blue color, logo position, runner identity, wardrobe, screen direction, kitchen layout, morning light, and camera axis. ```
This prompt gives every interval one main state change. If the model skips an event, reduce the number of actions before increasing the duration. ### Extend an existing video without a visible jump Dreamina's guide describes a concrete Extend Video flow and continued results up to 60 seconds:\[1] 1. Choose the target clip in the generation stream and open its extension control. 2. Use an original clip shorter than 30 seconds; the guide marks that as an eligibility condition. 3. Set the added duration using the visible duration control, timeline gesture, or direct value available in the interface. 4. Write only the action required for the newly added portion. The source footage remains the master for the original segment. 5. Generate the combined result, then review the seconds immediately before and after the join. Suppose the source is 10 seconds and the added segment is 5 seconds. The extension instruction should describe those new five seconds, not rewrite the first ten:
**Input — complete extension prompt** ```text Extend @Video 1 forward by 5 seconds. [Boundary state] Continue from the final source frame: the athlete has just landed, knees bent, right hand touching the floor, camera low and facing the athlete, blue arena light. [New action] The athlete rises, looks directly toward the camera, and takes one controlled breath. Do not repeat the jump or add another landing. [Preserve] Same athlete, uniform, body position at the join, camera height, lens direction, arena geometry, blue light, motion speed, crowd ambience, and source aspect ratio. [End state] The athlete stands still at center frame and looks at camera; both feet remain planted. ```
Review the join at normal speed and frame by frame. Check pose, screen position, movement direction, prop count, lighting, focus, camera velocity, ambience, and audio level. A good continuation begins by matching the boundary; new story information comes second. ### Plan an Ultra Long Video project of up to 180 seconds Do not write a 180-second prompt as one uninterrupted paragraph. Divide the project into scene cards and give every card an entry state, one primary event, an exit state, and a transition. | Scene card | Duration | Entry state | Primary event | Exit state | Transition | | -------------- | -------: | ------------------------------ | --------------------------------- | --------------------------------- | --------------------------------------- | | 1. Workshop | 0–25s | Designer enters empty workshop | Unpacks prototype | Prototype centered on table | Match cut on circular dial | | 2. Street test | 25–60s | Dial fills frame | Product tested in rain | Product still working | Water droplet becomes window reflection | | 3. Train | 60–105s | Reflection on train window | Designer reviews data | Green result appears | Screen glow becomes dawn light | | 4. Lookout | 105–150s | Dawn light on face | Final field test | Designer smiles and packs product | Bag closes across frame | | 5. End card | 150–180s | Dark frame after bag close | Product reveal and closing motion | Product centered, motion stopped | Hold final composition | Prepare four reusable documents before generating: * a **character bible** for face, hair, wardrobe, posture, and voice; * a **prop ledger** for object appearance, count, owner, and condition; * **location rules** for layout, time of day, weather, and camera direction; * an **audio plan** for dialogue, ambience, effects, music, and transitions. Test the hardest scene first. If a rain sequence, two-person exchange, or complex camera move cannot hold continuity in isolation, a longer timeline will magnify the problem. ## Use multimodal references without making them fight Multimodal input is useful only when ownership is explicit. A face image, clothing image, motion clip, room image, and voice sample can work together because each controls a different layer. ### Set a priority order for conflicting references When two assets contain overlapping information, state which one wins: ```text Reference priority: 1. @Image 1 controls face and hair. 2. @Image 2 controls clothing only. 3. @Video 1 controls motion timing and camera movement only. 4. @Image 3 controls room layout and light only. 5. @Audio 1 controls voice identity and delivery only. If any reference conflicts, follow this priority order. ``` A weak instruction says, “Use all references for the character and style.” A controlled instruction names the owner of every attribute and excludes the irrelevant material in each file. ### Keep first and last frames compatible The first anchor establishes the opening composition and output ratio. The last anchor defines where the motion must arrive. Use matching aspect ratios, keep the subject count consistent, and explain what connects the two states. Additional identity references should not override the anchor compositions.\[2] ## Direct the timeline with three kinds of time instruction Dreamina supports timestamp-based direction, but the timeline still needs a realistic action budget.\[1] | Timing method | Use it for | Example | | --------------- | -------------------------------- | ------------------------------------------------------------ | | Time range | Sustained action or a story beat | `6–12s: she opens the case and removes one camera` | | Exact moment | One visible or audible change | `At 18s, the red practical light turns blue` | | Relative timing | Cause and effect | `Two seconds after the door closes, the train begins moving` | ### Build a four-track beat sheet | Time | Picture | Dialogue | Effects and ambience | Music | | ------ | -------------------------------------- | ---------------------------- | -------------------- | ----------------------- | | 0–6s | Mechanic opens workshop | None | Door roll, room tone | None | | 6–14s | Mechanic places one camera on bench | “Let's test the stabilizer.” | Case latch | Low pulse begins | | 14–22s | Camera powers on; status light changes | None | Power chime | Pulse continues quietly | | 22–30s | Mechanic demonstrates one smooth pan | “No shake.” | Motor sound | Music ends at 29s | Then turn the table into prompt language and add a visible end state to every range. Avoid assigning simultaneous dialogue, a prop change, a location change, and a complex camera move to the same two seconds. Treat timestamps as direction, not a promise of frame-accurate nonlinear editing. If a key action lands too early, simplify the preceding beat or express the timing relative to a clear trigger. ## Choose the right editing workflow Dreamina lists Smart Edit, Edit with Marks, and Edit Video as distinct workflows.\[1] They share a preserve-first discipline, but they solve different problems. | Workflow | Best suited to | Prompt must identify | Main review risk | | --------------- | --------------------------------- | ---------------------------------------------- | ----------------------------- | | Smart Edit | An outcome-level correction | Desired result and protected content | The change spreads too widely | | Edit with Marks | One object or bounded region | Marked target, replacement, edges, occlusion | Flicker or damaged boundaries | | Edit Video | A source-footage change over time | Source master, time range, action, audio locks | Timing or motion drift | ### Smart Edit: describe the result and the boundary Use Smart Edit when the desired correction is easy to state but not tied to one tiny shape.
**Input — Smart Edit instruction** ```text Change the afternoon scene to light rain. Add rain only outside the café windows and on the exterior pavement. Preserve the two people, faces, hair, clothing, table objects, indoor lighting, dialogue, camera movement, and all reflections already inside the café. Validate that no rain appears indoors and no person's appearance changes. ```
### Edit with Marks: control one object or region Mark the smallest useful target. Describe the replacement, what should appear around its edges, and how it behaves under occlusion.
**Input — marked-object instruction** ```text The marked red suitcase is the only editable object. Replace it with one navy hard-shell suitcase matching @Image 2. Keep its original size, path, wheel contact, hand contact, shadows, occlusion, and time in frame. Preserve every person and all unmarked luggage. ```
### Edit Video: make the source the master
**Input — source-video instruction** ```text @Video 1 is the sole master for composition, people, action order, camera, and audio. From 8–12 seconds, change only the desk lamp body from white to orange. Update the lamp's local light spill on the desk. Preserve faces, clothing, hand motion, desk geometry, camera movement, dialogue, room ambience, and every event outside 8–12 seconds. ```
The official prompt guide notes that editing preserves the source ratio and approximately preserves duration, with a possible small difference of about 0.3 seconds from frame handling.\[2] Review both edit boundaries instead of judging only the middle frame. ## Remove subtitles, BGM, and unwanted visual elements Cleanup tasks fail when “audio” or “text” is treated as one layer. Separate the categories before editing. ### Remove irrelevant subtitles without deleting useful text
**Input — subtitle cleanup instruction** ```text Remove the subtitle line at the bottom from 4–9 seconds only. Reconstruct the floor texture and moving shadow behind the removed letters. Preserve the store sign, product label, wall poster, faces, camera movement, dialogue, sound effects, and all text outside the subtitle region. ```
Check for letter fragments, soft rectangles, repeating background texture, and flicker as the camera moves. ### Detach or remove BGM while protecting speech Write an audio manifest before the edit:
**Input — audio-layer instruction** | Layer | Action | | ------------- | ----------------------------------------- | | Dialogue | Preserve both speakers and timing | | Sound effects | Preserve door, footsteps, glass placement | | Ambience | Preserve quiet restaurant room tone | | BGM | Remove throughout the clip |
After cleanup, listen for clipped consonants, pumping volume, missing ambience, or a sudden noise-floor change. “Remove all background audio” is too broad when the scene needs effects and room tone. ### Remove one object across time For partial elimination, name the object, time range, newly revealed background, and occlusion behavior:
**Input — object-removal instruction** ```text Remove the black microphone stand from 0–14 seconds. Reconstruct the wooden stage floor and blue curtain behind it. When the singer crosses the area, preserve the singer in front and rebuild only the hidden portion of the stand. Keep the microphone in the singer's hand. ```
Review the complete motion path. A clean still frame can still hide a ghost, popping edge, or broken shadow in motion. ## Transfer an idea without copying unwanted details “Transfer Ideas” is most useful when you isolate the layer worth borrowing: action logic, composition, camera rhythm, transition design, or story structure. Do not ask the source to control everything.
**Input — transfer instruction** ```text [Transfer] Use @Video 1 only for the sequence: reveal object, circle it once, then end on a top view. [Replace] Use the ceramic tea set from @Image 1, the quiet studio from @Image 2, and the warm paper texture described below. [Do not inherit] Do not copy the source performer, brand marks, text, colors, room, product, music, or voice. ```
Review the result for accidental source identities, logos, wording, color palettes, and props. ## Change spatial perspective without breaking geometry A perspective edit needs spatial relationships, not an invented focal-length number. Describe the scene in layers: * **foreground:** bicycle wheel crosses the lower-left edge; * **midground:** courier and parcel remain centered; * **background:** doorway stays behind the courier, two meters away; * **view direction:** camera moves from front-left to side view without crossing behind the courier; * **preserve:** body proportions, parcel shape, ground contact, horizon, and light direction. After the edit, check scale, horizon, vanishing direction, occlusion order, contact shadows, and feet touching the floor. Objects that merely change viewpoint should not change size or ownership without a stated reason. ## Control tone references and multi-person scenes Multi-person generation becomes much more stable when every person has a profile and every line names its speaker.
**Input — complete two-person prompt** ```text = face from @Image 1 + orange jacket from @Image 2 + voice from @Audio 1. = face from @Image 3 + grey shirt from @Image 4 + voice from @Audio 2. 0–6 seconds: Mina stands frame left; Owen stands frame right. Both remain still. Mina says in calm English: {The test starts now.} 6–12 seconds: Owen presses one button with his right hand. Owen says in a lower, measured voice: {Power is stable.} 12–18 seconds: Mina checks the display while Owen keeps both hands off the device. No speaker, voice, clothing, position, or action swaps. ```
For a tone or voice reference, say whether the asset controls voice identity, pitch range, pace, emotion, or delivery. Keep the written dialogue separate so the sample does not accidentally supply the words. ## Use green-screen editing for cleaner composites The subject silhouette is the protected asset. Preserve face, hair strands, semi-transparent edges, clothing, pose, subject scale, motion blur, and movement timing while changing only the background.
**Input — green-screen instruction** ```text Replace the green background with a rainy station platform at dusk. Keep the performer silhouette, hair edges, transparent raincoat, pose, scale, walking motion, camera movement, and source duration unchanged. Match the new background perspective and camera speed. Add cool light from frame right, subtle wet-floor reflection, and a contact shadow under both feet. Remove green spill without changing the raincoat color. ```
Inspect hair, fingers, motion-blurred edges, reflective clothing, feet, and any object crossing the silhouette. Edge shimmer is usually more visible during motion than on the preview frame. ## Use Clay Renderer for motion and spatial blocking Clay Renderer turns a simple white-model or blocked 3D scene into a spatial guide. The block should control geometry, camera path, movement, contact, and occlusion; separate references should control final identity, wardrobe, materials, environment, and visual style.\[1]
**Input — Clay Renderer handoff** ```text @Video 1 is the Clay Renderer blocking reference. Inherit only the two-person motion, camera path, table position, hand contact, and occlusion order from @Video 1. Replace Character A with and Character B with . Use the workshop environment from @Image 5 and product materials from @Image 6. Do not inherit white clay materials, placeholder faces, untextured background, or temporary lighting from the blocking reference. Preserve the blocked walking paths, handoff timing, subject scale, camera direction, table contact, and final positions. ```
Compare the result against the block for path, contact, collision, scale, camera direction, and occlusion. Clay Renderer is a reference workflow; it should not be described as a native Maya or Blender scene-file integration unless an official integration is documented. ## Build seamless transitions and multi-grid storyboards A storyboard grid defines ordered visual states. It does not automatically explain the motion between them. Give each panel one job and write a transition sentence between every pair. | Panel | Anchor state | Transition instruction | | ----- | ------------------------------ | -------------------------------------------------------------- | | 1 | Chef holds closed box at waist | Camera follows as the box rises toward the table | | 2 | Box centered on table | Chef opens lid while camera moves closer without changing axis | | 3 | Product visible inside box | Product rotates once as chef's hands leave frame | | 4 | Product fills center frame | Light softens and movement settles into final hold | At each join, define the shared state: character position, facing direction, velocity, hand pose, prop ownership, camera direction, lighting, and ambient sound. Useful transition patterns include continuous action, matched composition, foreground occlusion, and a shared shape. Treat them as directing methods, not guaranteed interface presets. ## Three end-to-end workflow examples ### Example 1: a 30-second product story **Brief:** Show one compact speaker unfolding, powering on, and playing music on a hotel desk. **Assets:** front, side, and rear product images; one hotel-room reference; one unfolding motion clip; one power-on chime. **Sequence:** map each image to one product view, write three timed beats, lock the speaker count to one, and state the final label orientation. Generate the baseline before adding camera movement. **Review:** product geometry, hinge direction, button location, one-speaker count, desk contact, chime timing, and final label visibility. **Likely failure:** three product views become three speakers. **Correction:** state that all product images describe the same unit and keep exactly one speaker in every frame. ### Example 2: a 15-second result built from a 10-second source **Brief:** Continue a successful athletic landing for five seconds. **Assets:** one eligible 10-second source clip; no new identity reference unless the face already drifts. **Sequence:** select Extend Video, add five seconds, restate the final pose and camera state, then describe the rise and final look. Do not rewrite the original ten seconds. **Review:** one continuous athlete, no repeated landing, matching pose at the join, stable arena geometry, continuous camera motion, and unchanged ambience. **Likely failure:** the extension begins with the athlete already standing. **Correction:** make the first extension frame continue the crouched landing pose before any new action. ### Example 3: a multi-scene 180-second brand film **Brief:** Follow one designer testing a prototype across workshop, street, train, and outdoor locations. **Assets:** character profile, wardrobe views, prototype views, four location references, motion clips for the hardest actions, voice sample, and storyboard anchors. **Sequence:** create scene cards, lock the prototype owner and condition, define audio transitions, generate the most difficult scene first, then connect scenes using shared shapes or motion. **Review:** face, clothing, prototype geometry, prop condition, time-of-day progression, screen direction, voice identity, BGM continuity, and every scene boundary. **Likely failure:** wardrobe or product details drift after the second location. **Correction:** repeat the character and prop profiles in every scene card and reduce scene-specific references that contain conflicting people or products. ## Quality-control checklist before export ### Identity and objects * [ ] Each person keeps the assigned face, hair, clothing, voice, and position. * [ ] Object count, owner, geometry, label, and condition remain consistent. * [ ] No reference-only person, logo, subtitle, or prop leaks into the result. ### Timing and story * [ ] Every beat occurs in the intended order. * [ ] Each time range reaches a visible end state. * [ ] Dialogue, effects, and music support rather than compete with the action. * [ ] The final frame satisfies the brief. ### Camera and space * [ ] Camera axis, height, direction, and movement remain intentional. * [ ] Scale, horizon, contact, shadows, reflections, and occlusion make sense. * [ ] Extensions and transitions have no visible pose, light, or audio jump. ### Edits and cleanup * [ ] Only the intended target changed. * [ ] Edit boundaries do not flicker or drift. * [ ] Removed text or objects reveal a plausible background. * [ ] BGM cleanup preserves dialogue, effects, and ambience requested in the brief. ## Troubleshooting common Seedance 2.5 problems | Symptom | Likely cause | Practical fix | | ------------------------------------- | ----------------------------------------------- | ----------------------------------------------------------------------- | | Timestamp ignored | Too many actions compete in one range | Reduce events and give the range one end state | | Important action omitted | Timeline is overfilled | Split the action or move it into another stage | | Character identity swaps | References are not mapped per person | Create named profiles and ban face, clothing, voice, and position swaps | | References fight each other | Several assets control the same attribute | Add an explicit priority order and exclusions | | Extension begins with a jump | Boundary pose or camera state is missing | Restate the final source frame before new action | | Perspective edit distorts the subject | Spatial layers and protected geometry are vague | Define foreground, midground, background, scale, horizon, and contact | | Removed object leaves a ghost | Hidden background and occlusion are unspecified | Describe what must be reconstructed through the full time range | | Subtitle area flickers | Cleanup is judged on one frame | Review motion and require consistent texture reconstruction | | BGM removal damages dialogue | Audio layers were grouped together | List dialogue, effects, ambience, and music separately | | Green-screen edge shimmers | Fine edges and motion blur were not protected | Lock hair, fingers, transparent material, blur, and silhouette | | Storyboard transition feels abrupt | Panels define states but not connecting action | Write a transition sentence between every pair | | Long-video scenes drift | Global continuity rules are not repeated | Reuse character, prop, location, and audio profiles in every scene card | ## Using the workflow in a product pipeline Dreamina is useful for hands-on creation and editing. For software automation, [Seedance 2.5 on reAPI](/models/seedance-2-5) is not yet callable; [Seedance 2.0](/models/seedance-2-0) is the current production option. Keep the model name configurable, save the prompts and pass conditions above as an evaluation set, and reuse the same continuity checks when a verified 2.5 endpoint becomes available. ## FAQ ### How much action should fit into a 30-second prompt? Use one main event with roughly three to five beats. Give every beat one observable end state. If an action is repeatedly omitted, reduce the event count instead of adding more adjectives. ### How do I extend a scene without a visible jump? Begin the extension by restating the source video's final pose, subject position, movement direction, camera state, light, and audio. Describe new action only after that boundary is locked. ### Can any source video be extended? The official Dreamina guide says the original source must be shorter than 30 seconds for the described Extend Video workflow.\[1] ### Should I use all 50 reference slots? Usually not. Use the smallest pack that defines identity, wardrobe, props, scene, motion, and sound. Every additional asset creates another relationship that must be mapped and preserved. ### What is the difference between Smart Edit and Edit with Marks? Smart Edit is better for an outcome-level correction. Edit with Marks is better when you can point to one object or bounded region. In both cases, list what must remain unchanged. ### How do I stop two speakers from swapping identity or voice? Create a named profile for each person, bind face, clothing, and audio references separately, name the speaker in every dialogue line, and specify who remains still during the other person's action. ### Can I remove BGM while keeping dialogue and effects? Treat dialogue, sound effects, ambience, and music as four separate layers. Ask to remove BGM and explicitly preserve the other three, then listen for voice damage and level jumps. ### What should Clay Renderer control? Use it for blocking: geometry, camera path, movement, contact, and occlusion. Use separate references for identity, clothing, material, environment, and final style. ### Why does a storyboard still need transition instructions? Panels define anchor states, not all intermediate motion. A transition sentence explains how position, speed, camera, lighting, and props move from one anchor to the next. ## Build the shot, then protect what already works Seedance 2.5 becomes easier to direct when each workflow has a narrow job. Build short scenes from timed end states. Extend from a documented boundary. Organize longer projects with scene cards. Map every reference. Use localized edits only after defining what cannot change. The most useful habit is also the simplest: before every generation or edit, write **change**, **preserve**, and **validate**. That turns a feature list into a repeatable production process. ## References 1. ByteDance Dreamina. *Dreamina Seedance 2.5 User Guide.* Modified July 31, 2026. Retrieved August 2, 2026 from [bytedance.larkoffice.com](https://bytedance.larkoffice.com/wiki/NjnWwvf4BiFYFLk2RzrcEgaunGf) 2. ByteDance Dreamina. *Dreamina Seedance 2.5 Prompt Guide.* Modified July 31, 2026. Retrieved August 2, 2026 from [bytedance.larkoffice.com](https://bytedance.larkoffice.com/docx/A88jd0B47oAd8zxWp5ycZFMfnxh) ### Further reading * reAPI. *Dreamina Seedance 2.5 Prompt Guide.* [reapi.ai/blog/dreamina-seedance-2-5-prompt-guide](/blog/dreamina-seedance-2-5-prompt-guide) * reAPI. *Seedance 2.5 camera control.* [reapi.ai/blog/seedance-2-5-camera-control](/blog/seedance-2-5-camera-control) * reAPI. *Seedance 2.5 for ecommerce video.* [reapi.ai/blog/seedance-2-5-ecommerce-video](/blog/seedance-2-5-ecommerce-video) * reAPI. *Seedance 2.0 API documentation.* [reapi.ai/docs/seedance-2-0](/docs/seedance-2-0) --- # Free AI API tiers in 2026: what each one actually limits (https://reapi.ai/blog/free-ai-api-limits-2026) If you searched for a free AI API expecting to generate images or video without paying, Google's own pricing page has bad news. Every Nano Banana variant, all three Imagen 4 models, every Veo version and the Lyria music models list their Free Tier price as the same two words: "Not available"\[1]. The free tier is real, but it covers text. That distinction is buried in a table most people skim past, and it explains a lot of frustration. Below is what each major provider's free tier actually permits, pulled from their own pricing pages in July 2026, plus the row in Google's table that almost nobody reads. ## TL;DR * **Google's free tier has no image, video or music models.** Nano Banana, Nano Banana 2, 2 Lite, Pro, Imagen 4, Veo 2, Veo 3, Veo 3.1 and Lyria 3 all show "Not available" under Free Tier\[1]. * **Google marks free-tier input as used to improve its products.** Every model block carries the row "Used to improve our products", answered Yes for Free Tier and No for Paid Tier\[1]. Google does not spell out what "improve" covers. * **Free-tier rate limits are no longer published.** Google says limits "can be viewed in Google AI Studio" and that "Specified rate limits are not guaranteed and actual capacity may vary"\[2]. * **OpenAI documents a free test request, but no ongoing allowance.** Its quickstart congratulates you on "running a free test API request"\[8]; the pricing page lists no free inference allowance beyond that\[3]. * **Replicate does have free limits; fal does not advertise any.** Replicate lets you "run select models on Replicate for free, but after a bit you'll be asked to set up billing"\[7]. fal's pricing page carries no free-tier language at all\[4]. * Paying a fraction of a cent per image is a different problem from paying nothing, and it is a much easier one to solve. ## What Google's free AI API tier actually covers Google's Gemini API pricing page lists a Free Tier column next to a Paid Tier column for every model. Twenty models show "Free of charge" in that column: Gemini 3.6 Flash, 3.5 Flash, 3.5 Flash-Lite, 3.5 Live Translate, 3.1 Flash-Lite, 3.1 Flash Live Preview, 3.1 Flash TTS Preview, 3 Flash Preview, 2.5 Pro, 2.5 Flash, 2.5 Flash-Lite, 2.5 Flash Native Audio, 2.5 Flash Preview TTS, the Embedding models, Robotics-ER 1.6 Preview and Gemma 4\[1]. Every generative media model is on the other list. The table below is copied from that page. | Model | Free Tier | Paid Tier | | ----------------------------------------- | ------------- | --------------------------------- | | Nano Banana (Gemini 2.5 Flash Image) | Not available | $0.039 per image | | Nano Banana 2 Lite (3.1 Flash Lite Image) | Not available | $0.0336 per 1K image | | Nano Banana 2 (3.1 Flash Image) | Not available | $0.067 per 1K image | | Nano Banana Pro (Gemini 3 Pro Image) | Not available | $0.134 per 1K/2K image | | Imagen 4 Fast / Standard / Ultra | Not available | $0.02 / $0.04 / $0.06 per image | | Veo 3.1 Lite | Not available | $0.05 per second (720p) | | Veo 3.1 Fast | Not available | $0.10 per second (720p) | | Veo 3.1 Standard | Not available | $0.40 per second (720p and 1080p) | | Veo 2 | Not available | $0.35 per second | | Lyria 3 Clip / Pro | Not available | $0.04 / $0.08 per song | Google is explicit about it in prose too. The Veo 3.1 description reads "available to developers on the paid tier of the Gemini API"\[1]. So when someone asks whether Nano Banana has a free API, the answer from Google's own documentation is no, on any of the four variants, for input or output. The Grounding with Google Search line on those models is also marked "Not available" for free tier\[1]. ## The row nobody reads Scroll to the bottom of any model block on that pricing page and there is a row labelled "Used to improve our products". For Free Tier it says Yes. For Paid Tier it says No\[1]. That row appears under every model, including the text models that genuinely are free of charge. Google does not define "improve our products" on that page, so the honest reading is the narrow one: on the free tier your prompts, and whatever images or documents you attach, are retained for Google's own use in a way the paid tier excludes. For a weekend project that is a fine trade. For anything touching client work, internal documents or user-submitted content, it is worth reading twice before you paste a production prompt into a free-tier key. The paid tier flips that row to No, which is the actual product difference between the two tiers on many models. ## Rate limits you cannot look up before signing up Until recently you could read Google's free-tier requests-per-minute and requests-per-day figures straight from the docs. That table is gone. The rate limits page now says limits "depend on a variety of factors (such as your usage tier) and can be viewed in Google AI Studio", followed by "Specified rate limits are not guaranteed and actual capacity may vary"\[2]. The usage-tier table is still there, and it is short. The Free tier qualification is "Active project or free trial" with no billing cap. Tier 1 requires you to "Set up and link an active billing account" and caps at $250. Tier 2 needs $100 paid plus three days, Tier 3 needs $1,000 paid plus thirty days\[2]. One free-tier ceiling is still published, and it is worth knowing: Search grounding on Gemini 2.5 Flash is "Free of charge, up to 500 RPD", with that daily limit shared with Flash-Lite\[1]. Everything else about free-tier throughput is per-project and only visible from inside your own account. Two practical consequences. You cannot capacity-plan a free AI API before you have an account. And moving off the free tier is a billing-account step, not a plan upgrade, so the "just add a card later" migration is a little more involved than it sounds. ## What the other providers mean by free The picture outside Google is simpler, and mostly it means there is no free AI API to discuss at all. **OpenAI.** The quickstart ends with "Congrats on running a free test API request!" and then points you at billing\[8]. OpenAI does not publish how many such requests a new key gets, only that the walkthrough is free to complete. Beyond that the pricing page lists per-token and per-image rates with no free inference allowance; its only free quantities are storage, 1 GB for file search and 1 GB per account per month for ChatKit uploads\[3]. Free ChatGPT is a consumer product and does not come with API credits. **fal.ai.** The pricing page is titled Pay-Per-Use. Reading it end to end, there is no mention of a free tier, a trial or starter credits\[4]. **Replicate.** This is the one real free tier in the group, and it is deliberately vague: "You can run select models on Replicate for free, but after a bit you'll be asked to set up billing"\[7]. No model list, no quota, no reset window. Past that point the pricing page applies: "You only pay for what you use on Replicate. Some models are billed by hardware and time, others by input and output"\[5] — and hardware-billed models charge for occupied GPU time, so a slow model costs more than a fast one at identical output. Notice the shape of what is on offer. A documented free walkthrough call, or an unspecified allowance on an unspecified subset. Nobody in this market is giving away image or video generation at scale, because each generation has a hard compute floor underneath it. Text is cheap enough to subsidise for goodwill. A 4K image is not. ## What a fraction of a cent actually buys Once you accept that generative media is not free anywhere, the question changes from "who is free" to "how small can the first bill be". That is a much better question, because the answer is now genuinely small. Here are current per-generation rates on reAPI, where 1 credit is $0.001 and you are billed only for completed generations\[6]: | Model and tier | Price | | ---------------------------------------------------- | ----------------- | | [GPT Image 2](/models/gpt-image-2), Stable Low | $0.005 per image | | [Nano Banana 2 Lite](/models/nano-banana-2-lite), 1K | $0.02 per image | | [GPT Image 2](/models/gpt-image-2), Self 1K | $0.03 per image | | [GPT Image 2](/models/gpt-image-2), Self 4K | $0.08 per image | | [Seedance 2.0 Mini](/models/seedance-2-0-mini), 480P | $0.046 per second | | [Seedance 2.0 Fast](/models/seedance-2-0), 480P | $0.078 per second | | [Seedance 2.0](/models/seedance-2-0), 480P | $0.095 per second | | [Seedance 2.0 Mini](/models/seedance-2-0-mini), 720P | $0.098 per second | | [Seedance 2.0 Fast](/models/seedance-2-0), 720P | $0.165 per second | | [Seedance 2.0](/models/seedance-2-0), 720P | $0.205 per second | Text models bill per token rather than per generation, and this is where Google's free tier is a genuine competitor. The reason to pay for text is that data row, not the capability\[1]: | Model | Input | Output | | ---------------------------------- | ------------------- | ----------------- | | [Kimi K3](/models/kimi-k3) | $2.50 per 1M tokens | $12 per 1M tokens | | [GPT-5.6 Sol](/models/gpt-5-6-sol) | $4 per 1M tokens | $24 per 1M tokens | Two of the image rates are worth sitting with. Nano Banana 2 Lite at $0.02 per 1K image is below Google's own paid rate of $0.0336 for the same model\[1]\[6], and it does not require a linked billing account. And a low-tier GPT Image 2 render at half a cent means testing a prompt twenty times costs a dime. Signing up on reAPI includes starter credits with no card required, which is enough to work through the [quickstart](/docs/api/quickstart) and see real output before you decide anything. Per-model rates for everything not listed above are on the [pricing page](/pricing), alongside each model's official list price for comparison. One more constraint that has nothing to do with price: Google embeds a SynthID watermark in image output from its models. If your use case involves resale or downstream editing, read up on [what SynthID does to Nano Banana output](/blog/nano-banana-watermark-synthid) before you commit to a pipeline. ## FAQ ### Can I get an AI API for free? For text, yes. Google's Gemini API offers around twenty text, audio and embedding models at no charge, including Gemini 2.5 Pro and the 3.x Flash family\[1]. For image, video or music generation, no major provider offers a free tier as of July 2026. ### Does Nano Banana have a free API? No. All four Nano Banana variants list Free Tier as "Not available" for input, output and search grounding. Paid rates run from $0.0336 per 1K image on 2 Lite to $0.24 per 4K image on Pro\[1]. ### Is there a free Veo 3.1 API? No. Google describes Veo 3.1 as "available to developers on the paid tier of the Gemini API" and lists Free Tier as "Not available" for the Standard, Fast and Lite variants\[1]. ### Does Google train on my free-tier API requests? Google's wording is "Used to improve our products", not "train", and the page does not define the term. That row reads Yes on Free Tier and No on Paid Tier for every model\[1]. It applies to the models that are free of charge, since the media models have no free tier at all. ### What are the Gemini free-tier rate limits? Per-model request limits are no longer published. The docs direct you to view your own limits in Google AI Studio and add that "Specified rate limits are not guaranteed and actual capacity may vary"\[2]. The one exception still printed is Search grounding at 500 requests per day on the free tier\[1]. Anyone quoting you a specific free-tier RPM figure for a model is reading a cached version of that page. ### Do OpenAI API keys come with free credits? The quickstart explicitly describes its walkthrough call as "a free test API request"\[8], but OpenAI does not document a standing free allowance. The pricing page lists none; its only free quantities are 1 GB of file-search storage and 1 GB per month of ChatKit upload storage\[3]. ### Is Replicate free to start? Yes, within limits Replicate does not quantify: "You can run select models on Replicate for free, but after a bit you'll be asked to set up billing"\[7]. Which models and how much are both unstated, so it is a way to try something rather than something to plan against. After that, "You only pay for what you use"\[5]. ### What is the cheapest way to test an image model? Per-image rates are now low enough that testing is a rounding error. A Stable Low render on GPT Image 2 is $0.005, so twenty test images cost ten cents\[6]. That is a more predictable path than working around free-tier quotas you cannot see in advance. ## Picking a tier without getting stuck If your workload is text, take Google's free tier. It is genuinely free and it covers capable models. The cost that is not measured in dollars is the "Used to improve our products" row, which matters for some projects and not others. If your workload is images, video or music, skip the search for a free AI API and optimise for the smallest possible first bill instead. That means per-generation billing rather than subscriptions, no billing-account prerequisite, and rates you can read before you sign up. A free AI API that excludes the models you came for is not a starting point. Half a cent per image is. ## References 1. Google. *Gemini Developer API pricing — Free Tier and Paid Tier rates by model.* Retrieved July 2026 from [ai.google.dev/gemini-api/docs/pricing](https://ai.google.dev/gemini-api/docs/pricing) 2. Google. *Gemini API rate limits — usage tiers and tier qualification.* Retrieved July 2026 from [ai.google.dev/gemini-api/docs/rate-limits](https://ai.google.dev/gemini-api/docs/rate-limits) 3. OpenAI. *API pricing.* Retrieved July 2026 from [platform.openai.com/docs/pricing](https://platform.openai.com/docs/pricing) 4. fal.ai. *GenAI API pricing — pay-per-use.* Retrieved July 2026 from fal.ai/pricing 5. Replicate. *Pricing.* Retrieved July 2026 from replicate.com/pricing 6. reAPI. *Model pricing — GPT Image 2, Nano Banana 2 Lite, Seedance 2.0 Mini.* Retrieved July 2026 from [reapi.ai/models](/models) 7. Replicate. *Billing — free limits.* Retrieved July 2026 from replicate.com/docs/topics/billing 8. OpenAI. *API quickstart.* Retrieved July 2026 from [developers.openai.com/api/docs/quickstart](https://developers.openai.com/api/docs/quickstart) ### Further reading * reAPI. *Nano Banana API free tier.* [reapi.ai/blog/nano-banana-api-free-tier](/blog/nano-banana-api-free-tier) * reAPI. *What SynthID does to Nano Banana output.* [reapi.ai/blog/nano-banana-watermark-synthid](/blog/nano-banana-watermark-synthid) --- # Gemini Omni API: Preview Specs, Pricing, and Limits (https://reapi.ai/blog/gemini-omni-api-preview-specs-pricing-2026) **Google's direct Gemini Omni API is now available as a paid public preview under the model ID `gemini-omni-flash-preview`. It runs through the Gemini Interactions API, generates 3–10 second video at 720p and 24 FPS, and costs about $0.10 per second of video output.** It can create video from text or images, generate audio with the video, and edit a result across multiple turns by passing a `previous_interaction_id`.\[1]\[2] Those specifications describe Google's direct Gemini Developer API. They do **not** describe every API carrying the name Gemini Omni. In particular, reAPI's `gemini-omni` is a supplier-routed video contract with a different endpoint, model name, request body, resolution tiers, and billing method. Treat the two as separate integrations. ## Gemini Omni API specs at a glance | Item | Google direct public preview | | -------------------- | -------------------------------------------------------------------- | | Model ID | `gemini-omni-flash-preview` | | API | Gemini Interactions API | | REST endpoint | `POST https://generativelanguage.googleapis.com/v1beta/interactions` | | Access | Paid Gemini API tier; no free tier | | Input | Text, images, and video for editing | | Output | Video with generated audio | | Output length | 3–10 seconds | | Output specification | 720p, 24 FPS | | Aspect ratio | `16:9` or `9:16` | | Context window | 1,048,576 tokens | | Video output price | $17.50 per 1M output tokens, approximately $0.10 per second | | Stateful editing | Yes, through `previous_interaction_id` | | Lifecycle | Preview; interface and limits may change | Google added the model to public preview on June 30, 2026. Its release notes and model card are the cleanest sources for the output limits: both identify 720p video between 3 and 10 seconds, while the model card also specifies 24 FPS and the 1,048,576-token context window.\[2]\[3] ## The correct model ID and endpoint The direct model ID is: ```text gemini-omni-flash-preview ``` Do not shorten it to `gemini-omni` in a direct Google request. That shorter identifier belongs to reAPI's supplier-routed contract, not the Gemini Developer API. Google exposes Omni through the Interactions API rather than the older long-running video-generation pattern used by Veo. A minimum REST request looks like this: ```bash curl -X POST \ "https://generativelanguage.googleapis.com/v1beta/interactions?key=$GEMINI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gemini-omni-flash-preview", "input": "A continuous handheld shot of a tabby cat crossing a sunny kitchen. Natural room audio, no dialogue." }' ``` The direct REST response returns an interaction with a `steps` array. The generated MP4 appears as video content in a `model_output` step. Google's Python and JavaScript SDKs add an `output_video` convenience field, so SDK code and raw REST parsing are not identical.\[1] For portrait output, add a response format: ```json { "response_format": { "type": "video", "aspect_ratio": "9:16" } } ``` Landscape `16:9` is the default. The public guide does not document a numeric `duration` request field like reAPI's route does. Google states that output falls within 3–10 seconds and shows natural-language timing and timecodes in prompts, such as `[0-3s]`, `[3-6s]`, and `[6-10s]`.\[1] ## How direct Google pricing works Gemini Omni Flash Preview is available only on the paid tier. Google's current standard prices are:\[4] | Meter | Direct Google price | | --------------------------------------- | -------------------: | | Input tokens, any listed modality | $1.50 per 1M tokens | | Text output, including thinking tokens | $9.00 per 1M tokens | | Video output, including thinking tokens | $17.50 per 1M tokens | Google converts 720p video into output tokens at 5,792 tokens per second. At $17.50 per million tokens, that is about $0.101 per output second. A rough video-output estimate is therefore: ```text 3-second output ≈ $0.30 6-second output ≈ $0.61 10-second output ≈ $1.01 ``` These are estimates for the video-output component, not guaranteed invoice totals. Input media, input text, text output, and thinking-token consumption can add to the charge. Retries and additional editing turns are also new billable interactions. The important distinction is that Google does not publish a flat "$X per generation" price for this preview. It bills token consumption. If a third-party route quotes a fixed price for an 8-second or 10-second job, that is the third party's product contract. ## Multi-turn video editing with the Interactions API Stateful editing is the strongest reason to use Google's direct interface. The first request creates a video and returns an interaction ID. A second request points to that state with `previous_interaction_id`: ```python import base64 from google import genai client = genai.Client() first = client.interactions.create( model="gemini-omni-flash-preview", input="A woman playing violin outdoors in soft morning light.", ) edited = client.interactions.create( model="gemini-omni-flash-preview", previous_interaction_id=first.id, input="Remove the violin. Keep everything else the same.", ) with open("edited.mp4", "wb") as file: file.write(base64.b64decode(edited.output_video.data)) ``` Each turn produces a new video. The model carries forward the video state and conversation, so the editing prompt can name only the requested change. Google's guidance favors short edit instructions and suggests adding "Keep everything else the same" when preserving the rest of the scene matters.\[1] State has an operational cost. If you set `store: false`, the result cannot be edited later through `previous_interaction_id`. Persist the interaction ID alongside the asset record when later revisions are part of the product workflow. If you do not need editing, Google recommends `background=false`, `store=false`, and `stream=false` for a faster synchronous request. ## Input support and current preview limits The model card lists text, image, and video input. Video input is capped at 10 seconds when used for editing, while generated output remains 3–10 seconds at 720p and 24 FPS.\[3] The guide supports several request shapes: * text-to-video; * image-to-video from a starting image; * multiple subject or style reference images; * stateful editing of a previously generated result; * editing an uploaded video through the Files API. That broad list needs a preview-stage warning. Google's current limitations say uploaded audio references are unsupported, even though the model generates an audio track with video. Referencing multiple videos is unsupported. Video extension, interpolation between first and last frames, and voice editing are also unavailable. Generic video references up to three seconds can pass API schema validation but are not processed correctly by the model at present.\[1] There are regional restrictions too. Editing uploaded videos is not currently available in the European Economic Area, Switzerland, or the United Kingdom, although users in those regions can edit video generated by the model. Image editing involving minors and certain recognizable people carries additional restrictions. Other engineering limits worth planning around: * no provisioned throughput; * no system instructions, `temperature`, `top_p`, stop sequences, or dedicated negative-prompt parameter; * English is fully supported, while other languages have not been formally evaluated; * content safety filters apply to both prompts and generated media; * every generated video carries an invisible SynthID watermark; * large outputs should use URI delivery instead of inline base64. The dedicated negative-prompt field is missing, but negative instructions can still be written in the ordinary prompt: "No dialogue," "No scene cuts," or "Do not add text." ## Google direct API vs reAPI's `gemini-omni` The names are similar enough to cause implementation mistakes. The contracts are not interchangeable: | Contract detail | Google direct preview | reAPI supplier route | | ----------------- | ------------------------------------------------ | ---------------------------------------------------- | | Model | `gemini-omni-flash-preview` | `gemini-omni` | | Endpoint | `/v1beta/interactions` | `/api/v1/videos/generations` | | Execution | Interaction response; inline or URI media | Async task submission and polling | | Output resolution | Google documents 720p | Supplier delivery tiers: 720p, 1080p, 4K | | Duration | 3–10 second output; prompt timing | Explicit `duration`: 4, 6, 8, or 10 | | Images | Interactions multimodal content | Public `image_urls`, with 0, 1, or 3 entries | | Video input | Direct editing workflow and preview restrictions | One public `video_urls` entry, supplier-route rules | | Multi-turn state | `previous_interaction_id` | No equivalent field in the video-generation contract | | Billing | Token-based; about $0.10 per output second | Per-job supplier-route pricing | | Result shape | Interaction `steps` / SDK `output_video` | Task `output.video_urls` | reAPI's [Gemini Omni API reference](/docs/gemini-omni) documents the supplier route. It accepts a prompt of up to 2,000 characters, explicit duration and resolution fields, `16:9` or `9:16`, public URL inputs, and task polling. Its 1080p and 4K options are supplier delivery tiers; they are not evidence that Google's direct public preview exposes those resolutions. Here is the equivalent minimum shape on reAPI: ```json { "model": "gemini-omni", "prompt": "A continuous handheld shot of a tabby cat crossing a sunny kitchen.", "duration": 6, "resolution": "1080p", "aspect_ratio": "16:9" } ``` The route returns a task ID, which the client polls until `output.video_urls` is available. It does not return a Google interaction ID and should not be treated as a wrapper around the direct Interactions API. **Disclosure:** reAPI publishes this article and operates the reAPI supplier-routed endpoint described above. Direct-Google specifications and prices in this guide come from Google's documentation; reAPI contract details come from our published API reference. The distinction is stated because reAPI has a commercial interest in the routed product. ## Which API should you use? Use Google's direct preview when the product specifically needs conversational editing, a stored interaction history, or a direct Google billing relationship. It is also the clearest route when a team wants to build against the newest Google interface and accepts preview lifecycle risk. Use a supplier-routed contract when a fixed request schema, explicit resolution and duration tiers, public URL inputs, and a common async task pattern are more useful than Google interaction state. Validate the route's own pricing and media constraints rather than copying Google's settings into it. This choice is separate from choosing a video model. If the actual question is whether to keep Veo in a production workflow, read the [Gemini Omni vs Veo 3.1 comparison](/blog/gemini-omni-vs-veo-3-1-2026). If the decision is about multimodal reference control and generation style, the [Gemini Omni vs Seedance 2.0 comparison](/blog/gemini-omni-vs-seedance-2-0-2026) covers that search intent. This page is only about the Gemini Omni API contract. ## Frequently asked questions ### Is Gemini Omni API available now? Yes. Google released `gemini-omni-flash-preview` on the paid Gemini Developer API tier on June 30, 2026. It is a public preview, not a generally available production model.\[2] ### What resolution does the direct Gemini Omni API support? Google's model card currently documents 720p output at 24 FPS. Do not infer direct 1080p or 4K support from a third-party Gemini Omni route.\[3] ### How much does Gemini Omni video cost? Google charges $17.50 per 1M video output tokens and calculates 720p video at 5,792 tokens per second. That works out to approximately $0.10 per output second, before other input or output consumption.\[4] ### Can Gemini Omni edit the same video more than once? Yes. Pass the prior interaction's ID as `previous_interaction_id` in the next Interactions API request. Keep storage enabled and persist the ID if the user may return for another edit.\[1] ### Does Gemini Omni accept an audio reference? Not in the current direct API preview. It generates audio with video, but Google's limitation list says uploading audio references is unsupported.\[1] ### Is `gemini-omni` the Google model ID? No. The direct Google model ID is `gemini-omni-flash-preview`. `gemini-omni` is the identifier used by reAPI's separate supplier-routed contract. ## Sources 1. Google AI for Developers. *Generate and edit videos with Gemini Omni Flash.* Updated July 30, 2026. [ai.google.dev/gemini-api/docs/omni](https://ai.google.dev/gemini-api/docs/omni) 2. Google AI for Developers. *Gemini API release notes — June 30, 2026.* [ai.google.dev/gemini-api/docs/changelog](https://ai.google.dev/gemini-api/docs/changelog) 3. Google AI for Developers. *Gemini Omni Flash model card.* [ai.google.dev/gemini-api/docs/models/gemini-omni-flash](https://ai.google.dev/gemini-api/docs/models/gemini-omni-flash) 4. Google AI for Developers. *Gemini Developer API pricing — Gemini Omni Flash Preview.* Retrieved July 30, 2026. [ai.google.dev/gemini-api/docs/pricing](https://ai.google.dev/gemini-api/docs/pricing) --- # Gemini Omni vs Seedance 2.0: The 2026 Video Model Split (https://reapi.ai/blog/gemini-omni-vs-seedance-2-0-2026) Google shipped Gemini Omni Flash on May 19, 2026 at I/O. ByteDance has held the Artificial Analysis Video Arena top spot with Seedance 2.0 since February. If you're picking Gemini Omni vs Seedance 2.0 right now, you're choosing between Google's first reasoning-and-editing-first video model and the model that benchmarks say is the best raw generator on the market. The split is sharper than most "X vs Y" comparisons in this category. Seedance 2.0 throws a 1080p, multi-shot, audio-coupled clip back at you on one forward pass. Gemini Omni Flash gives you a 10-second clip you keep editing through conversation. Below is a capability-by-capability breakdown sourced to each vendor's own pages, with prices from the live reAPI listings. ## TL;DR * **Release timing.** Seedance 2.0 launched February 12, 2026\[5]. Gemini Omni Flash launched May 19, 2026 at Google I/O\[1]. * **Benchmark gap.** Seedance 2.0 holds Elo 1,269 (text-to-video) and 1,351 (image-to-video) on the Artificial Analysis Video Arena, #1 in both categories\[6]. Gemini Omni was not on the leaderboard at launch. * **Resolution ceiling.** Gemini Omni Flash supports 720p, 1080p, and 4K\[7]. Seedance 2.0 caps at 1080p\[8]. * **Duration.** Gemini Omni Flash outputs 4, 6, 8, or 10 seconds\[7]. Seedance 2.0 outputs 4 to 15 seconds with multi-shot cuts inside the same clip\[5]. * **References.** Gemini Omni Flash accepts 0, 1, or 3 image inputs\[9]. Seedance 2.0 accepts up to 9 images + 3 video clips + 3 audio clips per request\[10]. * **Editing model.** Gemini Omni is built around multi-turn conversational edits\[1]. Seedance 2.0 is single-pass with rich reference inputs. * **The split.** Pick Gemini Omni when iteration on one clip matters more than peak raw quality. Pick Seedance 2.0 when you ship one polished clip and move on. ## Where each model comes from Seedance 2.0 came out of ByteDance Seed on February 12, 2026\[5]. The launch went viral for photorealistic clips of named celebrities, and Disney sent ByteDance a cease-and-desist letter a day later\[11]. The model ships with C2PA watermarking by default. ByteDance positions it as a "unified multimodal audio-video joint generation architecture" that takes text, image, video, and audio as input, and generates lip-synced video with native audio across 8+ languages. Gemini Omni Flash is the first model in a new Google DeepMind family announced at Google I/O on May 19, 2026. Sundar Pichai framed it on stage as part of Google's world-models push: "AI is moving from predicting text to simulating reality. Gemini Omni is the next step in that direction."\[4] Google's own product page says Gemini Omni will replace Veo in the Gemini app\[3]. Outputs are SynthID-watermarked, with verification available through the Gemini app, Chrome, and Google Search\[1]. Both models run behind reAPI's OpenAI-compatible `POST /api/v1/videos/generations`. You switch between them by changing the `model` field in the request body, no other infrastructure changes required. ## What each Gemini Omni vs Seedance 2.0 spec actually means | Capability | Gemini Omni Flash | Seedance 2.0 | | ------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------------------- | | Text-to-video | yes | yes | | Image-to-video (single) | yes (1 ref) | yes | | Image-to-video (multi-ref) | up to 3 (fusion mode) | up to 9 images | | First/last-frame interpolation | no | yes (`image_with_roles`) | | Reference video | no | up to 3 clips, ≤15s combined\[10] | | Reference audio | voice-reference only at launch\[1] | up to 3 clips, ≤15s combined\[10] | | Native audio synthesis | yes | yes (joint generation, phoneme lip-sync)\[5] | | Multi-shot in one output | no | yes, multiple cuts in one generation\[5] | | Multi-turn conversational edit | yes\[1] | no | | 4K output | yes\[7] | no (1080p ceiling)\[8] | | Duration options | 4 / 6 / 8 / 10s\[7] | any 4–15s\[10] | | Aspect ratios | 16:9, 9:16\[9] | 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, adaptive\[10] | | Watermarking | SynthID (Google)\[1] | C2PA (default on)\[5] | | Avatar feature | yes (consumer-only at launch)\[1] | no | Two cells do most of the work in the decision. Seedance 2.0 takes a 9+3+3 reference bundle in one request. Gemini Omni Flash takes 0/1/3 image references and one voice reference. If your pipeline relies on feeding a model "here is the product, here is the brand style clip, here is the music bed, now compose," Seedance 2.0's pipeline is built for it\[10]. Gemini Omni isn't built for that workflow yet. The other one is the editing column. Gemini Omni's multi-turn conversational editing has no Seedance equivalent. "Make the violin invisible. Now change the camera angle to be over the violinist's shoulder. Now transport the violinist to the image environment" is a real prompt sequence from the Google blog\[1]. Each instruction builds on the last while keeping the character and scene coherent. Seedance 2.0 doesn't work that way. You write one prompt with one set of references, you get one clip. ## The benchmark gap nobody can close yet Seedance 2.0 is #1 on the Artificial Analysis Video Arena leaderboard, with Elo 1,269 for text-to-video and 1,351 for image-to-video\[6]. Both scores are above Veo 3.1, Kling 3.0, and Sora 2 in the same arena. Gemini Omni Flash launched four days before this post, and Google did not put it on the arena at launch. Early hands-on coverage is split. TechCrunch called the consumer demos genuinely impressive but flagged that several features were broken at I/O\[4]. Independent reviewers writing the day after launch said raw generation quality "trails" Seedance 2.0 on aggregate, while Omni's text rendering, physics intuition, and conversational edits opened new ground. Until the Arena gets enough votes on Omni Flash, the only honest read is: Seedance 2.0 is the verified raw-quality leader. Gemini Omni Flash is the most novel editing surface anyone has shipped.