Files
docker-configs/simple-gemini-proxy/QUICKSTART.md
2025-07-23 00:00:01 -05:00

66 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.

# 快速开始指南
## 1分钟快速部署
### 第一步获取API密钥
访问 [Google AI Studio](https://ai.google.dev) 并创建免费的Gemini API密钥
### 第二步:启动服务
```bash
cd /home/will/docker/simple-gemini-proxy
docker compose up -d
```
### 第三步:测试服务
用你的API密钥替换 `YOUR_API_KEY` 后运行:
```bash
# 基本测试
curl http://localhost:8081/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}]
}'
```
### 使用我们的测试脚本
```bash
./test-api.sh YOUR_API_KEY
```
## 服务信息
- **服务地址**: http://localhost:8081
- **OpenAI API兼容端点**: http://localhost:8081/v1/chat/completions
- **容器名称**: simple-gemini-proxy
- **镜像**: zhu327/gemini-openai-proxy:latest
## 常用命令
```bash
# 查看服务状态
docker compose ps
# 查看日志
docker compose logs -f
# 停止服务
docker compose down
# 重启服务
docker compose restart
```
## 支持的模型映射
| OpenAI模型 | Gemini模型 |
|------------|------------|
| gpt-3.5-turbo | gemini-1.5-flash-latest |
| gpt-4 | gemini-1.5-pro-latest |
| gpt-4-vision-preview | gemini-1.5-flash-latest |
## 就这么简单!
这个代理现在可以接受任何OpenAI API格式的请求并将其转发给Google Gemini API。无需数据库无需复杂配置完全即插即用