Plugin Tasks
Besides Midjourney, the gateway ships with plugin channels: Suno music, Kling/Hailuo/Vidu video, Veo, Jimeng, and more. Two calling patterns exist:
| Pattern | Applies To | Flow |
|---|---|---|
| Generic task | Most plugins (model-driven) | POST /v1/tasks submit → GET /v1/tasks/{id} poll → fetch artifacts |
| Native passthrough | Suno, Kling, etc. | Vendor-native paths /suno/*, /kling/* — parameters match the vendor's official API |
Generic Task Endpoints
Submit a Task
POST /v1/taskscurl 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
}'
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Plugin model name — decides the routing |
| Other fields | - | No | Plugin-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
| Endpoint | Description |
|---|---|
GET /v1/tasks/{key}/artifacts | List artifacts of a task (audio/video/image files) |
GET /v1/tasks/{key}/artifacts/{artifact_key}/content | Download 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:
| Endpoint | Description |
|---|---|
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/fetch | Batch 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:
| Endpoint | Description |
|---|---|
POST /kling/v1/videos/text2video | Text to video |
POST /kling/v1/videos/image2video | Image 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:
| Plugin | Capability | Key Parameters |
|---|---|---|
| Hailuo Video | Text/image to video (MiniMax Hailuo) | prompt, first-frame image, duration |
| Hailuo H3 | H3-model video tasks | Same as above |
| Google Veo | Veo video tasks (Gemini/Vertex channels) | prompt, duration, aspect ratio |
| Doubao | Jimeng video/image (ByteDance) | prompt, image, resolution |
| Alibaba Bailian | Tongyi Wanxiang image/video tasks | prompt, model, size |
| xAI | Grok Imagine video (generate/edit/extend) | prompt, source task ID |
| Vidu | Text/image to video | prompt, first-frame image, duration |
| Jimeng | Jimeng tasks | prompt, image |
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.