API Reference
An overview of RavenRouter's OpenAI-compatible API
RavenRouter's request and response schemas are very similar to the OpenAI Chat API, with a few small differences. At a high level, RavenRouter normalizes the schema across models and providers so you only need to learn one.
Responses
Completions Response Format
RavenRouter normalizes responses to comply with the OpenAI Chat API. `choices` is always an array — each choice contains a `message` property, or a `delta` property when streaming.
type ChatCompletionResponse = {
id: string;
object: 'chat.completion' | 'chat.completion.chunk';
created: number;
model: string;
choices: NonStreamingChoice[] | StreamingChoice[];
usage?: {
prompt_tokens: number;
completion_tokens: number;
total_tokens: number;
};
};
type NonStreamingChoice = {
index: number;
finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'error' | null;
message: {
role: 'assistant';
content: string | null;
tool_calls?: ToolCall[];
};
};
type StreamingChoice = {
index: number;
finish_reason: string | null;
delta: {
role?: string;
content?: string | null;
tool_calls?: ToolCall[];
};
};Example Response
{
"id": "chatcmpl-xxxxxxxx",
"object": "chat.completion",
"created": 1710000000,
"model": "DeepSeek-V3.2",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "Hello! How can I help you today?"
}
}
],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 9,
"total_tokens": 21
}
}Finish Reason
Each model's `finish_reason` is normalized to one of: `stop`, `length`, `tool_calls`, `content_filter`, or `error`. The raw provider value is available when returned by the upstream.
Usage & Billing
Token counts in the response `usage` field follow the model tokenizer. Credit consumption is reflected in the console usage dashboard. For streaming requests, `usage` is included in the final chunk.
Streaming
Set `"stream": true` on chat completions. The server responds with Server-Sent Events (SSE) chunks compatible with OpenAI clients.
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3.2",
"stream": true,
"messages": [
{ "role": "user", "content": "Write a haiku about APIs." }
]
}'Rate Limits
Rate limits include subscription-tier RPM/concurrency and model-level limits. When exceeded, the API returns `429 Too Many Requests`. Retry with exponential backoff.
Check plan RPM on the Plans page. Check model rate limits on Model APIs. Console usage logs only show consumption, not rate quotas.
Authentication
Every API call must include your key in the request header: `Authorization: Bearer <API_KEY>`. Create keys in Console → API Keys.
Required request header
Authorization: Bearer <API_KEY>curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3.2",
"messages": [
{ "role": "user", "content": "What is the meaning of life?" }
]
}'Never expose API keys in client-side code. Rotate keys immediately if compromised.
Errors & Debugging
Common HTTP status codes and how to resolve them:
- 401 Unauthorized
- Invalid, disabled, or missing API key.
- 429 Too Many Requests
- Rate or concurrency limit exceeded.
- 400 Bad Request
- Unknown model slug or malformed JSON body.
- 502 Bad Gateway
- Upstream provider error — retry or switch model.
Text
POST `/v1/chat/completions` — POST `/v1/chat/completions` — OpenAI-compatible text chat. Supports multi-turn `messages` and `"stream": true`.
Request parameters
| Field | Required | Description |
|---|---|---|
model | Yes | Model slug from GET /v1/models or Model APIs. |
messages | Yes | Array of `{ role, content }` message objects (system / user / assistant / tool). |
stream | No | When `true`, respond with SSE chunks. |
max_tokens | No | Maximum tokens to generate. |
temperature | No | Sampling temperature in `[0, 2]`. |
top_p | No | Nucleus sampling in `(0, 1]`. |
tools / tool_choice | No | Function calling when the model supports it. |
response_format | No | JSON mode or `json_schema` structured output. |
stop | No | Stop sequence(s). |
Response fields
| Field | Required | Description |
|---|---|---|
id | Yes | Completion id. |
object | Yes | Usually `chat.completion` (or chunk when streaming). |
model | Yes | Model that produced the response. |
choices | Yes | Array of results. Non-stream: `message`; stream: `delta`. |
choices[].finish_reason | No | Normalized: `stop` / `length` / `tool_calls` / `content_filter` / `error`. |
usage | No | `prompt_tokens`, `completion_tokens`, `total_tokens` (final chunk when streaming). |
Request examples
Replace `<API_KEY>` with a key from the console. Model names come from GET `/v1/models` or Model APIs.
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3.2",
"messages": [
{ "role": "user", "content": "What is the meaning of life?" }
]
}'Create text — success response
{
"id": "a962d5b5-342f-43ba-b443-13473d6ec7ae",
"object": "chat.completion",
"created": 1783911021,
"model": "MiniMax-M2.7",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "你好!有什么我可以帮助你的吗?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 39,
"completion_tokens": 29,
"total_tokens": 68
}
}Create text — error response
{
"code": "invalid_request",
"message": "model is required",
"data": null
}Images
POST `/v1/images/generations` (Seedream) or POST `/v1/images/wan/generations` (Wan2.6-Image). Required: `model`, `prompt`. Optional: `size`, `n` (and `images` for Wan).
Request parameters
| Field | Required | Description |
|---|---|---|
model | Yes | Image model slug (e.g. Doubao-Seedream-*). |
prompt | Yes | Text prompt for generation. |
size | No | Seedream 4.0 / 4.5: fixed `2K` only. Seedream 5.0-lite: `2k` / `3k` / `4k`. Wan2.6-Image: `1K` / `2K` (default `1K`). |
n | No | Number of images to request (default 1). Billing may follow upstream usage. |
images | No | Wan2.6-Image only: optional reference image URL list. Seedream ignores this field. |
response_format | No | Often filled by the platform; check model docs. |
Response fields
| Field | Required | Description |
|---|---|---|
created | No | Unix timestamp. |
data | Yes | Array of image results. |
data[].url | No | Image URL when returned as URL. |
data[].b64_json | No | Base64 image payload when applicable. |
usage | No | Upstream usage such as `generated_images` / `image_count`. |
Request examples
Seedream uses POST `/v1/images/generations`; Wan2.6-Image uses POST `/v1/images/wan/generations`. Per-model size enums and curl bodies are listed under Examples by model.
curl https://api.ravenrouter.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-Seedream-5.0-lite",
"prompt": "A raven flying over a neon city at night, cinematic lighting",
"size": "2K",
"n": 1
}'Create image — success response
{
"created": 1783911375,
"model": "Doubao-seedream-4.5",
"data": [
{
"url": "https://example.com/generated/seedream.png",
"size": "3136x1344"
}
],
"usage": {
"generated_images": 1,
"output_tokens": 16464,
"total_tokens": 16464
}
}Create image — error response
{
"code": "invalid_request",
"message": "The parameter size specified in the request is not valid: the specified size is not supported for model doubao-seedream-4-5",
"data": null
}Videos
POST `/v1/video/generations` submits an async video task. Some models need `images` and/or `audio_url` (see request params). Poll GET `/v1/video/generations/{task_id}` until `completed` or `failed`.
Request parameters
| Field | Required | Description |
|---|---|---|
model | Yes | Video model slug (e.g. wan2.6-t2v / Seedance). |
prompt | Yes | Video description / shot prompt. |
duration | No | Seconds. Default **5** for most models; **10** for wan2.6-r2v. |
size | No | Seedance / wan i2v*: `720p` / `1080p`. wan2.6-t2v / r2v: `1280*720` / `1920*1080` (Playground maps from 720p/1080p). |
images | Conditional | Required for Seedance 1.5-pro*, wan2.6-i2v*, wan2.6-r2v. Hidden for t2v models. |
input_reference | No | Single-image shorthand compatible with OpenAI-style video APIs. |
audio_url | Conditional | Driving audio URL. Required for wan2.6-i2v / i2v-flash; optional for wan2.6-t2v. |
audio | No | Only wan2.6-i2v-flash: billed audio on/off (different from audio_url). |
Response fields
| Field | Required | Description |
|---|---|---|
id | Yes | Upstream task id — use it to poll GET `/v1/video/generations/{task_id}`. |
object | No | Usually `video`. |
model | Yes | Requested model. |
status | Yes | Initial status, commonly `queued`. |
created_at | No | Unix timestamp when the task was created. |
Create video — request examples
Required: `model`, `prompt`. Optional: `duration`, `size`. Pass `images` for i2v/r2v/Seedance; pass `audio_url` for wan2.6-i2v / i2v-flash (required) or t2v (optional). Full per-model curl examples are under Examples by model.
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "wan2.6-t2v",
"prompt": "A raven soaring through clouds, cinematic drone shot",
"duration": 5,
"size": "720p"
}'Create video — success response
{
"id": "cgt-20260727184619-ll9mv",
"object": "video",
"model": "wan2.6-t2v",
"status": "queued",
"progress": 0,
"created_at": 1785149180
}Create video — error response
{
"code": "invalid_request",
"message": "audio_url is required for wan2.6-i2v",
"data": null
}Get video status
GET `/v1/video/generations/{task_id}`. Status values: `queued`, `in_progress`, `completed`, `failed`. On `failed`, pre-consumed credits are refunded.
Request parameters
| Field | Required | Description |
|---|---|---|
task_id | Yes | Path parameter from create-video response `id` (upstream task id). |
Response fields
| Field | Required | Description |
|---|---|---|
id | Yes | Task id. |
status | Yes | `queued` / `in_progress` / `completed` / `failed`. |
model | No | Model used for the task. |
progress | No | Progress percent `0`–`100`. |
metadata.url | No | Output video URL when `completed`. |
usage | No | Billing usage (tokens and/or duration, model-dependent). |
error | No | Error details when `failed` (`code`, `message`). |
Status query — request examples
curl https://api.ravenrouter.ai/v1/video/generations/<TASK_ID> \
-H "Authorization: Bearer <API_KEY>"Status query — success response (`completed`)
{
"id": "cgt-20260727184619-ll9mv",
"object": "video",
"model": "Doubao-Seedance-1.5-pro",
"status": "completed",
"progress": 100,
"created_at": 1785149180,
"completed_at": 1785149255,
"metadata": {
"url": "https://example.com/output/video.mp4"
},
"usage": {
"completion_tokens": 246840,
"total_tokens": 246840
}
}Status query — failed response (`failed`)
{
"id": "cgt-20260727184619-ll9mv",
"object": "video",
"model": "Doubao-Seedance-1.5-pro",
"status": "failed",
"progress": 100,
"created_at": 1785149180,
"completed_at": 1785149201,
"error": {
"code": "InvalidParameter",
"message": "duration customization is not supported"
}
}Models
GET `/v1/models` returns the catalog your key can access. Browse the full list at Model APIs.
Request parameters
| Field | Required | Description |
|---|---|---|
(none) | No | GET has no JSON body. Send `Authorization: Bearer <API_KEY>` only. |
Response fields
| Field | Required | Description |
|---|---|---|
object | No | Usually `list`. |
data | Yes | Array of available models for the key. |
data[].id | Yes | Model slug to pass as `model`. |
data[].object | No | Usually `model`. |
data[].owned_by | No | Provider / owner label when present. |
Request examples
curl https://api.ravenrouter.ai/v1/models \
-H "Authorization: Bearer <API_KEY>"Examples by model
Copy-ready request for every published model. Same OpenAI-compatible paths for all models — only `model` and modality-specific fields differ. Replace `<API_KEY>` with a console key.
Image `size` enums match Playground: Seedream 4.x → `2K` only; Seedream 5.0-lite → `2k`/`3k`/`4k`; Wan2.6-Image → `1K`/`2K`.
Text models
All use `POST /v1/chat/completions`. Bodies differ only by `model`; switch language tabs to copy.
GLM-5.1/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "GLM-5.1",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'GLM-5/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "GLM-5",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'GLM4.6V/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "GLM4.6V",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3.5-397B-A17B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3.5-397B-A17B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3.5-122B-A10B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3.5-122B-A10B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3.5-35B-A3B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3.5-35B-A3B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-Next-80B-A3B-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-Next-80B-A3B-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-VL-235B-A22B-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-VL-235B-A22B-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-VL-30B-A3B-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-VL-30B-A3B-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-235B-A22B-Instruct-2507/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-235B-A22B-Instruct-2507",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-Coder-480B-A35B-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-Coder-480B-A35B-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-30B-A3B-Instruct-2507/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-30B-A3B-Instruct-2507",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-235B-A22B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-235B-A22B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-30B-A3B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-30B-A3B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-14B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-14B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-8B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-8B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen3-4B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen3-4B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen2.5-VL-72B-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen2.5-VL-72B-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen2.5-72B-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen2.5-72B-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Qwen-VL-Chat/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Qwen-VL-Chat",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-V3.2/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3.2",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-V3.1/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3.1",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-V3-0324/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3-0324",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-V3/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-V3",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-R1-0528/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-R1-0528",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-R1/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-R1",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-R1-Distill-Llama-70B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-R1-Distill-Llama-70B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'DeepSeek-R1-Distill-Qwen-32B/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "DeepSeek-R1-Distill-Qwen-32B",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Kimi-K2.5/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Kimi-K2.5",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Kimi-K2-Thinking/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Kimi-K2-Thinking",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Kimi-K2-Instruct/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Kimi-K2-Instruct",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Minimax-M2.7/v1/chat/completions
curl https://api.ravenrouter.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Minimax-M2.7",
"messages": [
{
"role": "user",
"content": "Hello! Introduce yourself in one sentence."
}
],
"max_tokens": 64
}'Image models
Seedream and Wan Image use different paths; see each model for allowed `size` values.
Doubao-seedream-4.0/v1/images/generations
`size` is fixed to `2K` (`1K` is not supported). size: 2K
curl https://api.ravenrouter.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-seedream-4.0",
"prompt": "a red apple on a wooden table",
"size": "2K",
"n": 1
}'Doubao-seedream-4.5/v1/images/generations
`size` is fixed to `2K` (`1K` is not supported). size: 2K
curl https://api.ravenrouter.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-seedream-4.5",
"prompt": "a red apple on a wooden table",
"size": "2K",
"n": 1
}'Doubao-Seedream-5.0-lite/v1/images/generations
`size` options: `2k` / `3k` / `4k` (lowercase, same as Playground). size: 2k / 3k / 4k
curl https://api.ravenrouter.ai/v1/images/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-Seedream-5.0-lite",
"prompt": "A raven flying over a neon city at night, cinematic lighting",
"size": "2k",
"n": 1
}'Wan2.6-Image/v1/images/wan/generations
Use `/v1/images/wan/generations`. `size`: `1K` / `2K`. Optional reference `images`. size: 1K / 2K
curl https://api.ravenrouter.ai/v1/images/wan/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Wan2.6-Image",
"prompt": "tomato egg stir fry, food photography",
"images": [
"https://cdn.wanx.aliyuncs.com/tmp/pressure/umbrella1.png"
],
"size": "1K",
"n": 1
}'Video models
All use async `POST /v1/video/generations`. Poll status with the returned `id`.
Doubao-Seedance-1.5-pro-noaudio/v1/video/generations
Pass a first-frame URL in `images`. `size`: `720p` / `1080p`. Default duration 5s. Silent. size: 720p / 1080p
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-Seedance-1.5-pro-noaudio",
"prompt": "drone flight over mountains",
"duration": 5,
"size": "1080p",
"images": [
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_i2v.png"
]
}'Doubao-Seedance-1.5-pro/v1/video/generations
Pass a first-frame URL in `images`. `size`: `720p` / `1080p`. Default duration 5s. With audio. size: 720p / 1080p
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "Doubao-Seedance-1.5-pro",
"prompt": "drone flight over mountains",
"duration": 5,
"size": "1080p",
"images": [
"https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_i2v.png"
]
}'wan2.6-t2v/v1/video/generations
Text-to-video. `size`: `1280*720` / `1920*1080` (or map from `720p`/`1080p`). Optional `audio_url`. size: 1280*720 / 1920*1080
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "wan2.6-t2v",
"prompt": "cute cartoon cat on a cliff",
"duration": 5,
"size": "1280*720",
"audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250923/hbiayh/%E4%BB%8E%E5%86%9B%E8%A1%8C.mp3"
}'wan2.6-i2v/v1/video/generations
Both first-frame `images` and `audio_url` are required. `size`: `720p` / `1080p`. size: 720p / 1080p
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "wan2.6-i2v",
"prompt": "graffiti character comes alive",
"duration": 5,
"size": "720p",
"images": [
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
],
"audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
}'wan2.6-i2v-flash/v1/video/generations
`images` and `audio_url` required. Optional `audio` (`true`/`false`) selects billed audio tier (distinct from `audio_url`). `size`: `720p` / `1080p`. size: 720p / 1080p
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "wan2.6-i2v-flash",
"prompt": "graffiti character comes alive",
"duration": 5,
"size": "720p",
"images": [
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
],
"audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3",
"audio": false
}'wan2.6-r2v/v1/video/generations
`images` required (image or video reference URLs, multiple allowed). `size`: `1280*720` / `1920*1080`. Default duration 10s. size: 1280*720 / 1920*1080
curl https://api.ravenrouter.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_KEY>" \
-d '{
"model": "wan2.6-r2v",
"prompt": "Character2 plays music by the window",
"duration": 10,
"size": "1280*720",
"images": [
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
]
}'