> For the complete documentation index, see [llms.txt](https://docs.cherryai.com.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cherryai.com.cn/pre-basic/providers/openai.md).

# OpenAI

## 获取 APIKey

* 在官方 [API Key 页面](https://platform.openai.com/api-keys) 点击<mark style="background-color:green;">`+ Create new secret key`</mark>

<img src="https://3562065924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2Fgit-blob-159901909dca352408b76ab8ab813843abe5140d%2Ffile.excalidraw%20(1).svg?alt=media" alt="" class="gitbook-drawing">

* 将生成的 key 复制，并打开 CherryStudio 的 [模型服务设置](/pre-basic/providers/providers.md)
* 找到服务商 OpenAI，填入刚刚获取到的 key

<figure><img src="https://3562065924-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Ut5BptC3t8CtSU1UWpM%2Fuploads%2Fgit-blob-9857794ccb60aa975a538ead53925ab2c2561487%2Fimage%20(9)%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

* 点击最下方管理或者添加，加入支持的模型并打开右上角服务商开关就可以使用了。

{% hint style="info" %}

* 中国除台湾之外其他地区无法直接使用 OpenAI 服务，需自行解决代理问题；
* 需要有余额。
  {% endhint %}

***

### 获取帮助与提交反馈

如果您在配置或使用过程中遇到任何疑问、Bug 或有功能改进建议，请参考 [反馈与建议](/question-contact/suggestions.md) 中提供的官方渠道。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cherryai.com.cn/pre-basic/providers/openai.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
