Skip to main content

Plugin Tasks

Besides Midjourney, the gateway ships with plugin channels: Suno music, Kling/Hailuo/Vidu video, Veo, Jimeng, and more. Two calling patterns exist:

PatternApplies ToFlow
Generic taskMost plugins (model-driven)POST /v1/tasks submit → GET /v1/tasks/{id} poll → fetch artifacts
Native passthroughSuno, Kling, etc.Vendor-native paths /suno/*, /kling/* — parameters match the vendor's official API

Generic Task Endpoints​

Submit a Task​

POST /v1/tasks
curl https://test.kailin.com.cn/v1/tasks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model": "hailuo-video",
"prompt": "Bioluminescent jellyfish in the deep ocean",
"duration": 6
}'
ParameterTypeRequiredDescription
modelstringYesPlugin model name — decides the routing
Other fields-NoPlugin-specific parameters (prompt, image URL, duration, aspect ratio…), passed through as-is

Response:

{ "task_id": "3e2c1a9b-xxxx-xxxx-xxxx" }

Query a Task​

GET /v1/tasks/{task_id}
curl https://test.kailin.com.cn/v1/tasks/3e2c1a9b-xxxx \
-H "Authorization: Bearer sk-your-token"
{
"task_id": "3e2c1a9b-xxxx",
"status": "SUCCESS",
"data": {
"video_url": "https://oss.example.com/v/xxx.mp4"
}
}

status values: SUBMITTED / IN_PROGRESS / SUCCESS / FAILURE (some plugins extend their own states — trust the response).

Task Artifacts​

EndpointDescription
GET /v1/tasks/{key}/artifactsList artifacts of a task (audio/video/image files)
GET /v1/tasks/{key}/artifacts/{artifact_key}/contentDownload a specific artifact (binary stream)
curl "https://test.kailin.com.cn/v1/tasks/3e2c1a9b/artifacts" \
-H "Authorization: Bearer sk-your-token"

curl "https://test.kailin.com.cn/v1/tasks/3e2c1a9b/artifacts/audio-0/content" \
-H "Authorization: Bearer sk-your-token" \
--output track.mp3

Suno (Music)​

SunoAPI-format passthrough:

EndpointDescription
POST /suno/submit/{action}Submit a task — action is a SunoAPI action (music, lyrics, caption, …), parameters match SunoAPI docs
GET /suno/fetch/{task_id}Query one task
POST /suno/fetchBatch query — body takes ["id1", "id2"]
curl https://test.kailin.com.cn/suno/submit/music \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{ "prompt": "An upbeat summer pop song", "make_instrumental": false, "wait_audio": false }'

The data field mirrors the raw Suno task structure. With wait_audio: true, the call waits until the audio is ready and returns audio URLs directly.

Kling (Video)​

Kling-native passthrough:

EndpointDescription
POST /kling/v1/videos/text2videoText to video
POST /kling/v1/videos/image2videoImage to video
GET /kling/v1/videos/text2video/{task_id}Query text-to-video task
GET /kling/v1/videos/image2video/{task_id}Query image-to-video task
curl https://test.kailin.com.cn/kling/v1/videos/text2video \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{
"model_name": "kling-v1",
"prompt": "Morning forest, sunlight through the leaves",
"duration": 5,
"mode": "std"
}'

Parameters and responses match the Kling official API (model_name / mode / aspect_ratio / cfg_scale, etc.) — just swap the domain for the gateway.

Built-in Plugin Overview​

The plugins below all submit via POST /v1/tasks (model set to the matching name) and query via GET /v1/tasks/{task_id}. Their parameters mirror the upstream vendor APIs and pass through untouched:

PluginCapabilityKey Parameters
Hailuo VideoText/image to video (MiniMax Hailuo)prompt, first-frame image, duration
Hailuo H3H3-model video tasksSame as above
Google VeoVeo video tasks (Gemini/Vertex channels)prompt, duration, aspect ratio
DoubaoJimeng video/image (ByteDance)prompt, image, resolution
Alibaba BailianTongyi Wanxiang image/video tasksprompt, model, size
xAIGrok Imagine video (generate/edit/extend)prompt, source task ID
ViduText/image to videoprompt, first-frame image, duration
JimengJimeng tasksprompt, image
caution

Plugin endpoints pass vendor formats through — invalid parameters surface upstream errors directly. Always double-check the parameter docs in the Console's model gallery before submitting. Result URLs are temporary; re-host files promptly once SUCCESS.