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

# 使用你自己的 API 密钥

> 在 Fetch Hive 中使用 Personal 计费类型,并通过集成连接提供商凭据

# 使用你自己的 API 密钥

当你希望 Fetch Hive 使用你自己的提供商凭据来运行模型相关的工作,而不是使用托管的默认凭据时,请使用本页面。

## 概述

Fetch Hive 在界面中提供两种模型访问方式:

* **Hosted**
* **Personal**

你可以在配置模型相关工作的编辑界面中,通过 **Charge Type** 控件在两者之间进行选择。你也可以在 **Workspace** 中通过 **Default charge type** 设置工作区范围的默认值。

当你选择 **Personal** 时,应通过[集成](./integrations)连接相关的提供商凭据。

## 如何设置默认计费类型? <a href="#set-default-charge-type" id="set-default-charge-type" />

在侧边栏打开 **Settings**,然后点击 **Workspace**。

找到 **Default charge type**。

如果你希望新工作默认使用 Fetch Hive 托管的模型访问,选择 **Hosted**。

如果你希望新工作默认使用你自己连接的提供商凭据,选择 **Personal**。

点击 **Save** 以应用工作区默认设置。

## 如何在提示词、工作流和智能体中使用个人模型? <a href="#use-personal-model" id="use-personal-model" />

在提示词编辑器中,打开 **Parameters**,然后将 **Charge Type** 更改为 **Personal**。

在工作流编辑器中,为基于模型的步骤(例如 **AI Prompt**)打开相关的 **Step settings**,然后将 **Charge Type** 更改为 **Personal**。

在智能体编辑器中,打开 **Agent Settings**,然后将 **Charge Type** 更改为 **Personal**。

Fetch Hive 支持针对 OpenAI、Anthropic、xAI、Perplexity 和 Cohere 模型的个人 API 密钥。Google Gemini 目前仅支持托管模式,在 Fetch Hive 准备好正式的客户 Vertex 集成之前。

切换到 **Personal** 后,继续在同一编辑界面中选择模型并完成其余配置。

{/* Add screenshot: workflow Step settings showing Charge Type */}

## 如何连接提供商凭据? <a href="#connect-provider-credentials" id="connect-provider-credentials" />

在侧边栏打开 **Tools**,然后点击 **Integrations**。

找到你想要连接的提供商,点击 **Connect**。

如果该提供商使用 OAuth,请完成 OAuth 流程。

如果该提供商使用直接密钥,请在对话框中输入 API 密钥并保存。

连接建立后,返回到你的提示词、工作流或智能体。

{/* Add screenshot: integration connection flow for provider credentials */}

## Hosted 和 Personal 有什么区别? <a href="#hosted-vs-personal" id="hosted-vs-personal" />

当你希望使用 Fetch Hive 托管的模型访问时,使用 **Hosted**。

当你希望用量的提供商部分与你自己连接的凭据关联时,使用 **Personal**。

当前的成本分项界面反映了这种差异。当某次运行使用 **Personal** 时,Fetch Hive 会将提供商部分标记为 **Provider Cost (billed to your API key)**,并标注 **You pay provider separately via your API key**。

当某次运行使用 **Hosted** 时,Fetch Hive 会显示提供商部分从你的 LLM 钱包中扣除。平台部分单独显示为 **Estimated task credit cost**,基于你套餐内包含的任务或购买的加量任务。

另请参阅:[工作区设置](./workspace-settings)、[集成](./integrations)、[提示词](../prompts/overview)、[工作流](../workflows/overview)和[智能体](../agents/overview)
