aiconductor-cli 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +582 -488
- package/bin/aiconductor-cli.js +412 -351
- package/package.json +1 -1
- package/src/api.js +151 -3
- package/src/api.test.js +360 -4
- package/src/commands/content.js +184 -184
- package/src/commands/douyin.js +252 -0
- package/src/commands/html_publish.js +54 -54
- package/src/commands/md_publish.js +175 -175
- package/src/commands/web.js +69 -0
- package/src/commands/web_search.js +99 -99
- package/src/commands/wx.js +116 -116
- package/src/commands/xhs.js +763 -609
- package/src/lib/cli-utils.js +172 -172
- package/src/lib/daren-score.js +91 -0
- package/src/lib/daren-score.test.js +57 -0
- package/AGENTS.md +0 -193
- package/api_docs/aic_web_search.md +0 -84
- package/api_docs/audio_converter.md +0 -51
- package/api_docs/balance_query.md +0 -38
- package/api_docs/bing_search.md +0 -55
- package/api_docs/china_stock_data.md +0 -221
- package/api_docs/delete_published_webpage.md +0 -38
- package/api_docs/doubao_search.md +0 -80
- package/api_docs/douyin_link_to_text_v1.md +0 -50
- package/api_docs/douyin_link_to_text_v2.md +0 -50
- package/api_docs/douyin_user_detail.md +0 -65
- package/api_docs/douyin_user_search.md +0 -58
- package/api_docs/douyin_user_videos.md +0 -49
- package/api_docs/douyin_user_videos_async.md +0 -45
- package/api_docs/douyin_user_videos_async_query.md +0 -41
- package/api_docs/douyin_user_videos_max.md +0 -59
- package/api_docs/douyin_video_comments.md +0 -68
- package/api_docs/douyin_video_info.md +0 -70
- package/api_docs/douyin_video_search.md +0 -60
- package/api_docs/douyin_video_search_fast.md +0 -48
- package/api_docs/fast_ocr.md +0 -51
- package/api_docs/flow_article2podcast_creat.md +0 -41
- package/api_docs/flow_article2podcast_query.md +0 -41
- package/api_docs/flow_wx_history_articles.md +0 -45
- package/api_docs/generate_image.md +0 -68
- package/api_docs/get_duration.md +0 -37
- package/api_docs/hot_list_mixed.md +0 -122
- package/api_docs/html_publish.md +0 -50
- package/api_docs/html_publish_flexible.md +0 -65
- package/api_docs/image_resize.md +0 -58
- package/api_docs/image_to_permalink.md +0 -61
- package/api_docs/link_expander.md +0 -39
- package/api_docs/llm_proxy.md +0 -61
- package/api_docs/markitdown.md +0 -47
- package/api_docs/md_to_docx.md +0 -51
- package/api_docs/md_to_html.md +0 -53
- package/api_docs/md_to_mindmap.md +0 -52
- package/api_docs/md_to_pdf.md +0 -52
- package/api_docs/md_to_png.md +0 -53
- package/api_docs/md_to_txt.md +0 -51
- package/api_docs/md_to_wxhtml.md +0 -64
- package/api_docs/md_to_xhs.md +0 -87
- package/api_docs/md_to_xlsx.md +0 -52
- package/api_docs/portrait_enhancement.md +0 -69
- package/api_docs/published_webpages.md +0 -45
- package/api_docs/r2_uploader.md +0 -51
- package/api_docs/schedulerx_job_create.md +0 -56
- package/api_docs/transaction_query.md +0 -52
- package/api_docs/url_to_markdown.md +0 -50
- package/api_docs/video_download_url.md +0 -57
- package/api_docs/video_download_url_oss.md +0 -55
- package/api_docs/video_to_text.md +0 -48
- package/api_docs/video_to_text_v2.md +0 -49
- package/api_docs/volcengine_face_pretty.md +0 -55
- package/api_docs/volcengine_faceswap.md +0 -55
- package/api_docs/website_screenshot.md +0 -49
- package/api_docs/wx_access_token.md +0 -44
- package/api_docs/wx_article_analysis_data_push.md +0 -43
- package/api_docs/wx_article_data.md +0 -48
- package/api_docs/wx_article_style_rewrite.md +0 -45
- package/api_docs/wx_draft_add.md +0 -56
- package/api_docs/wx_draft_publish.md +0 -47
- package/api_docs/wx_history_articles.md +0 -89
- package/api_docs/wx_image_upload.md +0 -46
- package/api_docs/wx_md_to_html.md +0 -48
- package/api_docs/wx_rss_reader.md +0 -59
- package/api_docs/xhs_hot_list.md +0 -48
- package/api_docs/xhs_note_comments_fast.md +0 -54
- package/api_docs/xhs_note_info_v2.md +0 -45
- package/api_docs/xhs_note_info_v3.md +0 -69
- package/api_docs/xhs_note_publish.md +0 -54
- package/api_docs/xhs_note_search_v2.md +0 -73
- package/api_docs/xhs_note_search_v3.md +0 -54
- package/api_docs/xhs_user_info_v2.md +0 -61
- package/api_docs/xhs_user_notes_v2.md +0 -56
- package/api_docs/xhs_user_notes_v3.md +0 -48
package/api_docs/get_duration.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/get_duration`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 本接口无需鉴权(代码中未读取 api_key,无计费)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
获取视频文件的时长信息,无计费。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| file_url | string | 是 | - | 视频文件的 URL |
|
|
15
|
-
|
|
16
|
-
## 响应参数
|
|
17
|
-
|
|
18
|
-
| 参数名 | 类型 | 说明 |
|
|
19
|
-
|--------|------|------|
|
|
20
|
-
| success | boolean | 是否成功 |
|
|
21
|
-
| message | string | 响应消息(成功/失败原因) |
|
|
22
|
-
| data | object | 时长信息 |
|
|
23
|
-
| data.duration | number | 视频时长(秒) |
|
|
24
|
-
| data.* | any | 底层时长服务返回的其他字段 |
|
|
25
|
-
|
|
26
|
-
## 请求示例
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
curl -X POST "http://plugin.aiconductor.fun/api/get_duration" \
|
|
30
|
-
-H "Content-Type: application/json" \
|
|
31
|
-
-d '{"file_url": "https://example.com/video.mp4"}'
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## 注意事项
|
|
35
|
-
1. 本插件无任何鉴权与计费逻辑,调用 free。
|
|
36
|
-
2. data 字段具体结构取决于底层时长获取服务,duration(秒)为可靠返回字段。
|
|
37
|
-
3. 获取失败或发生异常时返回 success=false 且 data 为空对象。
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/hot_list_mixed`
|
|
3
|
-
- **方法**: `POST` / `GET`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
聚合获取 NewsNow 支持的多平台热榜;每个成功返回数据的 `source_id` 按服务单价计费一次,失败来源不计费。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| source_ids | array<string> / string | 是 | - | 平台来源 ID 数组,或以逗号分隔的字符串;去重后至少提供 1 个、最多 52 个。仅支持下表中的不重复来源 ID。 |
|
|
15
|
-
| latest | boolean | 否 | true | 是否请求上游尝试返回较新的数据。`true` 不保证绕过上游缓存。 |
|
|
16
|
-
| limit | integer | 否 | 30 | 每个平台最多返回的热榜条数,范围 1-30。 |
|
|
17
|
-
|
|
18
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
19
|
-
|
|
20
|
-
**支持的平台 ID(52 个不重复来源):**
|
|
21
|
-
|
|
22
|
-
| 来源 ID | 平台 | 内容 |
|
|
23
|
-
|--------|------|------|
|
|
24
|
-
| `v2ex` | V2EX | 最新分享 |
|
|
25
|
-
| `zhihu` | 知乎 | 热点 |
|
|
26
|
-
| `weibo` | 微博 | 实时热搜 |
|
|
27
|
-
| `zaobao` | 联合早报 | 最新新闻 |
|
|
28
|
-
| `coolapk` | 酷安 | 今日最热 |
|
|
29
|
-
| `mktnews` | MKTNews | 快讯 |
|
|
30
|
-
| `mktnews-flash` | MKTNews | 快讯 |
|
|
31
|
-
| `wallstreetcn` | 华尔街见闻 | 快讯 |
|
|
32
|
-
| `wallstreetcn-quick` | 华尔街见闻 | 快讯 |
|
|
33
|
-
| `wallstreetcn-news` | 华尔街见闻 | 最新新闻 |
|
|
34
|
-
| `wallstreetcn-hot` | 华尔街见闻 | 最热 |
|
|
35
|
-
| `douyin` | 抖音 | 热点 |
|
|
36
|
-
| `hupu` | 虎扑 | 主干道热帖 |
|
|
37
|
-
| `dongqiudi` | 懂球帝 | 头条 |
|
|
38
|
-
| `aihot` | AIHOT | AI 新闻 |
|
|
39
|
-
| `tieba` | 百度贴吧 | 热议 |
|
|
40
|
-
| `toutiao` | 今日头条 | 热点 |
|
|
41
|
-
| `ithome` | IT之家 | 最新新闻 |
|
|
42
|
-
| `thepaper` | 澎湃新闻 | 热榜 |
|
|
43
|
-
| `sputniknewscn` | 卫星通讯社 | 最新新闻 |
|
|
44
|
-
| `cankaoxiaoxi` | 参考消息 | 最新新闻 |
|
|
45
|
-
| `pcbeta-windows11` | 远景论坛 | Win11 |
|
|
46
|
-
| `cls` | 财联社 | 电报 |
|
|
47
|
-
| `cls-telegraph` | 财联社 | 电报 |
|
|
48
|
-
| `cls-depth` | 财联社 | 深度 |
|
|
49
|
-
| `cls-hot` | 财联社 | 热门 |
|
|
50
|
-
| `xueqiu` | 雪球 | 热门股票 |
|
|
51
|
-
| `gelonghui` | 格隆汇 | 事件 |
|
|
52
|
-
| `fastbull` | 法布财经 | 快讯 |
|
|
53
|
-
| `fastbull-express` | 法布财经 | 快讯 |
|
|
54
|
-
| `fastbull-news` | 法布财经 | 头条 |
|
|
55
|
-
| `solidot` | Solidot | 最新新闻 |
|
|
56
|
-
| `hackernews` | Hacker News | 热门故事 |
|
|
57
|
-
| `producthunt` | Product Hunt | 热门产品 |
|
|
58
|
-
| `github` | GitHub | 今日趋势 |
|
|
59
|
-
| `bilibili` | 哔哩哔哩 | 热搜 |
|
|
60
|
-
| `bilibili-hot-search` | 哔哩哔哩 | 热搜 |
|
|
61
|
-
| `kaopu` | 靠谱新闻 | 最新新闻 |
|
|
62
|
-
| `jin10` | 金十数据 | 最新新闻 |
|
|
63
|
-
| `baidu` | 百度 | 热搜 |
|
|
64
|
-
| `nowcoder` | 牛客 | 热搜 |
|
|
65
|
-
| `sspai` | 少数派 | 热点 |
|
|
66
|
-
| `juejin` | 稀土掘金 | 热点 |
|
|
67
|
-
| `ifeng` | 凤凰网 | 热点资讯 |
|
|
68
|
-
| `chongbuluo-latest` | 虫部落 | 最新帖子 |
|
|
69
|
-
| `chongbuluo-hot` | 虫部落 | 热门帖子 |
|
|
70
|
-
| `douban` | 豆瓣 | 热门电影 |
|
|
71
|
-
| `steam` | Steam | 在线人数 |
|
|
72
|
-
| `tencent-hot` | 腾讯新闻 | 综合早报 |
|
|
73
|
-
| `freebuf` | FreeBuf | 网络安全 |
|
|
74
|
-
| `qqvideo-tv-hotsearch` | 腾讯视频 | 热搜榜 |
|
|
75
|
-
| `iqiyi-hot-ranklist` | 爱奇艺 | 热播榜 |
|
|
76
|
-
|
|
77
|
-
## 响应参数
|
|
78
|
-
|
|
79
|
-
| 参数名 | 类型 | 说明 |
|
|
80
|
-
|--------|------|------|
|
|
81
|
-
| success | boolean | 是否成功 |
|
|
82
|
-
| message | string | 响应消息 |
|
|
83
|
-
| data | object | 热榜查询结果 |
|
|
84
|
-
| data.sources | array | 成功获取数据的平台列表,保持请求的来源顺序 |
|
|
85
|
-
| data.sources[].source_id | string | 上游实际使用的平台来源 ID |
|
|
86
|
-
| data.sources[].status | string | 上游数据状态,`success` 或 `cache` |
|
|
87
|
-
| data.sources[].updated_time | integer | 上游更新时间,Unix 毫秒时间戳 |
|
|
88
|
-
| data.sources[].items | array | 热榜条目列表 |
|
|
89
|
-
| data.sources[].items[].id | string | 条目 ID |
|
|
90
|
-
| data.sources[].items[].title | string | 标题 |
|
|
91
|
-
| data.sources[].items[].url | string | 原文链接 |
|
|
92
|
-
| data.sources[].items[].mobile_url | string | 移动端链接,可能为空 |
|
|
93
|
-
| data.sources[].items[].pub_date | integer / string | 发布时间,格式取决于来源 |
|
|
94
|
-
| data.sources[].items[].extra | object | 来源特有的补充信息,可能为空对象 |
|
|
95
|
-
| data.failed_sources | array | 请求失败的平台列表;成功平台仍会正常返回 |
|
|
96
|
-
| data.failed_sources[].source_id | string | 失败的平台来源 ID |
|
|
97
|
-
| data.failed_sources[].message | string | 失败原因概要 |
|
|
98
|
-
| billing | object | 计费信息 |
|
|
99
|
-
| billing.service_fee | float | 本次服务费,为服务单价乘以成功来源数量 |
|
|
100
|
-
| billing.discount_applied | boolean | 是否应用折扣 |
|
|
101
|
-
| billing.balance_before | float | 扣费前余额 |
|
|
102
|
-
| billing.balance_after | float | 扣费后余额 |
|
|
103
|
-
| billing.currency | string | 货币类型(CNY) |
|
|
104
|
-
| billing.transaction_id | string | 交易 ID;未扣费时为 null |
|
|
105
|
-
|
|
106
|
-
## 请求示例
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
curl -X POST "http://plugin.aiconductor.fun/api/hot_list_mixed" \
|
|
110
|
-
-H "Authorization: Bearer your_api_key" \
|
|
111
|
-
-H "Content-Type: application/json" \
|
|
112
|
-
-d '{
|
|
113
|
-
"source_ids": ["zhihu", "weibo"],
|
|
114
|
-
"latest": true,
|
|
115
|
-
"limit": 10
|
|
116
|
-
}'
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## 注意事项
|
|
120
|
-
1. 余额校验按请求的去重后来源数量计算;实际仅对成功返回数据的来源扣费,每个成功来源扣一次服务单价。
|
|
121
|
-
2. 当部分来源失败时,接口仍返回成功来源和 `failed_sources`;当全部来源失败时不扣费。
|
|
122
|
-
3. 上游服务可能返回缓存数据或临时不可用,调用方应根据 `status` 和 `failed_sources` 做容错处理。
|
package/api_docs/html_publish.md
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/html_publish`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
将 HTML 代码发布为网页并上传到阿里云 OSS 存储,自动添加时间戳和 UUID 后缀确保文件名唯一性,并自动为链接添加 `target="_blank"`。按次计费,费用以 api_services 表配置为准。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| html_code | string | 是 | - | HTML 格式文本内容(支持完整文档或 HTML 片段,系统会自动提取 `<!DOCTYPE html>` 到 `</html>` 部分) |
|
|
15
|
-
| title | string | 否 | 随机 8 位十六进制串 | 文档标题,用作文件名基础(不含后缀) |
|
|
16
|
-
|
|
17
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
18
|
-
|
|
19
|
-
## 响应参数
|
|
20
|
-
|
|
21
|
-
| 参数名 | 类型 | 说明 |
|
|
22
|
-
|--------|------|------|
|
|
23
|
-
| success | boolean | 是否成功 |
|
|
24
|
-
| message | string | 响应消息 |
|
|
25
|
-
| online_url | string | 在线访问的网页 URL(失败时为 "") |
|
|
26
|
-
| billing | object | 计费信息(见下方子字段) |
|
|
27
|
-
| billing.service_fee | float | 本次服务费用 |
|
|
28
|
-
| billing.discount_applied | boolean | 是否应用折扣 |
|
|
29
|
-
| billing.balance_before | float | 扣费前账户余额 |
|
|
30
|
-
| billing.balance_after | float | 扣费后账户余额 |
|
|
31
|
-
| billing.currency | string | 货币单位(CNY) |
|
|
32
|
-
| billing.transaction_id | string | 交易流水号(未扣费时为 null) |
|
|
33
|
-
| billing.error | string | 错误信息(仅失败响应的 billing 中可能出现) |
|
|
34
|
-
|
|
35
|
-
## 请求示例
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
curl -X POST "http://plugin.aiconductor.fun/api/html_publish" \
|
|
39
|
-
-H "Authorization: Bearer your_api_key" \
|
|
40
|
-
-H "Content-Type: application/json" \
|
|
41
|
-
-d '{
|
|
42
|
-
"html_code": "<!DOCTYPE html><html><head><title>页面</title></head><body><h1>你好</h1></body></html>",
|
|
43
|
-
"title": "我的页面"
|
|
44
|
-
}'
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## 注意事项
|
|
48
|
-
1. 采用后扣费模式:网页发布事务(finalize_webpage_publish)成功后才扣费;若发布事务失败,系统会尝试清理已上传的 OSS 文件且不扣费。
|
|
49
|
-
2. API 密钥无效、账户禁用或余额不足时不扣费;OSS 上传或服务异常时不扣费。
|
|
50
|
-
3. 系统会自动剥离 Markdown 代码块标记(```html ... ```)并提取纯 HTML 内容,且为所有 `<a href>` 链接追加 `target="_blank"`。
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/html_publish_flexible`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
将 HTML 代码发布为网页并上传到阿里云 OSS 存储,支持通过 `html_code` 或 `html_url` 提供内容(二选一),支持自定义 `file_name`、`base_url` 和 `directory`。按次计费,费用以 api_services 表配置为准。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| file_name | string | 是 | - | 文件名(不含后缀,系统自动追加 .html) |
|
|
15
|
-
| html_code | string | 条件必填 | null | HTML 文本(与 html_url 二选一,二者只能提供一个) |
|
|
16
|
-
| html_url | string | 条件必填 | null | HTML 文件链接,仅支持 .html 文件(与 html_code 二选一) |
|
|
17
|
-
| base_url | string | 否 | 默认配置 | 可选的自定义 OSS base_url(访问域名) |
|
|
18
|
-
| directory | string | 否 | 默认配置 | 可选的自定义 OSS 存储目录 |
|
|
19
|
-
|
|
20
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
21
|
-
|
|
22
|
-
## 响应参数
|
|
23
|
-
|
|
24
|
-
| 参数名 | 类型 | 说明 |
|
|
25
|
-
|--------|------|------|
|
|
26
|
-
| success | boolean | 是否成功 |
|
|
27
|
-
| message | string | 响应消息 |
|
|
28
|
-
| online_url | string | 在线访问的网页 URL(失败时为 "") |
|
|
29
|
-
| billing | object | 计费信息(见下方子字段) |
|
|
30
|
-
| billing.service_fee | float | 本次服务费用 |
|
|
31
|
-
| billing.discount_applied | boolean | 是否应用折扣 |
|
|
32
|
-
| billing.balance_before | float | 扣费前账户余额 |
|
|
33
|
-
| billing.balance_after | float | 扣费后账户余额 |
|
|
34
|
-
| billing.currency | string | 货币单位(CNY) |
|
|
35
|
-
| billing.transaction_id | string | 交易流水号(未扣费时为 null) |
|
|
36
|
-
| billing.error | string | 错误信息(仅失败响应的 billing 中可能出现) |
|
|
37
|
-
|
|
38
|
-
## 请求示例
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# 方式一:直接传 HTML 代码
|
|
42
|
-
curl -X POST "http://plugin.aiconductor.fun/api/html_publish_flexible" \
|
|
43
|
-
-H "Authorization: Bearer your_api_key" \
|
|
44
|
-
-H "Content-Type: application/json" \
|
|
45
|
-
-d '{
|
|
46
|
-
"file_name": "landing",
|
|
47
|
-
"html_code": "<!DOCTYPE html><html><body><h1>Hello</h1></body></html>",
|
|
48
|
-
"directory": "my_pages"
|
|
49
|
-
}'
|
|
50
|
-
|
|
51
|
-
# 方式二:传 HTML 文件链接
|
|
52
|
-
curl -X POST "http://plugin.aiconductor.fun/api/html_publish_flexible" \
|
|
53
|
-
-H "Authorization: Bearer your_api_key" \
|
|
54
|
-
-H "Content-Type: application/json" \
|
|
55
|
-
-d '{
|
|
56
|
-
"file_name": "landing",
|
|
57
|
-
"html_url": "https://example.com/page.html"
|
|
58
|
-
}'
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## 注意事项
|
|
62
|
-
1. `html_code` 与 `html_url` 必须且只能提供其中一个:两者都未提供或同时提供时返回失败且不扣费。
|
|
63
|
-
2. 当提供 `html_url` 时,链接必须以 `.html` 结尾(忽略查询串与锚点),否则返回失败且不扣费;下载失败时不扣费。
|
|
64
|
-
3. 采用后扣费模式:OSS 上传成功并记录交易后才扣费;API 密钥无效、账户禁用或余额不足时不扣费。
|
|
65
|
-
4. 系统会自动为所有 `<a href>` 链接追加 `target="_blank"`,并提取纯 HTML 内容。
|
package/api_docs/image_resize.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/image_resize`
|
|
3
|
-
- **方法**: `POST` / `GET`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
根据尺寸/体积限制对图片等比例缩放并压缩,处理完成后上传至阿里云 OSS。按次计费,费用以 api_services 表配置为准(服务码 `image_resize`)。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| image_url | string | 是 | - | 原始图片链接 |
|
|
15
|
-
| max_width | integer | 否 | `None` | 最大宽度(像素),超出则等比缩放 |
|
|
16
|
-
| max_height | integer | 否 | `None` | 最大高度(像素),超出则等比缩放 |
|
|
17
|
-
| max_MB | float | 否 | `None` | 最大体积(MB),超出则渐进式压缩画质/尺寸 |
|
|
18
|
-
|
|
19
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
20
|
-
|
|
21
|
-
## 响应参数
|
|
22
|
-
|
|
23
|
-
| 参数名 | 类型 | 说明 |
|
|
24
|
-
|--------|------|------|
|
|
25
|
-
| success | boolean | 是否成功 |
|
|
26
|
-
| message | string | 响应消息 |
|
|
27
|
-
| processed_url | string | 处理后图片 URL(已上传 OSS),失败/未处理时为原图或空串 |
|
|
28
|
-
| width | integer | 最终宽度(像素),未处理时为 0 |
|
|
29
|
-
| height | integer | 最终高度(像素),未处理时为 0 |
|
|
30
|
-
| size_mb | float | 最终体积(MB),未处理时为 0 |
|
|
31
|
-
| billing | object | 计费信息 |
|
|
32
|
-
| billing.service_fee | float | 本次费用(= base_fee) |
|
|
33
|
-
| billing.base_fee | float | 基础单价(来自 api_services) |
|
|
34
|
-
| billing.discount_applied | boolean | 是否应用折扣(恒为 false) |
|
|
35
|
-
| billing.balance_before | float | 扣费前余额 |
|
|
36
|
-
| billing.balance_after | float | 扣费后余额 |
|
|
37
|
-
| billing.currency | string | 货币单位,固定 `CNY` |
|
|
38
|
-
| billing.transaction_id | int/null | 交易 ID |
|
|
39
|
-
|
|
40
|
-
## 请求示例
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
curl -X POST "http://plugin.aiconductor.fun/api/image_resize" \
|
|
44
|
-
-H "Authorization: Bearer your_api_key" \
|
|
45
|
-
-H "Content-Type: application/json" \
|
|
46
|
-
-d '{
|
|
47
|
-
"image_url": "https://example.com/photo.jpg",
|
|
48
|
-
"max_width": 1200,
|
|
49
|
-
"max_MB": 1.5
|
|
50
|
-
}'
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## 注意事项
|
|
54
|
-
1. `max_width`、`max_height`、`max_MB` 三个限制条件均未提供时,直接返回原图信息且不计费、不扣费(`service_fee=0`)。
|
|
55
|
-
2. 余额不足时不扣费,返回 `success=false`。
|
|
56
|
-
3. 透明通道图片(PNG/RGBA)会转换为 RGB 后以 JPEG 保存。
|
|
57
|
-
4. 处理失败(下载/压缩/上传异常)时返回 `success=false`,不计费。
|
|
58
|
-
5. 下载图片超时 15 秒,超限视为失败。
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/image_to_permalink`
|
|
3
|
-
- **方法**: `POST` / `GET`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
批量将图片上传至阿里云 OSS 并生成永久链接。按成功上传的图片张数计费,单价以 api_services 表配置为准(服务码 `image_to_permalink`)。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| image_urls | array | 是 | - | 图片 URL 列表,单次最多 50 张 |
|
|
15
|
-
|
|
16
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
17
|
-
|
|
18
|
-
## 响应参数
|
|
19
|
-
|
|
20
|
-
| 参数名 | 类型 | 说明 |
|
|
21
|
-
|--------|------|------|
|
|
22
|
-
| success | boolean | 是否成功(全部成功或部分成功均为 true,全部失败为 false) |
|
|
23
|
-
| message | string | 响应消息 |
|
|
24
|
-
| permalink | array | 上传后的永久链接列表,失败项为空字符串 |
|
|
25
|
-
| upload_results | array | 每张图片的上传结果详情 |
|
|
26
|
-
| upload_results[].index | integer | 图片序号(从 1 开始) |
|
|
27
|
-
| upload_results[].original_url | string | 原始图片 URL |
|
|
28
|
-
| upload_results[].permalink | string | 上传后的永久链接,失败为空 |
|
|
29
|
-
| upload_results[].success | boolean | 该张是否上传成功 |
|
|
30
|
-
| upload_results[].file_size | integer | 文件字节数,失败为 0 |
|
|
31
|
-
| upload_results[].message | string | 该张结果说明 |
|
|
32
|
-
| billing | object | 计费信息 |
|
|
33
|
-
| billing.service_fee | float | 实际费用(单价 × 成功张数) |
|
|
34
|
-
| billing.image_count | integer | 成功上传张数 |
|
|
35
|
-
| billing.base_fee_per_image | float | 每张基础单价(来自 api_services) |
|
|
36
|
-
| billing.discount_applied | boolean | 是否应用折扣(成功分支为 true,全失败为 false) |
|
|
37
|
-
| billing.balance_before | float | 扣费前余额 |
|
|
38
|
-
| billing.balance_after | float | 扣费后余额 |
|
|
39
|
-
| billing.currency | string | 货币单位,固定 `CNY` |
|
|
40
|
-
| billing.transaction_id | int/null | 交易 ID |
|
|
41
|
-
|
|
42
|
-
## 请求示例
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
curl -X POST "http://plugin.aiconductor.fun/api/image_to_permalink" \
|
|
46
|
-
-H "Authorization: Bearer your_api_key" \
|
|
47
|
-
-H "Content-Type: application/json" \
|
|
48
|
-
-d '{
|
|
49
|
-
"image_urls": [
|
|
50
|
-
"https://example.com/a.jpg",
|
|
51
|
-
"https://example.com/b.png"
|
|
52
|
-
]
|
|
53
|
-
}'
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## 注意事项
|
|
57
|
-
1. `image_urls` 不能为空;单次最多 50 张,超出返回 `success=false`。
|
|
58
|
-
2. 单张图片超过 10MB 会被拒绝并计入该张失败;仅支持常见图片格式(jpg/png/gif/webp/heif/heic,HEIF/HEIC 自动转 PNG)。
|
|
59
|
-
3. 仅对成功上传的图片计费;部分成功时 `success=true`,计费按成功张数计算。
|
|
60
|
-
4. 余额不足时不扣费,返回 `success=false`。
|
|
61
|
-
5. 全部上传失败时返回 `success=false` 且不扣费。
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/link_expander`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 本接口无需鉴权(代码中未读取 api_key,无计费)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
从分享文本中提取链接并解析为原始长链接的插件,无计费。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| share_url | string | 是 | - | 输入的分享内容文本,可包含链接 |
|
|
15
|
-
| timeout | int | 否 | 10 | 请求超时时间(秒) |
|
|
16
|
-
| clean_params | bool | 否 | true | 是否清理 URL 中的参数(true 清理,false 保留) |
|
|
17
|
-
|
|
18
|
-
## 响应参数
|
|
19
|
-
|
|
20
|
-
| 参数名 | 类型 | 说明 |
|
|
21
|
-
|--------|------|------|
|
|
22
|
-
| success | boolean | 是否成功 |
|
|
23
|
-
| long_url | string | 解析后的长链接 |
|
|
24
|
-
| raw_url | string | 从分享内容中提取出的原始链接 |
|
|
25
|
-
| message | string | 操作结果信息 |
|
|
26
|
-
| status_code | int | 解析请求的 HTTP 状态码 |
|
|
27
|
-
|
|
28
|
-
## 请求示例
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
curl -X POST "http://plugin.aiconductor.fun/api/link_expander" \
|
|
32
|
-
-H "Content-Type: application/json" \
|
|
33
|
-
-d '{"share_url": "点击查看 https://t.cn/abc 更多内容", "timeout": 10, "clean_params": true}'
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## 注意事项
|
|
37
|
-
1. 本插件无任何鉴权与计费逻辑,调用 free。
|
|
38
|
-
2. 默认清理 URL 参数(clean_params=true);设为 false 可保留原始参数。
|
|
39
|
-
3. 从分享文本中自动提取首个有效链接后再进行跳转解析;解析失败返回 success=false 并携带 message 与 status_code。
|
package/api_docs/llm_proxy.md
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/llm_proxy`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(仅做 API 密钥验证,不扣费)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
OpenAI 兼容格式的大模型透明代理,支持 SSE 流式输出与 45 秒心跳,模型 ID 自动路由(当前路由 aiconductor/deepseek-v4-pro → DeepSeek API)。仅校验 API 密钥,**不扣费**。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
遵循 OpenAI `chat/completions` 请求格式:
|
|
12
|
-
|
|
13
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
14
|
-
|--------|------|------|--------|------|
|
|
15
|
-
| model | string | 是 | - | 模型 ID(如 aiconductor/deepseek-v4-pro) |
|
|
16
|
-
| messages | array | 是 | - | 对话消息列表 |
|
|
17
|
-
| stream | bool | 否 | false | 是否流式输出(true 启用 SSE) |
|
|
18
|
-
| temperature | float | 否 | 0.7 | 采样温度 |
|
|
19
|
-
| max_tokens | int | 否 | 4096 | 最大生成 token 数 |
|
|
20
|
-
| top_p | float | 否 | 1.0 | 核采样概率 |
|
|
21
|
-
| frequency_penalty | float | 否 | 0 | 频率惩罚 |
|
|
22
|
-
| presence_penalty | float | 否 | 0 | 存在惩罚 |
|
|
23
|
-
| stop | array | 否 | null | 停止词序列 |
|
|
24
|
-
| thinking | object | 否 | null | 思考参数 |
|
|
25
|
-
| reasoning_effort | string | 否 | null | 推理强度 |
|
|
26
|
-
| response_format | object | 否 | null | 响应格式(如 JSON 模式) |
|
|
27
|
-
| tools | array | 否 | null | 工具定义 |
|
|
28
|
-
| tool_choice | string | 否 | null | 工具选择策略 |
|
|
29
|
-
|
|
30
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
31
|
-
|
|
32
|
-
## 响应参数
|
|
33
|
-
上游原始响应透传,遵循 OpenAI `chat/completions` 格式:
|
|
34
|
-
|
|
35
|
-
| 参数名 | 类型 | 说明 |
|
|
36
|
-
|--------|------|------|
|
|
37
|
-
| id | string | 响应唯一 ID |
|
|
38
|
-
| object | string | 对象类型(如 chat.completion) |
|
|
39
|
-
| created | int | 创建时间戳 |
|
|
40
|
-
| model | string | 实际使用的模型名 |
|
|
41
|
-
| choices | array | 生成结果列表 |
|
|
42
|
-
| usage | object | token 用量统计 |
|
|
43
|
-
| error | string | 异常时返回(如 "Invalid API key"、"Upstream request failed") |
|
|
44
|
-
|
|
45
|
-
> 流式模式(stream=true)下以 SSE 逐块返回 `data: {...}` 事件,结束以 `data: [DONE]` 标记。
|
|
46
|
-
|
|
47
|
-
## 请求示例
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
curl -X POST "http://plugin.aiconductor.fun/api/llm_proxy" \
|
|
51
|
-
-H "Authorization: Bearer your_api_key" \
|
|
52
|
-
-H "Content-Type: application/json" \
|
|
53
|
-
-d '{"model": "aiconductor/deepseek-v4-pro", "messages": [{"role": "user", "content": "你好"}], "stream": false}'
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## 注意事项
|
|
57
|
-
1. 仅校验 API 密钥有效性,本接口**不扣费**。
|
|
58
|
-
2. 模型路由:aiconductor/deepseek-v4-pro 映射为 DeepSeek 实际模型 deepseek-v4-pro;未配置上游 API Key 时返回 "Upstream API key not configured"。
|
|
59
|
-
3. model 与 messages 为必填,缺失返回 `{"error": "model and messages are required"}`。
|
|
60
|
-
4. 非流式超时 180 秒,流式(SSE)超时 600 秒;流式每 45 秒发送一次 `: ping` 心跳以保持微信小程序连接。
|
|
61
|
-
5. 响应为上游原始内容透传,完整保留上游的 choices / usage 等字段结构。
|
package/api_docs/markitdown.md
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/markitdown`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 本插件无需鉴权(未使用 api_key)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
使用 Microsoft MarkItDown 库将指定 URL 的文件转换为 Markdown 格式内容。免费接口,无计费。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| file_url | string | 是 | - | 待转换文件的 URL 地址(需为有效 http/https 链接) |
|
|
15
|
-
| timeout | int | 否 | 30 | 文件下载超时时间(秒) |
|
|
16
|
-
| use_llm | boolean | 否 | false | 是否使用 LLM 进行图像描述(当前版本未接入具体 LLM 客户端) |
|
|
17
|
-
|
|
18
|
-
> **鉴权参数**:本插件不接收 api_key,框架自动注入的 api_key 不会被使用。
|
|
19
|
-
|
|
20
|
-
## 响应参数
|
|
21
|
-
|
|
22
|
-
| 参数名 | 类型 | 说明 |
|
|
23
|
-
|--------|------|------|
|
|
24
|
-
| success | boolean | 是否成功 |
|
|
25
|
-
| content | string | 转换后的 Markdown 文本内容(失败时为空) |
|
|
26
|
-
| file_name | string | 原始文件名 |
|
|
27
|
-
| file_size | int | 文件大小(字节) |
|
|
28
|
-
| message | string | 成功时的响应消息(仅成功响应包含) |
|
|
29
|
-
| error | string | 错误信息(仅失败响应包含,替代 message) |
|
|
30
|
-
|
|
31
|
-
## 请求示例
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
curl -X POST "http://plugin.aiconductor.fun/api/markitdown" \
|
|
35
|
-
-H "Content-Type: application/json" \
|
|
36
|
-
-d '{
|
|
37
|
-
"file_url": "https://example.com/sample.docx",
|
|
38
|
-
"timeout": 30,
|
|
39
|
-
"use_llm": false
|
|
40
|
-
}'
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## 注意事项
|
|
44
|
-
1. 本插件不扣费、不校验 API 密钥,任何人均可直接调用。
|
|
45
|
-
2. `file_url` 必须是合法 URL(含 scheme 与 netloc),否则返回参数错误。
|
|
46
|
-
3. 下载失败(网络异常、HTTP 状态码错误)、依赖库缺失(未安装 markitdown)或转换异常时返回 `success=false` 并附带 `error` 信息。
|
|
47
|
-
4. 转换成功时返回 `message`,失败时返回 `error` 而非 `message`;调用方需同时兼容两个字段。
|
package/api_docs/md_to_docx.md
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/md_to_docx`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
将 Markdown 内容转换为 DOCX 文档并上传到阿里云 OSS,内置针对 htmldocx 库 `no attribute run` 错误的修复补丁。按次计费,费用以 api_services 表配置为准。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| md_text | string | 是 | - | Markdown 文本内容 |
|
|
15
|
-
| filename | string | 否 | "document" | 输出文件名(不含后缀),系统会自动追加时间戳与 UUID 后缀 |
|
|
16
|
-
|
|
17
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
18
|
-
|
|
19
|
-
## 响应参数
|
|
20
|
-
|
|
21
|
-
| 参数名 | 类型 | 说明 |
|
|
22
|
-
|--------|------|------|
|
|
23
|
-
| success | boolean | 是否成功 |
|
|
24
|
-
| message | string | 响应消息 |
|
|
25
|
-
| filename | string | 生成的 DOCX 文件名(失败时为 "") |
|
|
26
|
-
| file_url | string | 生成的文件下载 URL(失败时为 "") |
|
|
27
|
-
| billing | object | 计费信息(见下方子字段) |
|
|
28
|
-
| billing.service_fee | float | 本次服务费用 |
|
|
29
|
-
| billing.discount_applied | boolean | 是否应用折扣 |
|
|
30
|
-
| billing.balance_before | float | 扣费前账户余额 |
|
|
31
|
-
| billing.balance_after | float | 扣费后账户余额 |
|
|
32
|
-
| billing.currency | string | 货币单位(CNY) |
|
|
33
|
-
| billing.transaction_id | string | 交易流水号(未扣费时为 null) |
|
|
34
|
-
| billing.error | string | 错误信息(仅失败响应的 billing 中可能出现) |
|
|
35
|
-
|
|
36
|
-
## 请求示例
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
curl -X POST "http://plugin.aiconductor.fun/api/md_to_docx" \
|
|
40
|
-
-H "Authorization: Bearer your_api_key" \
|
|
41
|
-
-H "Content-Type: application/json" \
|
|
42
|
-
-d '{
|
|
43
|
-
"md_text": "# 标题\n\n这是一段 **加粗** 的正文,下面是一个列表:\n\n- 项目一\n- 项目二",
|
|
44
|
-
"filename": "我的文档"
|
|
45
|
-
}'
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## 注意事项
|
|
49
|
-
1. Markdown 文本为空时返回失败且不扣费;API 密钥无效、账户禁用或余额不足时均不扣费。
|
|
50
|
-
2. 转换过程中若文档格式过于复杂导致解析异常,返回 `success=false` 且提示转换失败,此情况不扣费。
|
|
51
|
-
3. 生成的 DOCX 已统一设置字体(西文 Times New Roman,中文 宋体)。
|
package/api_docs/md_to_html.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
## 接口信息
|
|
2
|
-
- **URL**: `http://plugin.aiconductor.fun/api/md_to_html`
|
|
3
|
-
- **方法**: `POST`
|
|
4
|
-
- **Content-Type**: `application/json`
|
|
5
|
-
- **鉴权**: 请求头 `Authorization: Bearer <api_key>`(兼容 body/query 中 `api_key` 参数)
|
|
6
|
-
|
|
7
|
-
## 功能说明
|
|
8
|
-
将 Markdown 内容转换为美观的 HTML 网页并上传到阿里云 OSS 存储,支持复制按钮和 MathJax 数学公式渲染。按次计费,费用以 api_services 表配置为准。
|
|
9
|
-
|
|
10
|
-
## 请求参数
|
|
11
|
-
|
|
12
|
-
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
13
|
-
|--------|------|------|--------|------|
|
|
14
|
-
| md_text | string | 是 | - | Markdown 文本内容 |
|
|
15
|
-
| filename | string | 否 | 随机 8 位十六进制串 | 文件名(不含后缀),用作网页标题及文件名基础 |
|
|
16
|
-
| add_copy_button | boolean | 否 | true | 是否在页面右下角添加「复制全文」按钮 |
|
|
17
|
-
|
|
18
|
-
> **鉴权参数**:api_key 通过请求头 `Authorization: Bearer <api_key>` 传递,不再列入请求参数表。
|
|
19
|
-
|
|
20
|
-
## 响应参数
|
|
21
|
-
|
|
22
|
-
| 参数名 | 类型 | 说明 |
|
|
23
|
-
|--------|------|------|
|
|
24
|
-
| success | boolean | 是否成功 |
|
|
25
|
-
| message | string | 响应消息 |
|
|
26
|
-
| online_url | string | 在线访问的 HTML 网页 URL(失败时为 "") |
|
|
27
|
-
| file_url | string | 文件 URL(仅在错误响应中返回空字符串,正常成功响应不返回该字段) |
|
|
28
|
-
| billing | object | 计费信息(见下方子字段) |
|
|
29
|
-
| billing.service_fee | float | 本次服务费用 |
|
|
30
|
-
| billing.discount_applied | boolean | 是否应用折扣 |
|
|
31
|
-
| billing.balance_before | float | 扣费前账户余额 |
|
|
32
|
-
| billing.balance_after | float | 扣费后账户余额 |
|
|
33
|
-
| billing.currency | string | 货币单位(CNY) |
|
|
34
|
-
| billing.transaction_id | string | 交易流水号(未扣费时为 null) |
|
|
35
|
-
| billing.error | string | 错误信息(仅失败响应的 billing 中可能出现) |
|
|
36
|
-
|
|
37
|
-
## 请求示例
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
curl -X POST "http://plugin.aiconductor.fun/api/md_to_html" \
|
|
41
|
-
-H "Authorization: Bearer your_api_key" \
|
|
42
|
-
-H "Content-Type: application/json" \
|
|
43
|
-
-d '{
|
|
44
|
-
"md_text": "# 我的网页\n\n支持 $E=mc^2$ 公式与代码块。",
|
|
45
|
-
"filename": "demo_page",
|
|
46
|
-
"add_copy_button": true
|
|
47
|
-
}'
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## 注意事项
|
|
51
|
-
1. 采用后扣费模式:网页发布事务(finalize_webpage_publish)成功后才扣费;若发布事务失败,系统会尝试清理已上传的 OSS 文件且不扣费。
|
|
52
|
-
2. API 密钥无效、账户禁用或余额不足时不扣费;Markdown 解析失败、OSS 上传失败、内容过大时返回失败且不扣费。
|
|
53
|
-
3. 仅 `online_url` 为成功响应的有效返回字段;`file_url` 仅为错误响应占位,正常情况请勿依赖。
|