fix: 修复RMBG API密钥请求头格式 - 使用X-API-Key而不是Authorization Bearer
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2025-12-29 00:08:38 +08:00
parent 2b573e20b4
commit 997afdd694

View File

@ -181,11 +181,9 @@ export async function POST(request: NextRequest) {
"Content-Type": "application/json",
};
// 如果配置了API Key,添加到请求头
// 如果配置了API Key,添加到请求头(根据RMBG API文档要求使用X-API-Key)
if (config.apiKey) {
headers["Authorization"] = `Bearer ${config.apiKey}`;
// 或者根据API文档要求添加,例如:
// headers["X-API-Key"] = config.apiKey;
headers["X-API-Key"] = config.apiKey;
}
const startTime = Date.now();