> ## Documentation Index
> Fetch the complete documentation index at: https://ai-gateway.juniortree.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 快速开始

> 5分钟部署您的第一个AI Gateway实例

## 三步快速部署

在5分钟内完成AI Gateway的部署和配置，开始使用多AI平台统一接口。

### 步骤1: 环境准备

<AccordionGroup>
  <Accordion icon="server" title="系统要求">
    * Python 3.12+
    * Docker (可选，推荐)
    * 至少1GB可用内存
    * 网络连接（用于访问AI平台API）

    <Tip>推荐使用Docker部署，可以避免环境依赖问题</Tip>
  </Accordion>

  <Accordion icon="download" title="获取代码">
    克隆AI Gateway项目到本地：

    ```bash theme={null}
    git clone https://github.com/PancrePal-xiaoyibao/PancrePal-xiaoyibao.git
    cd PancrePal-xiaoyibao
    ```
  </Accordion>
</AccordionGroup>

### 步骤2: 配置AI平台

<AccordionGroup>
  <Accordion icon="key" title="配置API密钥">
    创建 `.env` 文件并配置至少一个AI平台的API密钥：

    ```bash theme={null}
    cp .env.example .env
    ```

    <Warning>请确保API密钥的安全性，不要将其提交到版本控制系统</Warning>
  </Accordion>

  <Accordion icon="folder" title="文件存储配置（可选）">
    如果后端的 Agent 需要文件上传功能，配置S3或MinIO：

    ```bash theme={null}
    S3_ENDPOINT=https://your-s3-endpoint.com
    S3_ACCESS_KEY=your-access-key
    S3_SECRET_KEY=your-secret-key
    S3_BUCKET=your-bucket-name
    ```
  </Accordion>
</AccordionGroup>

### 步骤3: 启动服务

<AccordionGroup>
  <Accordion icon="docker" title="Docker部署（推荐）">
    使用Docker快速部署：
    您可以使用我们的预构建镜像，您需要修改docker-compose.yml文件中的环境变量，并启动服务：

    ```bash theme={null}
    docker compose up -d
    ```

    <Check>服务启动后，访问 [http://localhost:8000](http://localhost:8000) 查看API文档</Check>
  </Accordion>

  <Accordion icon="terminal" title="本地部署">
    在本地环境直接运行：

    ```bash theme={null}
    # 安装依赖
    uv pip install -r requirements.txt

    # 启动服务
    make run
    ```
  </Accordion>
</AccordionGroup>

## 测试部署

### 验证服务状态

```bash theme={null}
# 检查服务健康状态
curl http://localhost:3000/health

# 查看支持的Agent列表
curl http://localhost:3000/api/v1/agents
```

### 测试聊天功能

```bash theme={null}
# 使用FastGPT进行测试
curl -X POST 'http://localhost:3000/api/v1/chat' \
  -H 'Content-Type: application/json' \
  -H 'agent: fastgpt' \
  -d '{
    "query": "你好，请介绍一下AI Gateway",
    "user": "test_user",
    "stream": false
  }'
```

<Check>
  如果看到正常的JSON响应，说明AI Gateway已经成功部署并正常工作！
</Check>

## 下一步

现在您已经成功部署了AI Gateway，可以开始探索更多功能：

<CardGroup cols={2}>
  <Card title="支持的平台" icon="list" href="/essentials/supported-platforms">
    了解AI Gateway支持的所有AI平台及其特性
  </Card>

  <Card title="API文档" icon="terminal" href="/api-reference/introduction">
    查看完整的API接口文档和使用示例
  </Card>

  <Card title="集成指南" icon="puzzle-piece" href="/essentials/integration">
    学习如何将AI Gateway集成到您的项目中
  </Card>

  <Card title="开发指南" icon="code" href="/development">
    了解如何在本地进行开发和调试
  </Card>
</CardGroup>

<Note>
  **需要帮助？** 查看我们的[完整文档](/essentials/architecture)或加入[社区讨论](https://github.com/liueic/PancrePal-xiaoyibao)。
</Note>
