Find the tokenrouter channel configuration in the current workspace, infer the existing provider/channel schema from neighboring model entries, and add a MiniMax-Hailuo-2.3, kling-v3, kling-v2-6, dreamina-seedance-2-0-fast-260128, or dreamina-seedance-2-0-260128 route with the smallest correct change. Then use the configured tokenrouter endpoint to create a video generation task and fetch task status until a final video URL or terminal state is returned.
Channel Check: Discover the tokenrouter config and check whether any configured channel has a baseurl or baseURL containing https://api.tokenrouter.com or https://open.palebluedot.ai.
https://api.tokenrouter.com or https://open.palebluedot.ai was found. Please visit https://www.tokenrouter.com to register and obtain your channel configuration, then add it to the workspace."Model Check: Check whether the requested video model ( MiniMax-Hailuo-2.3, kling-v3, kling-v2-6, dreamina-seedance-2-0-fast-260128, or dreamina-seedance-2-0-260128) already exists in the channel's model map or route list.
Auto-Configuration: Infer the existing provider/channel schema from neighboring model entries, then add the missing model route with the smallest correct change.
API Call: Use the detected channel's key and the fixed base URL https://api.tokenrouter.com to call the video generation endpoints.
Polling: Poll task status until success, failure, or timeout.
Start by searching for likely tokenrouter config files in the current workspace.
*tokenrouter*, *channel*, *provider*, *model*, config*.json, config*.yaml, config*.yml, *.toml, *.ts, *.js.channels, providers, models, routes, baseURL, baseurl, apiKey, key, upstream, model_map, model_name, or similar.scripts/find_tokenrouter_config.py first when the workspace is large or the config location is unclear.Choose the config file that is actually consumed by the running tokenrouter setup, not merely documentation or examples.
Authentication discovery rule:
baseurl or baseURL containing https://api.tokenrouter.com or https://open.palebluedot.ai.Authorization.https://www.tokenrouter.com to obtain tokenrouter access and the required channel configuration.Infer the schema from the file instead of assuming a fixed format.
MiniMax-Hailuo-2.3, kling-v3, kling-v2-6, dreamina-seedance-2-0-fast-260128, or dreamina-seedance-2-0-260128) already exists, update only missing or incorrect fields.https://api.tokenrouter.com or https://open.palebluedot.ai channel is present, reuse that channel's key exactly as configured instead of introducing a new env var name.Minimum target behavior:
MiniMax-Hailuo-2.3, kling-v3, kling-v2-6, dreamina-seedance-2-0-fast-260128, or dreamina-seedance-2-0-260128).POST /v1/video/generations.GET /video/generations/:task_id.If the local tokenrouter schema distinguishes between chat/completions/image/video APIs, make sure this model is wired into the video path rather than a text generation path.
Use the fixed tokenrouter base URL https://api.tokenrouter.com for all API calls.
Auth rule:
https://api.tokenrouter.com.TOKENROUTER_API_KEY; instead tell the user to register at https://www.tokenrouter.com and add tokenrouter config first.Create video task:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "MiniMax-Hailuo-2.3",
"prompt": "A man picks up a book [Pedestal up], then reads [Static shot].",
"size": "1080P",
"duration": 6
}
}
size and duration must be chosen as one of the supported Hailuo combinations:
1080P with 6768P with 10768P with 6Do not mix unsupported combinations. If the user asks for another pair, ask them to choose one of the three valid options.
Supports both text-to-video and image-to-video.
Text-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "kling-v3",
"prompt": "A silver robot walking through a rainy neon alley",
"mode": "pro",
"duration": "5",
"metadata": {
"aspect_ratio": "16:9",
"sound": "on",
"negative_prompt": "blurry, low quality"
}
}
}
Image-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "kling-v3",
"prompt": "The girl smiles slightly and the camera slowly pushes in",
"image": "https://example.com/portrait.png",
"mode": "pro",
"duration": "5",
"metadata": {
"sound": "off",
"negative_prompt": "flicker, blur"
}
}
}
duration is a string. Common values include "5". mode is a string such as "pro". metadata is optional but may include aspect_ratio, sound, and negative_prompt. image is optional; when present, it triggers image-to-video generation. Do not send Hailuo-only fields ( size) when using kling-v3.
Supports both text-to-video and image-to-video.
Text-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "kling-v2-6",
"prompt": "A silver robot walking through a rainy neon alley",
"mode": "pro",
"duration": "5",
"metadata": {
"aspect_ratio": "16:9",
"sound": "on",
"negative_prompt": "blurry, low quality"
}
}
}
Image-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "kling-v2-6",
"prompt": "The girl smiles slightly and the camera slowly pushes in",
"image": "https://example.com/portrait.png",
"mode": "pro",
"duration": "5",
"metadata": {
"sound": "off",
"negative_prompt": "flicker, blur"
}
}
}
duration is a string. mode is a string such as "pro". metadata is optional but may include aspect_ratio, sound, and negative_prompt. image is optional; when present, it triggers image-to-video generation. Do not send Hailuo-only fields ( size) when using kling-v2-6.
Supports both text-to-video and image-to-video.
Text-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "dreamina-seedance-2-0-fast-260128",
"prompt": "A vintage sports car driving along a coastal road at sunset",
"metadata": {
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"generate_audio": true
}
}
}
Image-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "dreamina-seedance-2-0-fast-260128",
"prompt": "The subject looks up toward the camera while hair moves gently in the wind",
"images": [
"https://example.com/input-image.png"
],
"metadata": {
"duration": 5,
"resolution": "720p",
"ratio": "9:16"
}
}
}
prompt is required for text-to-video, optional but recommended for image-to-video. metadata is optional but may include duration, resolution, ratio, and generate_audio. images is optional; when present, it triggers image-to-video generation. Do not send Hailuo-only fields ( size) or Kling-only fields ( mode, image) when using Seedance models.
Supports both text-to-video and image-to-video.
Text-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "dreamina-seedance-2-0-260128",
"prompt": "A vintage sports car driving along a coastal road at sunset",
"metadata": {
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"generate_audio": true
}
}
}
Image-to-video:
json
{
"path": "/v1/video/generations",
"method": "POST",
"params": {
"model": "dreamina-seedance-2-0-260128",
"prompt": "The subject looks up toward the camera while hair moves gently in the wind",
"images": [
"https://example.com/input-image.png"
],
"metadata": {
"duration": 5,
"resolution": "720p",
"ratio": "9:16"
}
}
}
prompt is required for text-to-video, optional but recommended for image-to-video. metadata is optional but may include duration, resolution, ratio, and generate_audio. images is optional; when present, it triggers image-to-video generation. Do not send Hailuo-only fields ( size) or Kling-only fields ( mode, image) when using Seedance models.
Before calling the create endpoint, always validate the request according to the chosen model:
For MiniMax-Hailuo-2.3:
prompt is present and is a string.size is exactly "1080P" or "768P".duration is exactly 6 or 10.1080P, 6), ( 768P, 10), ( 768P, 6).mode, image, images, and metadata are NOT present (these fields belong to other models).For kling-v3:
Check that mode is present and is a string.
Check that duration is a string value such as "5".
Ensure size, images are NOT present.
If image is present (image-to-video mode):
image is a valid URL string.prompt is optional but recommended.metadata.aspect_ratio should NOT be present.If image is NOT present (text-to-video mode):
prompt is present and is a string.If validation fails, stop and tell the user the correct kling-v3 parameters instead of sending the request.
For kling-v2-6:
Check that mode is present and is a string.
Check that duration is a string value such as "5".
Ensure size, images are NOT present.
If image is present (image-to-video mode):
image is a valid URL string.prompt is optional but recommended.metadata.aspect_ratio should NOT be present.If image is NOT present (text-to-video mode):
prompt is present and is a string.If validation fails, stop and tell the user the correct kling-v2-6 parameters instead of sending the request.
For dreamina-seedance-2-0-fast-260128:
Ensure size, mode, image are NOT present.
If images is NOT present (text-to-video mode):
prompt is present and is a string.metadata.generate_audio is optional boolean.If images is present (image-to-video mode):
images is a non-empty array of valid URL strings.prompt is optional but recommended.metadata.generate_audio should NOT be present.If metadata.duration is present, check that it is an integer such as 5.
If validation fails, stop and tell the user the correct Seedance parameters instead of sending the request.
For dreamina-seedance-2-0-260128:
Ensure size, mode, image are NOT present.
If images is NOT present (text-to-video mode):
prompt is present and is a string.metadata.generate_audio is optional boolean.If images is present (image-to-video mode):
images is a non-empty array of valid URL strings.prompt is optional but recommended.metadata.generate_audio should NOT be present.If metadata.duration is present, check that it is an integer such as 5.
If validation fails, stop and tell the user the correct Seedance parameters instead of sending the request.
json
{
"path": "/video/generations/:task_id",
"method": "GET"
}
Implementation notes:
task_id from the create response using the actual response schema returned by the server.\u0026, decode it to & before presenting or returning the URL.baseurl contains https://api.tokenrouter.com or https://open.palebluedot.ai.https://www.tokenrouter.com.MiniMax-Hailuo-2.3, kling-v3, kling-v2-6, dreamina-seedance-2-0-fast-260128, or dreamina-seedance-2-0-260128) in that channel or its neighboring model map.Example curl pattern after config is in place and a channel has been detected:
Hailuo:
bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
-H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-Hailuo-2.3",
"prompt": "A man picks up a book [Pedestal up], then reads [Static shot].",
"size": "1080P",
"duration": 6
}'
Kling text-to-video:
bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
-H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3",
"prompt": "A silver robot walking through a rainy neon alley",
"mode": "pro",
"duration": "5",
"metadata": {
"aspect_ratio": "16:9",
"sound": "on",
"negative_prompt": "blurry, low quality"
}
}'
Kling image-to-video:
bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
-H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-v3",
"prompt": "The girl smiles slightly and the camera slowly pushes in",
"image": "https://example.com/portrait.png",
"mode": "pro",
"duration": "5",
"metadata": {
"sound": "off",
"negative_prompt": "flicker, blur"
}
}'
Seedance text-to-video:
bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
-H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-fast-260128",
"prompt": "A vintage sports car driving along a coastal road at sunset",
"metadata": {
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"generate_audio": true
}
}'
Seedance image-to-video:
bash
curl -X POST "https://api.tokenrouter.com/v1/video/generations" \
-H "Authorization: Bearer $DETECTED_CHANNEL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"prompt": "The subject looks up toward the camera while hair moves gently in the wind",
"images": [
"https://example.com/input-image.png"
],
"metadata": {
"duration": 5,
"resolution": "720p",
"ratio": "9:16"
}
}'
Then:
bash
curl "https://api.tokenrouter.com/video/generations/$TASK_ID" \
-H "Authorization: Bearer $DETECTED_CHANNEL_KEY"
Adjust header names only if the existing workspace uses a different auth convention.
Use references/api_reference.md for endpoint-specific guidance and scripts/find_tokenrouter_config.py to quickly identify likely tokenrouter config files.
find_tokenrouter_config.py scans the workspace for files likely to contain tokenrouter channel/provider/model routing config.
api_reference.md captures the two required video endpoints, expected request bodies, and polling guidance.
No assets are required for this skill.