保存时间:2026/4/3 19:29:55
这是报销系统截图,请识别:
1. 金额输入框的中心坐标(x,y,像素)
2. 报销事由输入框坐标
3. 提交按钮坐标
返回JSON,格式:{"amount_box": [x,y], "reason_box": [x,y], "submit_btn": [x,y]}
提取发票信息:发票代码、发票号码、开票日期、金额(含税)、销方名称、购方名称、项目名称。返回JSON。
| 模型 | 免费政策 | GUI 坐标 | 发票提取 | 易用性 | 适合场景 |
|---|---|---|---|---|---|
| GLM-4.6V-Flash | 永久免费 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | 通用 RPA + 发票 |
| UI-TARS | 开源免费 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | 纯 GUI 自动化 |
| Qwen3.5-VL | 免费额度 + 低价 | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | 生产级稳定 |
| CogAgent | 开源 + 免费推理 | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | 复杂 GUI |
# 示例脚本(直接运行)
xdotool mousemove 500 300 click 1 # 点击金额框
xdotool type "1234.56" # 输入金额
xdotool mousemove 500 400 click 1 # 点击事由框
xdotool type "差旅费报销" # 输入事由
xdotool mousemove 800 600 click 1 # 提交
# 安装SDK
pip install zhipuai
# 测试代码
from zhipuai import ZhipuAI
client = ZhipuAI(api_key="你的sk-xxxxxx")
response = client.chat.completions.create(model="glm-4.6v-flash", messages=[{"role":"user","content":"你好"}])
print(response.choices[0].message.content)
image_url,且缺少流式输出配置。以下是直接可用的修正方案:| 问题 | 正确写法 | 原因 |
|---|---|---|
| 视频类型 | 用video_url 而非 image_url | GLM-4.6V-Flash 视频识别专用字段 |
| 流式输出 | 加 "stream": true | 实时返回结果,不会一直卡死 |
| 思考模式 | "thinking": {"type": "disabled"} | 完全正确,禁用思考可提速30%+ |
| 数据结构 | content 必须是数组 | 即使只有一条内容也要用[] |
curl -X POST https://open.bigmodel.cn/api/paas/v4/chat/completions \
-H "Authorization: Bearer 你的API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.6v-flash",
"messages": [
{
"role": "user",
"content": [
{
"type": "video_url", // 重点:改成video_url
"video_url": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "总结一下这个视频的主要内容和特点,限制200字以内。"
}
]
}
],
"thinking": { "type": "disabled" }, // 禁用思考,提速
"stream": true, // 开启流式,实时看结果
"temperature": 0.1 // 降低随机性,保证准确
}'
stream: true后,返回的是SSE流(一行一行的JSON),终端不会一次性输出完整内容,而是逐字返回。如果你用 Python 脚本,推荐用这个代码(实时打印):import requests
import json
url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"
headers = {
"Authorization": "Bearer 你的API Key",
"Content-Type": "application/json"
}
data = {
"model": "glm-4.6v-flash",
"messages": [{
"role": "user",
"content": [{
"type": "video_url",
"video_url": {"url": "http://www.staroceans.net/video/wechat/2084.mp4"}
}, {"type": "text", "text": "总结视频内容,200字内"}]
}],
"stream": True,
"thinking": {"type": "disabled"}
}
# 流式请求
with requests.post(url, headers=headers, json=data, stream=True) as r:
for line in r.iter_lines():
if line:
line_json = json.loads(line.decode("utf-8"))
content = line_json["choices"][0]["delta"].get("content", "")
print(content, end="", flush=True)
thinking: disabledmax_tokens(比如设200),减少生成长度image_url字段,但视频任务不支持该字段,改成video_url后即可解决。| 维度 | GLM-4.6V-Flash (你现在用) | GLM-4.6V (非 Flash) |
|---|---|---|
| 价格 | ✅ 永久免费 (无限额度) | ❌ 付费 (约 ¥2/1k tokens,极贵) |
| 限流情况 | 偶尔高峰报1305,加重试即可用 | 非免费时段服务器压力更大,更易报1305 |
| 视频能力 | ✅ 支持视频识别 | ✅ 支持,但付费成本高 |
| 适合场景 | RPA测试、个人自动化、练手 | 企业级生产,不在乎成本 |
"该模型当前访问量过大"这是服务器级别的限流,不是你账号的问题。
# 循环重试 5 次,每次间隔 3 秒
for i in {1..5}; do
echo "尝试第 $i 次..."
curl -X POST https://open.bigmodel.cn/api/paas/v4/chat/completions \
-H "Authorization: Bearer 你的API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.6v-flash",
"messages": [
{
"role": "user",
"content": [
{ "type": "video_url", "video_url": {"url": "你的视频链接"} },
{ "type": "text", "text": "总结视频内容,限制200字以内。" }
]
}
],
"thinking": {"type": "disabled"},
"stream": true
}' && break || sleep 3; done
import requests
import time
def call_zhipu_api(url, headers, data, max_retries=5):
for attempt in range(max_retries):
try:
with requests.post(url, headers=headers, json=data, stream=True, timeout=60) as r:
if r.status_code == 200:
for line in r.iter_lines():
if line:
line_json = json.loads(line.decode("utf-8"))
content = line_json["choices"][0]["delta"].get("content", "")
print(content, end="", flush=True)
return True
else:
print(f"失败 {attempt+1}/{max_retries},状态码: {r.status_code}")
except Exception as e:
print(f"异常 {attempt+1}/{max_retries}:{e}")
time.sleep(3) # 重试前等待3秒
print("最大重试次数已达,失败")
return False
# 配置
api_url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"
headers = {"Authorization": "Bearer 你的Key", "Content-Type": "application/json"}
payload = {
"model": "glm-4.6v-flash",
"messages": [{
"role": "user",
"content": [{"type": "video_url", "video_url": {"url": "链接"}}, {"type": "text", "text": "总结"}]
}],
"thinking": {"type": "disabled"},
"stream": True
}
# 执行
call_zhipu_api(api_url, headers, payload)
doubao-pro (免费额度足够 RPA 测试)"video_url",但智谱 API 要求的是 video_url(这个是对的),但你后面的键名写成了 "video url"(中间多了空格),这是语法错误。"video_url": { "url": "..." },不能有空格。"streaming": true,智谱 API 要求的是 "stream": true。true,不能写 True(Python 写法),JSON 只认小写。",不能用单引号。curl -X POST \
https://open.bigmodel.cn/api/paas/v4/chat/completions \
-H "Authorization: Bearer 你的API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.6v-flash",
"messages": [
{
"role": "user",
"content": [
{
"type": "video_url",
"video_url": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "总结一下这个视频的主要内容和特点,限制200汉字以内。"
}
]
}
],
"thinking": {
"type": "disabled"
},
"stream": true
}'
| 错误写法 | 正确写法 | 原因 |
|---|---|---|
"video url": { ... } | "video_url": { ... } | JSON 键名不能有空格,必须和 API 文档一致 |
"streaming": True | "stream": true | 字段名是 stream,布尔值必须小写 |
| 单引号/未闭合引号 | 全部用双引号 " | JSON 语法要求字符串必须用双引号包裹 |
for i in {1..5} 写法)。video_url 写成纯文本,这是它的通病。curl -X POST https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "Authorization: Bearer 你的豆包API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-pro-vision",
"messages": [
{
"role": "user",
"content": [
{
"type": "video",
"video": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "总结这个视频的主要内容和特点,限制200汉字以内。"
}
]
}
],
"stream": true,
"temperature": 0.1
}'
| 特性 | 豆包 (doubao-pro-vision) | 智谱 GLM-4.6V-Flash |
|---|---|---|
| 视频字段名 | "type": "video", "video": {"url": "..."} | "type": "video_url", "video_url": {"url": "..."} |
| 流式字段 | "stream": true | "stream": true |
| 免费额度 | 每日免费调用次数充足 | 永久免费,但高峰限流严重 |
| 格式稳定性 | 输出格式严格,极少编造参数 | 经常简化/写错字段,需要反复修正 |
{
"amount_box": [500, 300],
"reason_box": [500, 400],
"submit_btn": [800, 600],
"amount": "1234.56",
"reason": "差旅费报销"
}
✅ 实名认证要求:
- 上传身份证正反面 + 人脸核验
- 全程约1分钟,免费,完成后立即生效
rpa-test),确认后就会生成:sk-xxxxxxxxxxxxcurl -X POST https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "Authorization: Bearer 你的API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-pro",
"messages": [{"role":"user","content":"你好"}]
}'
doubao.com/settings),这里没有实名认证和 API 密钥管理入口。要拿 API Key,必须去 豆包开放平台(云雀),而不是普通聊天页。rpa-test),确认后生成 sk-xxxxxx 格式的 Keyhttps://www.doubao.com/open/ 登录,我可以一步步带你点到实名认证和密钥页面。要不要我帮你整理一份开放平台页面的点击路径,你照着点就能找到?doubao.com/open/ 已经下线了,现在豆包的开发者平台已经迁移到 字节跳动云雀(Volcengine Ark),这是最新的入口:rpa-test)sk-xxxxxx,只显示一次)curl -X POST https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "Authorization: Bearer 你的API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-pro-vision",
"messages": [
{
"role": "user",
"content": [
{
"type": "video",
"video": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "总结这个视频的主要内容,限制200字以内。"
}
]
}
],
"stream": true
}'
doubao.com/open/ 入口已经下线,现在所有 API 调用都走云雀平台。https://ark.cn-beijing.volces.com/ 登录,我可以帮你一步步点到实名认证和密钥页面。要不要我帮你整理一份云雀平台的点击路径截图指引,让你一眼找到入口?ark.cn-beijing.volces.com 域名拼写有误,正确地址是:👉 https://ark.cn-beijing.volces.com/volces,不是 voices,少了一个 e)rpa-test),生成后复制保存(格式为 sk-xxxxxx,只显示一次)。AuthN.MissOrInvalidAuthorizationHeader 是因为:Authorization: Bearer {API Key} 请求头。https://ark.cn-beijing.volces.com/,我可以一步步带你点到实名认证和密钥页面。要不要我先给你一份讯飞星火 Lite 的 API 调用示例,你可以先测试视频总结功能?doubao-pro-vision 模型。rpa-test)。sk-xxxxxx,只显示一次,务必妥善保管)。ark.cn-beijing.volces.com 是API调用地址,不是注册页,直接在浏览器打开会报 AuthN 错误,因为它需要程序携带API Key才能访问。glm-4.6v-flash 模型,永久免费,完全满足你的RPA需求console.volcengine.com),这就是字节的云服务主平台,「火山方舟」就在这里面。doubao-pro-vision(多模态模型,支持视频/图片)sk-xxxxxx 格式的 Key视频 / 多模态 / Doubao找到 Doubao-Seed-2.0-pro 或 GLM-4V-0520doubao-seed-2.0-pro 即可测试视频总结type:必须写 "video""video"(不是 video_url,也不是 input_video)"video": { "url": "你的视频公网链接" }curl -X POST https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "Authorization: Bearer 你的API Key" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seed-2.0-pro",
"messages": [
{
"role": "user",
"content": [
{
"type": "video",
"video": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "总结这个视频的主要内容和特点,限制200汉字以内。"
}
]
}
],
"stream": true,
"temperature": 0.1
}'
type 不能错:"type": "image" + "image": { "url": "..." }"type": "video" + "video": { "url": "..." }"stream": true 可以实时看到返回结果,避免长时间等待"model" 改成 "glm-4v-0520" 即可,格式完全一样| 错误写法 | 正确写法 |
|---|---|
"type": "image_url" | "type": "video" |
"video_url": { ... } | "video": { ... } |
"streaming": True | "stream": true |
input_image/input_text),这是给你在网页上点按钮测试用的,不是真实 API 调用的格式。type: "input_image" + image_urltype: "input_text"→ 这是火山方舟为了方便你在页面上点选上传,做的简化展示,不是发给 API 的真实结构。type: "image" + image: { "url": "..." }type: "video" + video: { "url": "..." }type: "text"→ 这是符合 OpenAI 兼容规范的标准格式,也是你用 curl/Python 调用时必须写的格式。input_image ≠ API 里的 imageinput_text ≠ API 里的 textinput_image 转成 API 能识别的 image 格式发给模型。{
"model": "doubao-seed-2-0-pro-26021s",
"messages": [
{
"role": "user",
"content": [
{
"type": "video",
"video": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "总结这个视频的主要内容,限制200字以内。"
}
]
}
],
"stream": true
}
input_image/input_text。type: "image"/type: "text" 的标准格式。type: "image"/type: "text",而不是 input_image。messages,不是 input。"input": [...]"messages": [...]/api/v3/responses,这个接口要求的是 input 结构;/api/v3/chat/completions,并使用 messages 结构。",不能有语法残缺(比如少闭合括号)。true/false,不能写 True。curl -X POST https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seed-2-0-pro-26021s",
"messages": [
{
"role": "user",
"content": [
{
"type": "video",
"video": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "能不能把这个视频的主要内容总结一下,必须使用中文,大概两百字以内。"
}
]
}
],
"stream": true
}'
http://www.staroceans.net/video/wechat/2084.mp4 里没有特殊字符(比如空格、&、?),不需要转义,直接写就行。%20 等方式编码,你的场景完全不用。"input" 改成 "messages""model": "doubao-seed-2-0-pro-26021s" 顶层字段/api/v3/responses 是火山方舟旧版接口,这个接口:video 类型(只认 image/text);/api/v3/chat/completions 完全不同;image,格式也不是 video: {url: ...},而是 image_url: {url: ...}。/api/v3/chat/completions,且:messages 而非 input;curl https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "" \
-H 'Content-Type: application/json' \
-d@/tmp/doubao_fixed.json
/tmp/doubao_fixed.json 内容(替换原文件){
"model": "doubao-seed-2-0-pro-260215",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url", // 先改用image_url(旧接口通用格式,视频也可兼容)
"image_url": {
"url": "http://www.staroceans.net/video/wechat/2084.mp4"
}
},
{
"type": "text",
"text": "能不能把这个视频的主要内容总结一下,必须使用中文,大概两百字左右。"
}
]
}
],
"stream": false // 关闭流式,先确保能拿到完整响应
}
/api/v3/responses 是调试接口,仅支持基础文本 / 图片,/api/v3/chat/completions 是正式多模态接口;image_url(而非 video),模型会自动识别链接是视频并解析;messages 是 OpenAI 标准字段,input 仅适用于旧版调试接口;stream: false,避免流式返回的解析问题,测试通了再开。image_url 为图片地址:"url": "https://img-blog.csdnimg.cn/20240101000001.jpg",若能返回结果,说明模型 / Key 正常,仅视频解析需稍等平台适配。/api/v3/responses,且用了不兼容的 video 类型 + input 字段;/api/v3/chat/completions,字段改用 messages + image_url;image_url 兼容解析)。unknown type: video 错误。audio 或 audio_url 类型(具体以模型文档为准)。doubao-seed-2-0-pro 为例,音频的正确 JSON 格式如下:{
"model": "doubao-seed-2-0-pro-260215",
"messages": [
{
"role": "user",
"content": [
{
"type": "audio_url", // 音频专用类型
"audio_url": {
"url": "http://your-domain.com/audio/test.mp3"
}
},
{
"type": "text",
"text": "请把这段音频的内容转成文字,并总结主要观点。"
}
]
}
],
"stream": false
}
| 类型 | 大小上限 | 支持格式 | 备注 |
|---|---|---|---|
| 视频 | 10MB | MP4、MOV、AVI 等 | 超过 10MB 会直接报错 |
| 音频 | 10MB | MP3、WAV、AAC、FLAC | 部分模型支持更长时长,但大小仍受 10MB 限制 |
| 图片 | 10MB | JPG、PNG、WebP 等 | 无时长限制,仅看文件大小 |
ffmpeg 命令示例:ffmpeg -i input.mp4 -vf "scale=640:480" -b:v 500k -r 15 output.mp4
ffmpeg 提取音频命令:ffmpeg -i input.mp4 -vn -acodec libmp3lame -q:a 4 output.mp3
type: "input_audio",但对应的字段名必须是 input_audio(而非 audio_url);audio_url 是 OpenAI 兼容格式,火山方舟自研接口要求用 input_audio 作为键名。/tmp/doubao_fix.json){
"model": "doubao-seed-2-0-pro-260215",
"messages": [
{
"role": "user",
"content": [
{
"type": "input_audio", // 类型和键名必须一致
"input_audio": { // 替换 audio_url 为 input_audio
"url": "http://www.staroceans.net/video/wechat/mp3/2084.mp3"
}
},
{
"type": "text",
"text": "能不能把这个音频的主要内容总结一下,必须使用中文,大概两百字左右。"
}
]
}
],
"stream": false
}
curl https://ark.cn-beijing.volces.com/api/v3/chat/completions \
-H "" \
-H 'Content-Type: application/json' \
-d@/tmp/doubao_fix.json
| 类型值(type) | 对应键名 | 用途 |
|---|---|---|
input_text | input_text | 文本输入 |
input_image | input_image | 图片输入 |
input_audio | input_audio | 音频输入(核心!) |
input_video | input_video | 视频输入(若支持) |
doubao-seed-2-0-pro-260215 支持音频解析(若仍报错,换 doubao-pro-vision 模型测试)。type: "input_audio" 但键名用了 audio_url,字段不匹配导致参数缺失;audio_url 改为 input_audio,保持 type 和键名一致;MissingParameter 错误,能顺利拿到音频总结的响应。