model not allowed: bailian-coding/Qwen3.5-35B-A3B-free
错误信息
Failed to set model: GatewayRequestError: model not allowed: bailian-coding/Qwen3.5-35B-A3B-free
AI 解决方案
报错分析报告
1.错误翻译
原文:model not allowed: bailian-coding/Qwen3.5-35B-A3B-free
译文:模型不被允许:bailian-coding/Qwen3.5-35B-A3B-free
2.原因分析
bailian-coding/Qwen3.5-35B-A3B-free未纳入DMXAPI平台的授权模型列表。 set model或模型初始化逻辑时,传入了平台禁止的模型标识。3.解决方案
# 修复后的代码:替换为DMXAPI允许的模型(示例为官方推荐模型,需以实际文档为准)
from dmxapi import ChatCompletion
# 1. 先查询平台允许的模型列表(可选但推荐)
allowed_models = ["qwen-3.5-32b", "gpt-3.5-turbo", "claude-3-haiku"] # 实际需替换为DMXAPI返回的列表
# 2. 使用允许的模型发起请求
response = ChatCompletion.create(
model=allowed_models[0], # 选一个允许的模型
messages=[{"role": "user", "content": "你的输入"}]
)
关键步骤:
bailian-coding/Qwen3.5-35B-A3B-free替换为列表内的模型标识。4. 预防措施
GET /v1/models API校验模型合法性(避免硬编码无效模型); ---
注:所有模型标识以DMXAPI最新文档为准,避免使用未授权的第三方模型别名。