Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

2.0 KB
Raw Blame
---
title: 在 LobeHub 中使用 Vercel AI Gateway
description: 了解如何在 LobeHub 中集成和使用 Vercel AI Gateway 的统一 API
tags:
  - LobeHub
  - Vercel AI Gateway
  - API 密钥
  - Web 界面
---

# 在 LobeHub 中使用 Vercel AI Gateway

[Vercel AI Gateway](https://vercel.com/ai-gateway) 是一个统一的 API,通过单一端点提供对 100+ AI 模型的访问。它提供预算管理、使用监控、负载均衡和回退处理等功能。

本文将指导您如何在 LobeHub 中使用 Vercel AI Gateway。

在 LobeHub 中配置时,打开 **应用设置 → AI 服务商**,选择对应服务商并打开右侧开关。

<Steps>
  ### 第一步:在 Vercel AI Gateway 中创建 API 密钥

  - 访问 [Vercel 控制台](https://vercel.com/dashboard)
  - 点击左侧的 **AI Gateway** 标签
  - 点击左侧边栏的 **API 密钥**
  - 点击 **创建密钥**,然后在对话框中点击 **创建密钥** 完成创建

  ### 第二步:在 LobeHub 中配置 Vercel AI Gateway

  - 打开 **应用设置 → AI 服务商**
  - 选择 **Vercel AI Gateway**,然后打开服务商
  - 输入您获得的 API 密钥
  - 选择 Vercel AI Gateway 的模型,开始与 AI 助手对话

  <Callout type={'warning'}>
    使用过程中可能需要向 API 服务提供商付费,请参考 Vercel AI Gateway 的
    [定价政策](https://vercel.com/docs/ai-gateway/models)。
  </Callout>
</Steps>

至此,您可以在 LobeHub 中使用 Vercel AI Gateway 提供的模型开始聊天了。

## 模型选择

Vercel AI Gateway 可以接入多家服务商的模型。可用模型和模型 ID 会随网关目录更新,你可以在 LobeHub 的模型列表中获取或添加当前模型。

如需查看完整的支持模型列表,请访问 [Vercel AI Gateway 模型](https://vercel.com/ai-gateway/models)。

## API 配置

Vercel AI Gateway 使用 OpenAI 兼容的 API 格式。基础 URL 为:

```
https://ai-gateway.vercel.sh/v1
```

您可以使用任何 OpenAI 兼容的客户端与此端点和您的 API 密钥一起使用。