鉴权
所有 /v1/* 都要带 Key。转换页生成,每人一把;重新生成后旧 Key 立刻失效。
| 请求头 | 示例值 |
Authorization | Bearer sk-1a2b3c4d5e6f7g8h |
Content-Type | application/json(POST 时) |
请求:无 body。查余额:
curl http://127.0.0.1:8090/v1/me \
-H "Authorization: Bearer sk-1a2b3c4d5e6f7g8h"
响应字段:
| 字段 | 类型 | 示例值 | 说明 |
| email | string | "you@example.com" | 账号 |
| credits | int | 120 | 余额 |
| vip_level | int | 1 | 数字档;Pro 为 0 |
| vip_plan | string | "pro" | 空为数字档;pro 日限不限 |
| vip_expire | int | 1767196799 | 到期 Unix 秒;0 表示无 |
| daily_used | int | 3 | 今日已用免费额度 |
| daily_cap | int | 1000 | 今日免费上限;Pro 为 0 |
| daily_unlimited | bool | false | Pro 为 true,成功不扣余额 |
| charge | bool | false | 下一条成功是否扣余额 |
| max_count | int | 100 | count 上限 |
响应示例:
{
"email": "you@example.com",
"credits": 120,
"vip_level": 1,
"vip_expire": 1767196799,
"daily_used": 3,
"daily_cap": 1000,
"charge": false,
"max_count": 100
}
链 → 口令
POST /v1/convert/batch(一次返回 JSON) POST /v1/convert/batch/stream(NDJSON,谁先完成谁先一行)
产出条数 = 链接数 × count × 形式数。例:1 条链 × 2 条 × 码式+中文 = 4。
| 字段 | 类型 | 必填 | 示例值 | 说明 |
| items | array | 与 input 二选一 |
["https://pan.quark.cn/s/9b6944bd7b7e"] |
分享链。字符串,或对象。一段文本里多条链会拆开 |
| items[].id | string | 否 |
"task-1" |
你自己的编号,原样返回,用来对号 |
| items[].input | string | 对象时必填 |
"https://pan.quark.cn/s/9b6944bd7b7e" |
一条分享链;可带 ?pwd= |
| items[].title | string | 否 |
"电影" |
写入口令标题。空则自动取链标题,没有则「资源」 |
| items[].count | int | 否 |
2 |
这一条链每种形式出几条。不写则用外层 count,范围 1~100 |
| modes | string[] | 否 |
["code","cn"] |
默认 ["code"]。code 码式 /~xxx~:/,cn 中文 |
| count | int | 否 |
2 |
每种形式出几条,默认 1,范围 1~100 |
| title | string | 否 |
"电影" |
所有项共用的默认标题 |
| input | string | 与 items 二选一 |
"https://pan.quark.cn/s/9b6944bd7b7e" |
没有 items 时用这段文本抽链,等价于一项 |
items 也可以只写字符串,等价于只有 input:
{
"items": ["https://pan.quark.cn/s/9b6944bd7b7e"],
"modes": ["code"],
"count": 1
}
请求示例:
curl http://127.0.0.1:8090/v1/convert/batch \
-H "Authorization: Bearer sk-1a2b3c4d5e6f7g8h" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"id": "task-1",
"input": "https://pan.quark.cn/s/9b6944bd7b7e",
"title": "电影"
}
],
"modes": ["code", "cn"],
"count": 1
}'
同步响应字段:
| 字段 | 类型 | 示例值 | 说明 |
| job_id | string | "job_a1b2c3d4e5f60718" | 本次任务号 |
| summary.charged | int | 2 | 实际扣费条数 |
| summary.ok_tokens | int | 2 | 成功口令数 |
| summary.failed | int | 0 | 失败口令数(不扣费) |
| results[].id | string | "task-1" | 你传的 id |
| results[].index | int | 0 | 拆链后的下标,从 0 起 |
| results[].input | string | "https://pan.quark.cn/s/9b6944bd7b7e" | 原链 |
| results[].title | string | "电影" | 实际用的标题 |
| results[].pwd_id | string | "9b6944bd7b7e" | 分享 ID |
| results[].tokens[].mode | string | "code" | code / cn |
| results[].tokens[].n | int | 1 | 该形式第几条,从 1 起 |
| results[].tokens[].ok | bool | true | 这条口令是否成功 |
| results[].tokens[].output | string | "/~e7573avwOe~:/" | 口令;失败时无此字段 |
| results[].tokens[].error | string | "分享已失效" | 失败原因 |
同步响应示例:
{
"job_id": "job_a1b2c3d4e5f60718",
"summary": { "charged": 2, "ok_tokens": 2, "failed": 0 },
"results": [
{
"id": "task-1",
"index": 0,
"input": "https://pan.quark.cn/s/9b6944bd7b7e",
"title": "电影",
"pwd_id": "9b6944bd7b7e",
"tokens": [
{ "mode": "code", "n": 1, "ok": true, "output": "/~e7573avwOe~:/" },
{ "mode": "cn", "n": 1, "ok": true, "output": "亝已并二另并诶提枫另有忛" }
]
}
]
}
流式每行一个 JSON。type=token 按完成先后到达,用行内 index / id / mode / n 对号,不要按第几行。
{"type":"meta","job_id":"job_a1b2c3d4e5f60718","max_charge":2}
{"type":"token","index":0,"id":"task-1","input":"https://pan.quark.cn/s/9b6944bd7b7e","title":"电影","mode":"cn","n":1,"ok":true,"output":"亝已并二另并诶提枫另有忛","pwd_id":"9b6944bd7b7e","charged":1}
{"type":"token","index":0,"id":"task-1","input":"https://pan.quark.cn/s/9b6944bd7b7e","title":"电影","mode":"code","n":1,"ok":true,"output":"/~e7573avwOe~:/","pwd_id":"9b6944bd7b7e","charged":1}
{"type":"done","charged":2,"ok_tokens":2,"failed":0}
口令 → 链
POST /v1/parse POST /v1/parse/stream。不要传 modes / count / title。一条口令进,一条链接出。
| 字段 | 类型 | 必填 | 示例值 | 说明 |
| items | array | 与 input 二选一 |
["/~e7573avwOe~:/"] |
口令列表。字符串,或对象。一项只放一条最稳 |
| items[].id | string | 否 |
"a" |
你自己的编号,原样返回 |
| items[].input | string | 对象时必填 |
"/~e7573avwOe~:/" |
码式或中文口令,例如 亝已并二另并诶提枫另有忛 |
| input | string | 与 items 二选一 |
"/~e7573avwOe~:/\n亝已并二另并诶提枫另有忛" |
整段粘贴,按出现位置抽口令。items 优先 |
请求示例:
curl http://127.0.0.1:8090/v1/parse \
-H "Authorization: Bearer sk-1a2b3c4d5e6f7g8h" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "id": "a", "input": "/~e7573avwOe~:/" },
{ "id": "b", "input": "亝已并二另并诶提枫另有忛" }
]
}'
同步响应字段:
| 字段 | 类型 | 示例值 | 说明 |
| job_id | string | "job_p1a2b3c4d5e60718" | 本次任务号 |
| summary.charged | int | 2 | 实际扣费条数 |
| summary.ok | int | 2 | 成功条数 |
| summary.failed | int | 0 | 失败条数(不扣费) |
| results[].index | int | 0 | 抽出口令后的下标,从 0 起 |
| results[].id | string | "a" | 你传的 id |
| results[].input | string | "/~e7573avwOe~:/" | 原口令 |
| results[].ok | bool | true | 这条是否成功 |
| results[].url | string | "https://pan.quark.cn/s/9b6944bd7b7e?pwd=rhmy" | 还原的分享链 |
| results[].pwd_id | string | "9b6944bd7b7e" | 分享 ID |
| results[].passcode | string | "rhmy" | 提取码;没有则为空 |
| results[].error | string | "口令无效" | 失败原因 |
同步响应示例:
{
"job_id": "job_p1a2b3c4d5e60718",
"summary": { "charged": 2, "ok": 2, "failed": 0 },
"results": [
{
"index": 0,
"id": "a",
"input": "/~e7573avwOe~:/",
"ok": true,
"url": "https://pan.quark.cn/s/9b6944bd7b7e?pwd=rhmy",
"pwd_id": "9b6944bd7b7e",
"passcode": "rhmy"
},
{
"index": 1,
"id": "b",
"input": "亝已并二另并诶提枫另有忛",
"ok": true,
"url": "https://pan.quark.cn/s/9b6944bd7b7e?pwd=rhmy",
"pwd_id": "9b6944bd7b7e",
"passcode": "rhmy"
}
]
}
流式按 index 0、1、2…写出。同一条分享的码式和中文是两个口令,pwd_id 相同不是解错。
{"type":"meta","job_id":"job_p1a2b3c4d5e60718","max_charge":2}
{"type":"result","index":0,"id":"a","input":"/~e7573avwOe~:/","ok":true,"url":"https://pan.quark.cn/s/9b6944bd7b7e?pwd=rhmy","pwd_id":"9b6944bd7b7e","passcode":"rhmy","charged":1}
{"type":"result","index":1,"id":"b","input":"亝已并二另并诶提枫另有忛","ok":true,"url":"https://pan.quark.cn/s/9b6944bd7b7e?pwd=rhmy","pwd_id":"9b6944bd7b7e","passcode":"rhmy","charged":1}
{"type":"done","charged":2,"ok_tokens":2,"failed":0}
怎么对号
同一条结果里的链和口令已经绑在一起,并发不会串号。用字段对齐,不要按到达先后。
| 链 → 口令 | 口令 → 链 |
| 同步 |
results[].index / id / input 对原链;tokens[].mode + n 对口令 |
results[].index / id / input 对原口令;url 是这条链 |
| 流式 |
必须看行内 index、id、mode、n |
已按 index 排队,仍建议用 input / id |
错误
| HTTP | 示例 body | 含义 |
| 401 | {"error":"未登录或 API Key 无效"} | Key / Cookie 无效 |
| 400 | {"error":"没有可转换的输入"} | JSON 或参数不对 |
| 402 | {"error":"余额不足"} | 免费额度用完且没余额,任务不会开始 |
| 503 | {"error":"没有可用设备槽(检查设备与代理绑定)"} | 服务端没有可用槽 |
| 200 | 结果里 "ok": false | 这一条业务失败,不扣费 |