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

# 接入 Dify

<img src="https://mintlify.s3.us-west-1.amazonaws.com/liaobots/images/dify/dify-icon.jpg" alt="Dify" />

打开 [Dify](https://dify.ai)

## 准备工作

> `模型名称`：在 [模型名与价格](/Aggregation/Model-Price.mdx) 找到您需要调用的模型名并复制下来
>
> `API Key`：您的登陆码
>
> `API endpoint URL`：[https://ai.liaobots.work/v1](https://ai.liaobots.work/v1)

## 流程

<Steps>
  <Step title="第一步">
    <Card title="点击设置" img="https://mintcdn.com/liaobots/pAzQwH2vlz1d7UuQ/images/API/dify/step-1.jpg?fit=max&auto=format&n=pAzQwH2vlz1d7UuQ&q=85&s=c667f718532f9f7dfacb2d2a8de4b71e" width="3020" height="1458" data-path="images/API/dify/step-1.jpg" />
  </Step>

  <Step title="第二步">
    <Card title="将自定义模型提供商更改为兼容 OpenAI" img="https://mintcdn.com/liaobots/pAzQwH2vlz1d7UuQ/images/API/dify/step-2.jpg?fit=max&auto=format&n=pAzQwH2vlz1d7UuQ&q=85&s=b8580af3fafa4600bd08c9074017c4d4" width="3020" height="1458" data-path="images/API/dify/step-2.jpg">
      点击 `模型供应商` 后选择 `OpenAl-API-compatible` 点击 `添加模型`
    </Card>
  </Step>

  <Step title="第三步">
    <Card title="更改关键设置" img="https://mintcdn.com/liaobots/pAzQwH2vlz1d7UuQ/images/API/dify/step-3.jpg?fit=max&auto=format&n=pAzQwH2vlz1d7UuQ&q=85&s=cb6655fab3b853c88097ceee17545d00" width="1282" height="1232" data-path="images/API/dify/step-3.jpg">
      填入 `模型名称``API Key``API endpoint URL` 后点击 `保存`
    </Card>
  </Step>

  <Step title="第四步">
    <Card title="创建聊天助手" img="https://mintcdn.com/liaobots/pAzQwH2vlz1d7UuQ/images/API/dify/step-4.jpg?fit=max&auto=format&n=pAzQwH2vlz1d7UuQ&q=85&s=9109be738f2fe7cf4e46d2b6c3640c72" width="3020" height="1460" data-path="images/API/dify/step-4.jpg">
      随意创建一个聊天助手后在右上角可以看见刚才新增的模型
    </Card>
  </Step>

  <Step title="第五步">
    <Card title="测试连接" img="https://mintcdn.com/liaobots/pAzQwH2vlz1d7UuQ/images/API/dify/step-5.jpg?fit=max&auto=format&n=pAzQwH2vlz1d7UuQ&q=85&s=1d59923485b39d63ed785be04a872028" width="3020" height="1456" data-path="images/API/dify/step-5.jpg">
      发送测试消息并成功看见回复
    </Card>
  </Step>
</Steps>
