finyx_data_ai/QUICK_START.md
2026-01-11 07:48:19 +08:00

80 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 快速配置硅基流动 API Key
## 📝 配置步骤
### 1. 确认 API Key 已添加到 .env 文件
**重要**: 请确保编辑的是 `.env` 文件(不是 `.env.example`
检查当前配置:
```bash
grep "^SILICONFLOW_API_KEY=" .env
```
如果显示 `SILICONFLOW_API_KEY=`(等号后面为空),则需要添加。
### 2. 编辑 .env 文件
```bash
nano .env
```
找到这一行:
```bash
SILICONFLOW_API_KEY=
```
修改为(替换为您实际的 API Key
```bash
SILICONFLOW_API_KEY=sk-xxxxxxxxxxxxx
```
**注意**:
- 等号后面直接写 API Key不要有引号
- 不要有空格
- 保存文件
### 3. 使用配置助手验证
```bash
./configure_siliconflow.sh
```
### 4. 重启服务
```bash
./restart_service.sh
```
### 5. 测试接口
```bash
./test_siliconflow.sh
```
## ✅ 快速检查清单
- [ ] 已在 `.env` 文件中添加 `SILICONFLOW_API_KEY=您的API密钥`
- [ ] 已保存 `.env` 文件
- [ ] 已运行 `./configure_siliconflow.sh` 验证配置
- [ ] 已运行 `./restart_service.sh` 重启服务
- [ ] 已运行 `./test_siliconflow.sh` 测试接口
## 🆘 如果遇到问题
1. **API Key 未配置错误**:
- 确认编辑的是 `.env` 文件
- 确认 API Key 已正确填写
- 确认已保存文件
- 运行 `./configure_siliconflow.sh` 验证
2. **401 Unauthorized 错误**:
- 检查 API Key 是否正确
- 检查 API Key 是否过期
- 确认账号余额充足
3. **服务启动失败**:
- 检查日志: `tail -f server.log`
- 确认端口 8000 未被占用