Skip to content

Commit 9c585bb

Browse files
andyWang1688wangxinxin
andauthored
docs(providers): clarify npm choice for chat vs responses APIs (anomalyco#16974)
Co-authored-by: wangxinxin <[email protected]>
1 parent 0f6bc8a commit 9c585bb

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/web/src/content/docs/providers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ You can use any OpenAI-compatible provider with opencode. Most modern AI provide
18901890
```
18911891
18921892
Here are the configuration options:
1893-
- **npm**: AI SDK package to use, `@ai-sdk/openai-compatible` for OpenAI-compatible providers
1893+
- **npm**: AI SDK package to use, `@ai-sdk/openai-compatible` for OpenAI-compatible providers (for `/v1/chat/completions`). If your provider/model uses `/v1/responses`, use `@ai-sdk/openai`.
18941894
- **name**: Display name in UI.
18951895
- **models**: Available models.
18961896
- **options.baseURL**: API endpoint URL.
@@ -1957,5 +1957,5 @@ If you are having trouble with configuring a provider, check the following:
19571957
19581958
2. For custom providers, check the opencode config and:
19591959
- Make sure the provider ID used in the `/connect` command matches the ID in your opencode config.
1960-
- The right npm package is used for the provider. For example, use `@ai-sdk/cerebras` for Cerebras. And for all other OpenAI-compatible providers, use `@ai-sdk/openai-compatible`.
1960+
- The right npm package is used for the provider. For example, use `@ai-sdk/cerebras` for Cerebras. And for all other OpenAI-compatible providers, use `@ai-sdk/openai-compatible` (for `/v1/chat/completions`); if a model uses `/v1/responses`, use `@ai-sdk/openai`. For mixed setups under one provider, you can override per model via `provider.npm`.
19611961
- Check correct API endpoint is used in the `options.baseURL` field.

packages/web/src/content/docs/zh-cn/providers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,7 +1845,7 @@ Vercel AI Gateway 允许你通过统一端点访问来自 OpenAI、Anthropic、G
18451845
```
18461846
18471847
以下是配置选项说明:
1848-
- **npm**:要使用的 AI SDK 包,对于 OpenAI 兼容的提供商使用 `@ai-sdk/openai-compatible`
1848+
- **npm**:要使用的 AI SDK 包,对于 OpenAI 兼容的提供商使用 `@ai-sdk/openai-compatible`(适用于 `/v1/chat/completions`)。如果你的提供商/模型走 `/v1/responses`,请使用 `@ai-sdk/openai`
18491849
- **name**:在 UI 中显示的名称。
18501850
- **models**:可用模型。
18511851
- **options.baseURL**:API 端点 URL。
@@ -1911,5 +1911,5 @@ Vercel AI Gateway 允许你通过统一端点访问来自 OpenAI、Anthropic、G
19111911
19121912
2. 对于自定义提供商,请检查 OpenCode 配置并确认:
19131913
- `/connect` 命令中使用的提供商 ID 与 OpenCode 配置中的 ID 一致。
1914-
- 使用了正确的 npm 包。例如,Cerebras 应使用 `@ai-sdk/cerebras`。对于其他所有 OpenAI 兼容的提供商,使用 `@ai-sdk/openai-compatible`
1914+
- 使用了正确的 npm 包。例如,Cerebras 应使用 `@ai-sdk/cerebras`。对于其他所有 OpenAI 兼容的提供商,使用 `@ai-sdk/openai-compatible``/v1/chat/completions`);如果模型走 `/v1/responses`,请使用 `@ai-sdk/openai`。同一 provider 混用时,可在模型下设置 `provider.npm` 覆盖默认值
19151915
- `options.baseURL` 字段中的 API 端点地址正确。

0 commit comments

Comments
 (0)