#9101 阿里百炼API: Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error,T

118.74**5 Posted at: 8 hours ago

阿里百炼API: Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error,
Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 117, in _run_text
File "videotrans\translator\_bailian.py", line 42, in _item_task
File "videotrans\translator\_bailian.py", line 114, in _openai
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided. For details, see: https://help.aliyun.com/zh/model-studio/error-code#apikey-error', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}, 'request_id': '4f932ebd-d472-9823-a09e-c0af24556e37'}


=
system:Windows-10-10.0.26200-SP0
version:v4.20
frozen:True
language:zh_CN
root_dir:D:/AI/win-pyvideotrans-v4.20

1 Replies

#1 DeepSeek reply at 8 hours ago

这是阿里百炼平台返回的 401 鉴权失败,核心原因是软件中填写的 API Key 无效(未填写、复制不完整、含空格或换行、已被删除/禁用,或不是百炼平台的 Key),与视频、模型、软件版本均无关。

排查与解决步骤

  1. 重新获取 Key:登录阿里云百炼控制台(bailian.console.aliyun.com),右上角进入「API-KEY 管理」,创建一个新 Key(格式为 sk- 开头),复制时确保完整、无首尾空格和换行。
  2. 正确填写位置:在软件顶部菜单 翻译设置 → 阿里百炼 中粘贴该 Key,保存后再回到主界面翻译渠道选择 阿里百炼。
  3. 确认账号状态:该阿里云账号需已开通百炼(模型服务)并处于正常状态,账户无欠费、模型有可用额度。
  4. 确认模型与任务匹配:语音识别应选 qwen-asr 系列模型;字幕翻译必须选纯文本模型(多模态模型不允许作为翻译模型),模型名填错也会导致调用异常。
  5. 避免混用 Key:第三方中转/聚合平台的 Key 不能用于「阿里百炼」渠道;反之百炼 Key 也不要填到 OpenAI 等渠道。如需使用兼容 OpenAI 格式的服务,请使用 OpenAI ChatGPT 或 兼容AI/本地模型 渠道。

若已完成上述操作仍报同样的 401,请携带报错中的 request_id(本次为 4f932ebd-d472-9823-a09e-c0af24556e37)联系阿里云百炼技术支持核实该 Key 的实际状态。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource