Files
cursor-byok/apps/docs/content/docs/model-configuration.mdx
T
leookun 217f984112 feat(docs): enhance documentation and UI consistency
- Updated the index.html to dynamically set the theme color based on user selection, improving user experience during theme switching.
- Modified proxy.ts to include 'icon.png' in the matcher for better asset handling.
- Added a new icon.png file for enhanced branding.
- Improved metadata in layout.tsx and page.tsx files for better clarity and consistency in documentation.
- Updated various documentation files to reflect the new branding of 'Cursor Byok' and ensure consistent terminology throughout.
- Removed outdated blog entries and added new content to better align with the current product direction.
2026-08-28 01:33:51 +08:00

84 lines
2.6 KiB
Plaintext

---
title: 模型配置
description: 配置模型协议、服务地址、凭据与生成参数。
icon: Settings2
---
每个模型配置都是一个独立的上游通道,可以使用不同服务商、协议、凭据和生成参数。
![编辑模型弹窗](/images/docs/model-edit-zh.png)
## 如何选择类型与协议
按上游模型系列选择,可以避免绝大多数兼容性问题:
| 模型系列 | 模型类型 | 请求协议 |
| --- | --- | --- |
| Claude 系列 | **Anthropic** | — |
| GPT / OpenAI 系列 | **OpenAI** | **Responses API** |
| 其他所有模型 | **OpenAI** | **Chat Completions API** |
<Callout type="warn" title="GPT 系列务必用 Responses API">
GPT 系列走 Chat Completions 会丢失提示词缓存,速度和费用都会明显变差。
</Callout>
## 必填字段
### 模型类型
选择上游接口格式:
- **OpenAI**:支持 Responses API 和 Chat Completions API。
- **Anthropic**:支持 Messages API 兼容服务。
### 请求协议
OpenAI 类型需要继续选择 **Responses API** 或 **Chat Completions API**。该选项决定请求和响应格式,不会单独改变你填写的服务地址。
### 服务器地址
可以填写服务商的基础地址,也可以选择使用完整请求 URL:
- 使用基础地址时,Cursor Byok 会根据协议追加标准端点路径。
- 使用完整请求 URL 时,Cursor Byok 会原样使用该地址。
优先使用界面中的常用服务商预设,减少协议与端点不匹配的情况。
### API Key
填写上游服务要求的访问密钥。密钥保存在本机,用于发送模型请求。
### 模型名称
填写服务商接口接受的模型标识。你也可以点击 **获取模型** 读取接口返回的模型列表。
## 展示信息
- **显示名称**:Cursor 模型列表中看到的名称,不会改变发送给上游的模型标识。
- **备注**:显示在 Cursor 的模型说明中。
## 可选参数
按模型能力填写以下字段;留空时使用应用或上游的默认值:
- 上下文窗口 Token
- 最大输出 Token
- 推理强度或思考强度
- 自定义 Headers
- OpenAI 或 Anthropic 额外参数
<Callout type="warn" title="额外参数格式">
自定义 Headers 和额外参数必须是 JSON 对象。额外参数会直接影响上游请求,只添加服务商明确支持的字段。
</Callout>
## 测试配置
保存后运行 **测试**。结果会显示首字延迟、生成速度、总耗时和模型输出,便于确认:
1. 地址和协议是否匹配。
2. API Key 是否有效。
3. 模型标识是否存在且可访问。
4. 上游是否能正常返回流式内容。
测试通过后再前往 Cursor 使用该模型。