接入文档
原生接口
Base URL https://lingluo.vip/openapi。请求体为 JSON(上传接口为 multipart),成功响应统一为 { code: 0, msg, data },下文只列出 data。
线路与模型配置
GET/generation/config
返回当前可调用的图片线路和视频线路。价格随后台调整实时变化,建议创建任务前读取,不要写死在代码里。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| creditsPerYuan | number | 否 | 积分汇率:1 元等于多少积分 |
| imageConfig.channels[] | array | 否 | 图片线路;videoConfig.channels[] 为视频线路,结构相同 |
| channel | string | 否 | 线路编号,创建任务时填这个 |
| title / description / badge | string | 否 | 线路名称、说明、标签(special 特价、stable 稳定、premium 超稳) |
| discountPercent | number | 否 | 当前账户在这条线路上的会员折扣,100 表示不打折 |
| models[].model | string | 否 | 模型名,创建任务时填这个 |
| models[].type | string | 否 | fixed_total 按张 / 按条计费;per_second 按秒计费 |
| models[].qualities[] | array | 否 | 规格档:quality 规格名、credits 原价、isDefault 是否默认、referenceVideoMultiplier 带参考视频时的价格倍率 |
| models[].aspectRatios | string[] | 否 | 可选比例,空表示不限 |
| models[].durations | number[] | 否 | 视频可选时长(秒) |
| models[].inputImagesMax / inputVideosMax / inputAudiosMax | number | 否 | 参考素材数量上限,0 表示不支持 |
| models[].nMax | number | 否 | 图片一次最多生成几张 |
curl https://lingluo.vip/openapi/generation/config \ -H "Authorization: Bearer $LINGLUO_API_KEY"
创建图片任务
POST/generation/create/image
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| channel | string | 是 | 线路编号 |
| model | string | 是 | 模型名,须在该线路下 |
| prompt | string | 是 | 提示词,最长 2000 字 |
| quality | string | 是 | 规格档,须是配置里 qualities 的一项(不区分大小写) |
| aspectRatio | string | 否 | 比例,须在 aspectRatios 内;不传取第一个 |
| n | number | 否 | 张数,1 到 nMax,默认 1;按张计费 |
| inputImages | string[] | 否 | 参考图地址:公网 http/https 地址,或上传接口返回的地址 |
| expectedCredits | number | 否 | 你预期扣的积分;与服务端当前价格不一致时返回 price_changed,不建任务、不扣费 |
curl -X POST https://lingluo.vip/openapi/generation/create/image \
-H "Authorization: Bearer $LINGLUO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-20261113-001" \
-d '{
"channel": "86",
"model": "gpt-image-2",
"prompt": "一只橘猫坐在窗台上,午后阳光",
"quality": "2K",
"aspectRatio": "16:9",
"n": 1
}'{ "taskId": "01M7ABD5K8M0EYY06VSA5QW2R1", "costCredits": 8, "status": 1, "reused": false }Idempotency-Key(可选,最长 56 个字符):同一个键重复提交会返回同一个任务(reused: true),不会重复扣费,网络超时后重试时请带上。创建视频任务
POST/generation/create/video
参数与图片相同(没有 n,一次一条),另有:
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| duration | number | 是 | 时长(秒),须在配置的 durations 内 |
| mode | string | 否 | 生成模式,仅作说明;实际按是否传了参考素材决定 |
| inputImages | string[] | 否 | 参考图 / 首帧 |
| inputVideos | string[] | 否 | 参考视频;带参考视频时按规格的 referenceVideoMultiplier 计价 |
| inputAudios | string[] | 否 | 参考音频 |
curl -X POST https://lingluo.vip/openapi/generation/create/video \
-H "Authorization: Bearer $LINGLUO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"channel": "60",
"model": "kling-v2",
"prompt": "镜头缓慢推进,海浪拍打礁石",
"quality": "720p",
"aspectRatio": "16:9",
"duration": 5
}'查询任务
GET/generation/detail?taskId=
GET/generation/status?taskId=
detail 返回完整信息,status 只返回 taskId、status、statusText、progress,轮询用 status 更轻。只能查询本账户的任务。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | number | 否 | 1 图片、2 视频 |
| status | number | 否 | 1 等待、2 执行中、3 成功、4 失败(含已取消) |
| statusText | string | 否 | queued / running / succeeded / failed / canceled |
| progress | number | 否 | 进度 0–100 |
| channel / model | string | 否 | 线路编号与模型 |
| costCredits | number | 否 | 本次扣除的积分(失败后已退回) |
| outputs | string[] | 否 | 结果地址,成功后才有;保留 30 天,到期后为空数组 |
| errorCode / errorMessage | string | 否 | 失败原因,只在失败时返回 |
| createdAt / finishedAt | string | 否 | ISO 8601 时间 |
{
"taskId": "01M7ABD5K8M0EYY06VSA5QW2R1",
"type": 1,
"status": 3,
"statusText": "succeeded",
"progress": 100,
"channel": "86",
"model": "gpt-image-2",
"prompt": "一只橘猫坐在窗台上,午后阳光",
"costCredits": 8,
"outputs": ["https://lingluo.vip/static/01M7ABD5K8M0EYY06VSA5QW2R1/….png"],
"errorCode": null,
"errorMessage": null,
"createdAt": "2026-11-13T11:41:38.261Z",
"finishedAt": "2026-11-13T11:42:05.020Z"
}批量查询状态
POST/generation/status/batch
一次最多 50 个:请求 { "taskIds": ["…", "…"] },返回 { items: [{ taskId, status, statusText, progress }], notFound: [] },查不到的编号放在 notFound。
积分余额
GET/account/credits
返回 { balance, creditsPerYuan }。API 与网页共用同一个积分余额。
上传素材
POST/uploads
本地文件先上传,拿到的地址可直接用于 inputImages / inputVideos / inputAudios。multipart 字段名 file;类型按文件内容识别,支持 JPG、PNG、WEBP、GIF、MP4、MOV、WEBM、MP3、WAV、M4A。 大小上限:图片 20MB、视频 200MB、音频 50MB。
curl -X POST https://lingluo.vip/openapi/uploads \ -H "Authorization: Bearer $LINGLUO_API_KEY" \ -F "file=@./cat.png"
{ "url": "https://lingluo.vip/static/uploads/….png", "kind": "image", "mime": "image/png", "sizeBytes": 183204 }