GitHub Issue

Failed to write chapter: Error: API 返回 401 (未授权)。请检查 .env 中的 INKOS_LLM_API_KEY 是否正确

Discovered On Mar 20, 2026
Primary Metric open
inkos doctor 正常 ``` [OK] Node.js >= 20: v24.13.0 [OK] inkos.json: Found [OK] .env: Found [OK] Global Config: Found (/Users/jayrome/.inkos/.env) [OK] LLM API Key: Configured [OK] Books: 1 book(s) found [OK] LLM Config: provider=openai model=qwen3.5-plus stream=true baseUrl=https://dashscope.aliyuncs.com/compatible-mode/v1 [OK] API Connectivity: OK (model: qwen3.5-plus, tokens: 0) ``` 但是用inkos write next的时候就报错: ``` INFO [writer] Phase 1: creative writing for chapter 1 [ERROR] Failed to write chapter: Error: API 返回 401 (未授权)。请检查 .env 中的 INKOS_LLM_API_KEY 是否正确。 (baseUrl: https://dashscope.aliyuncs.com/compatible-mode/v1, model: qwen3.5-plus) ``` 检查了.env 也有数据,不知道什么参数没有补齐?
View Raw Thread

Developer & User Discourse

JayRong • Mar 20, 2026
nkos config show-global 能看到配置如下:
```
(base) jayrome@MacBookPro my-xhnovel % inkos config show-global
# InkOS Global LLM Configuration
INKOS_LLM_PROVIDER=openai
INKOS_LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
INKOS_LLM_API_KEY=sk-d0409xxxxxxxxx
INKOS_LLM_MODEL=qwen3.5-plus
```
JayRong • Mar 20, 2026
nkos config show-global 能看到配置如下:
```
(base) jayrome@MacBookPro my-xhnovel % inkos config show-global
# InkOS Global LLM Configuration
INKOS_LLM_PROVIDER=openai
INKOS_LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
INKOS_LLM_API_KEY=sk-d0409xxxxxxxxx
INKOS_LLM_MODEL=qwen3.5-plus
```
YouJin-Li • Mar 20, 2026
检查一下API_KEY是否正确,一般就是key有问题,你可以让豆包或者deepseek帮你写个测试脚本,测试一下
JayRong • Mar 21, 2026
> 检查一下API_KEY是否正确,一般就是key有问题,你可以让豆包或者deepseek帮你写个测试脚本,测试一下

doctor跑出来结果是正常的
tsgqjxhn • Mar 22, 2026
我是设置全局模型之后设置的专门模型,就这样报错,删了专用模型就好了