# 百度翻译

{% hint style="success" %}
百度翻译开放平台：<https://fanyi-api.baidu.com>
{% endhint %}

### 登录 & 注册开发者

* 打开百度翻译开放平台的网站
* 点击右上角登录，使用个人的百度账号登录（若无，则自行注册）
* 首次登录后，需要注册开发者。这里我们选择个人，并按要求填写内容

![](https://1003988539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl32LfsaljX9FHbl3ksjH%2Fuploads%2F1ufPiYKWoWazf0PmJ8k0%2F%E6%88%AA%E5%B1%8F2022-04-15%2011.16.51.png?alt=media\&token=57e5b567-afa3-463e-8cdb-23fdd4c0cab7)

### 开通翻译服务

* 登录后在顶部导航栏点击「管理控制台」
* 在控制台首页中部点击「立即开通
* 在「在线服务」选择页面，选择「通用翻译」
* 然后选择「高级版」（需要个人认证）
* 之后按照需求填写应用内容（除了应用名，其他为选填）

![](https://1003988539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl32LfsaljX9FHbl3ksjH%2Fuploads%2FtsWt4XyJ1rCn1SEY6yJT%2F%E6%88%AA%E5%B1%8F2022-04-15%2011.23.51.png?alt=media\&token=62a9b5e6-7dfc-416b-88cf-9f0b2a3424d5)

### 获取并设置 API

完成翻译服务开通后，在左边导航栏点击「开发者信息」，就可以看到百度翻译的 API 信息了。

![](https://1003988539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl32LfsaljX9FHbl3ksjH%2Fuploads%2FZrLtn7pqJSzp0t1GNW9S%2F%E6%88%AA%E5%B1%8F2022-04-15%2011.24.28.png?alt=media\&token=c1bbfd9c-bc06-4826-ac84-f738ccfa2207)

在 HapiGo 的翻译设置中，选择「自定义」，然后点击 + 添加百度翻译。在弹出的对话框中填入上图「APP ID」及「密钥」，点击完成后即可。

![设置 API 密钥](https://1003988539-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl32LfsaljX9FHbl3ksjH%2Fuploads%2FszjXyWtVfUdETp6JJpzT%2F%E8%AE%BE%E7%BD%AE%E7%BF%BB%E8%AF%91%20API.png?alt=media\&token=d8bc6f8c-cf8c-494b-a720-91eb4b409faf)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-cn.hapigo.com/extention/translate/addtranslate/baidu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
