Files
proxycast/docs/content/01.introduction/3.quickstart.md
T

117 lines
2.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.
---
title: 快速开始
description: 5 分钟内完成首次 API 调用
navigation:
icon: i-heroicons-rocket-launch
---
# 快速开始
本指南帮助你在 5 分钟内完成 ProxyCast 的基本配置和首次 API 调用。
## 前置准备
确保你已经:
- [x] 安装了 ProxyCast
- [x] 拥有至少一个 AI 客户端的有效订阅(Kiro、Gemini CLI、Qwen 等)
## 步骤 1: 启动 ProxyCast
1. 启动 ProxyCast 应用
2. 主窗口会显示仪表盘界面
## 步骤 2: 加载凭证
ProxyCast 会自动检测本地的 AI 客户端凭证文件。
### 凭证文件位置
| Provider | 凭证路径 |
|----------|----------|
| Kiro Claude | `~/.kiro/credentials.json` |
| Gemini CLI | `~/.config/gemini-cli/oauth_creds.json` |
| Qwen | `~/.config/qwen/credentials.json` |
### 手动添加凭证
如果自动检测未找到凭证:
1. 进入 **凭证池** 页面
2. 点击 **添加凭证**
3. 选择 Provider 类型
4. 输入凭证信息或选择凭证文件
## 步骤 3: 启动 API Server
1. 在仪表盘点击 **启动服务**
2. 服务状态变为"运行中"
3. 记下 API 地址(默认 `http://127.0.0.1:8999`)
## 步骤 4: 测试 API
### 使用内置测试面板
1. 在仪表盘找到 **API 测试** 区域
2. 输入测试消息
3. 点击发送,查看响应
### 使用 curl 测试
**OpenAI 格式:**
```bash
curl http://127.0.0.1:8999/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"model": "claude-sonnet-4-20250514",
"messages": [{"role": "user", "content": "Hello!"}]
}'
```
**Claude 格式:**
```bash
curl http://127.0.0.1:8999/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key" \
-H "anthropic-version: 2023-06-01" \
-d '{
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello!"}]
}'
```
## 步骤 5: 集成到其他工具
### Cursor 配置
在 Cursor 设置中配置 OpenAI API:
- API Base URL: `http://127.0.0.1:8999/v1`
- API Key: 你在 ProxyCast 中设置的 API Key
### Continue 配置
编辑 `~/.continue/config.json`:
```json
{
"models": [{
"title": "ProxyCast Claude",
"provider": "openai",
"model": "claude-sonnet-4-20250514",
"apiBase": "http://127.0.0.1:8999/v1",
"apiKey": "your-api-key"
}]
}
```
## 下一步
- [仪表盘](/user-guide/dashboard) - 了解仪表盘功能
- [凭证池](/user-guide/credential-pool) - 管理多个凭证
- [智能路由](/user-guide/smart-routing) - 配置请求路由规则