[API-Inference] GLM-5.3-Flash returns HTTP 401 while Qwen3.8-Flash-Next works with the same token

未关闭
#1,850 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
api, backend

调研方向

Start by checking ModelScope's API-Inference model registry and the routing or authorization configuration for ZhipuAI/GLM-5.3-Flash; the issue gives no repository files or tests to begin from. Compare its /v1/models visibility and request handling with ZhipuAI/GLM-4.7-Flash or Qwen/Qwen3.8-Flash-Next. Done means the model works with a valid token, or requests return an accurate availability or permission error.

由索引模型根据 Issue 内容生成。

描述

Environment
  • Windows 11
  • Python 3.13.18 (managed by uv)
  • OpenAI Python SDK 3.49.0
  • ModelScope OpenAI-compatible API: https://api-inference.modelscope.cn/v1
Description

Calling ZhipuAI/GLM-5.3-Flash through the OpenAI-compatible /v1/chat/completions endpoint returns HTTP 401 ("Authentication failed, please make sure that a valid ModelScope token is supplied"), while Qwen/Qwen3.8-Flash-Next works normally with the same token, same base URL, same SDK, and same request structure.

The token itself is valid: GET /v1/models returns HTTP 200 with the same credential. Qwen/Qwen3.8-Flash-Next appears in the /v1/models list, but ZhipuAI/GLM-5.3-Flash does not (the list does contain ZhipuAI/GLM-4.7-Flash and ZhipuAI/GLM-5.2).

The 401 also occurs on plain text requests without any image input, so this is not related to multimodal content.

Steps to Reproduce
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api-inference.modelscope.cn/v1",
    api_key=os.environ["MODELSCOPE_API_TOKEN"],  # valid token, redacted here
)

try:
    response = client.chat.completions.create(
        model="ZhipuAI/GLM-5.3-Flash",
        messages=[{
            "role": "user",
            "content": [{"type": "text", "text": "输出 测试成功"}],
        }],
        stream=True,
    )
    for chunk in response:
        if chunk.choices and chunk.choices[0].delta.content:
            print(chunk.choices[0].delta.content, end="", flush=True)
except Exception as e:
    print(type(e).__name__, str(e))
    if getattr(e, "response", None):
        print("HTTP:", e.response.status_code)
        print("Response:", e.response.text)

The same script with model="Qwen/Qwen3.8-Flash-Next" completes successfully and outputs 测试成功.

Model list check (same token):

HTTP/1.1 200 OK
"Qwen/Qwen3.8-Flash-Next" present: True
"ZhipuAI/GLM-5.3-Flash" present: False
Expected Behavior

ZhipuAI/GLM-5.3-Flash should respond normally through API-Inference. If the model is not (yet) supported by API-Inference or requires extra authorization, the API should return a clear, accurate error indicating model availability or permission — not a generic token authentication failure, which is misleading because the same token authenticates fine everywhere else.

Actual Behavior

HTTP 401 on every request to ZhipuAI/GLM-5.3-Flash, including plain text, no images:

AuthenticationError Error code: 401 - Authentication failed, please make sure that a valid ModelScope token is supplied.
HTTP: 401
Response: {"error":{"message":"Authentication failed, please make sure that a valid ModelScope token is supplied.","request_id":"be80f8b6-21d7-4409-b140-a08a26127d98"},"request_id":"8aac6103-d4d4-4ffb-ad4f-d6cbf2374170"}
Comparison
Model Listed in /v1/models Chat Completion
Qwen/Qwen3.8-Flash-Next Yes Success
ZhipuAI/GLM-5.3-Flash No HTTP 401
Related Issue

#1832 previously reported that GLM-5.3-Flash on API-Inference intermittently returns "lock" in the output stream. That issue describes a different symptom (garbled stream content, requests otherwise succeed) from this one (requests are rejected outright with HTTP 401), so I am not claiming they share a root cause — but both suggest something may be off with the GLM-5.3-Flash deployment on API-Inference.

Questions
  1. Is ZhipuAI/GLM-5.3-Flash officially supported by ModelScope API-Inference?
  2. Why is this model absent from the /v1/models response?
  3. Does it require additional access authorization that is not documented?
  4. Why does it return HTTP 401 ("invalid token") when the same token successfully accesses Qwen/Qwen3.8-Flash-Next?
  5. Is there an issue with the model's deployment, routing, or authentication configuration on the API-Inference side?
主要语言
Python
星标
9.2k
派生
977
平均合并
4 天 5 小时
30 天内合并 PR
10

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelscope/modelscope 的其他 Issue

查看 modelscope/modelscope 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。