# Azure OpenAI

Azure OpenAI 係微軟喺 Azure 上託管嘅 OpenAI 模型服務，適合需要企業合規、數據駐留承諾，或者微軟生態嘅團隊。

## 前置準備

* 已開通 Azure 訂閱
* 已喺 Azure Portal 入面申請並通過 Azure OpenAI Service 存取審批
* 已建立至少一個 **資源（Resource）** 同 **部署（Deployment）**

## 拎 API Key

* Azure Portal → 你嘅 Azure OpenAI 資源 → `Keys and Endpoint`
* 複製 `KEY 1` 或者 `KEY 2`，記低 `Endpoint`（形如 `https://<your-name>.openai.azure.com/`）

## 喺 Cherry Studio 設置

* 打開 `設定 → 模型服務`，搵到 **Azure OpenAI** Provider 入去詳情頁
* **API 密鑰**：填入複製嘅 KEY
* **API 地址**：填入資源嘅 Endpoint（唔使帶尾部路徑）
* **API Version**：喺專屬欄位填入你嘅部署嘅 API 版本（例如 `2024-08-01-preview`）
* 撳 **獲取模型列表**，或者手動加入你已喺 Azure 上部署嘅模型名（即 Deployment Name，而唔係 OpenAI 原始模型 ID）

{% hint style="warning" %}
**Deployment Name vs Model ID**：Azure 用嘅係你幫部署改嘅名（如 `gpt-4o-prod`），唔係 `gpt-4o` 呢種原始 ID。填錯會 404。
{% endhint %}

## 推薦用法

* **gpt-4o / gpt-4o-mini**：通用對話、Agent
* **gpt-4 turbo**：長上下文
* **text-embedding-3-**\*：嵌入模型，可與 [全局記憶](/docs/zhong-wen-fan-ti/advanced-basic/memory.md)、知識庫共用

## 常見問題

* **401 Unauthorized**：檢查 Key 係咪正確、Endpoint 尾部係咪多咗斜槓
* **404 Not Found**：檢查 Deployment Name 係咪同 Azure 上一致、API Version 係咪填咗
* **429 Throttled**：檢查 Azure 配額（Quota & Limits 頁）

***

### 💡 獲取幫助同提交反饋

如果您喺配置或使用過程中遇到任何疑問、Bug 或有功能改進建議，請參考 [反饋同建議](/docs/zhong-wen-fan-ti/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 dynamically by asking a question.

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

```
GET https://docs.cherry-ai.com/docs/zhong-wen-fan-ti/pre-basic/providers/azure-openai.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.
