In the Coze workflow, if 'invalid character' is reported<' looking for beginning of value`,很多人第一反应是模型坏了,其实大概率不是。公开 issue 里,这种错误通常意味着接口本来应该返回 JSON,结果却返回了一个网页,比如 404 页面、登录页,或者反向代理吐出来的 HTML。换句话说,程序在等数据,却收到了网页。
If you're looking at the official open source version, the repository address is still coze-dev/coze-studio. The official README and development notes emphasize that model configurations, API entries, and workflow execution environments need to be aligned first, or they will be most likely to explode at runtime.
Why this error is very similar to a "model problem"
Because it often occurs when a workflow node is running, and the node happens to be calling a model or external interface. But the real error keyword is ''<`',这说明返回内容开头是 HTML 标签而不是 JSON。也就是说,你要查的不是“模型会不会说话”,而是“接口到底回了什么”。
The most common reasons
- The Base URL is mismatched, and the interface actually hits the web page instead of the API.
- The path is missing '/v1' or an additional layer of proxy, causing the request to be forwarded to the wrong address.
- The gateway or Nginx returns an error page, but the frontend parses it as an interface response.
Commonly used investigation methods in the community
The most effective way is not to guess, but to look directly at the real response. You can use 'curl' or the browser web panel to check if the interface returns JSON. If it is HTML from the beginning, the problem is basically locked in the address, proxy, and authentication jump. In the open issue, someone has encountered a similar situation, and finally found out that the request path of the third-party OpenAPI was mismatched, or the proxy layer returned the web page content.
If you are building a workflow step by step, it is recommended to first use an interface that confirms that there is no problem to do a minimum test, and then slowly add other nodes back. This way, once an error is reported, you can quickly know which layer turned JSON into HTML.
One sentence conclusion
invalid character '<' 不是“模型语法错误”,而是接口响应不对。先查地址、代理和返回内容,往往比改工作流节点更快。