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

# 在 Msty.ai 中设置 Alter API

> 通过 endpoint 和 API key 配置将 Msty.ai 连接到 Alter API Router

使用本指南将 Msty.ai 连接到 Alter API Router。

## 打开 provider 配置

在 Msty.ai 中，打开 provider/model 配置页面，在这里设置：

* API endpoint（base URL）
* API key
* 模型选择

## 1）API key

将你的 Alter key 粘贴到 API key 字段：

`sk-...`

在 Alter 中通过 `Settings` -> `Router` -> `Alter API Keys` 生成 key。

## 2）推理 endpoint

将 endpoint 设为：

```text theme={null}
https://alterhq.com/api/v1
```

## 3）获取并选择模型

设置好 endpoint + API key 后，在 Msty.ai 中点击 **Fetch models**。

Msty.ai 会加载可用的 Alter 模型供你从列表中选择。
你不需要手动输入模型 ID。

<img src="https://mintcdn.com/alter-95c0cbf0/kCIiz-VJZWlVWe4I/images/integrations/msty-endpoint-api-key.jpeg?fit=max&auto=format&n=kCIiz-VJZWlVWe4I&q=85&s=d89a5ec018dc52d91fe52db01b41ced3" alt="Msty.ai endpoint 和 API key 设置" width="3248" height="2112" data-path="images/integrations/msty-endpoint-api-key.jpeg" />

## 验证连接

1. 在 Msty.ai 中保存设置
2. 发送一个简单 prompt
3. 若失败，检查 endpoint 和 API key，然后再次点击 **Fetch models**

## 相关文档

* [API 模型参考](/zh/references/api-model-names)
* [用于开发的 API Router](/zh/api-router/development)
* [API Router 运营与故障排查](/zh/api-router/operations)
