opencode/packages/web/src/content/docs/zh-cn/go.mdx
2026-07-16 19:20:17 -04:00

218 lines
11 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Go
description: 低成本的开源编程模型订阅服务。
---
import config from "../../../../config.mjs"
export const console = config.console
export const email = `mailto:${config.email}`
OpenCode Go 是一项低成本的订阅服务 —— **首月 5 美元**,之后 **每月 10 美元** —— 让你能够稳定地访问流行的开源编程模型。
Go 的工作方式与 OpenCode 中的任何其他提供商provider一样。订阅 OpenCode Go 后你将获得 API 密钥。它是 **完全可选** 的,并非使用 OpenCode 所必需的条件。
它主要为国际用户设计,模型托管在美国、欧盟和新加坡,以确保稳定的全球访问。
---
## 背景
开源模型现在变得非常强大。在编程任务中,它们的性能已接近专有模型。由于许多提供商都可以提供具有竞争力的服务,它们通常要便宜得多。
然而,获得可靠、低延迟的访问可能很困难。各提供商在质量和可用性方面参差不齐。
:::tip
我们测试了一组经过精选且与 OpenCode 配合良好的模型和提供商。
:::
为了解决这个问题,我们做了以下几件事:
1. 我们测试了一组精选的开源模型,并与他们的团队探讨了如何以最佳方式运行它们。
2. 随后我们与一些提供商合作,以确保正确提供这些服务。
3. 最后我们对模型和提供商的组合进行了基准测试benchmark得出了一份我们乐于推荐的列表。
OpenCode Go 让你能够访问这些模型,**首月只需 5 美元**,之后 **每月 10 美元**。
---
## 工作原理
OpenCode Go 的工作方式与 OpenCode 中的其他提供商一样。
1. 登录 **<a href={console}>OpenCode Zen</a>**,订阅 Go然后复制你的 API 密钥。
2. 在 TUI 中运行 `/connect` 命令,选择 `OpenCode Go`,然后粘贴你的 API 密钥。
3. 在 TUI 中运行 `/models` 以查看通过 Go 可用的模型列表。
:::note
每个工作空间只能有一名成员订阅 OpenCode Go。
:::
当前支持的模型列表包括:
- **Grok 4.5**
- **GLM-5.2**
- **GLM-5.1**
- **Kimi K3**
- **Kimi K2.7 Code**
- **Kimi K2.6**
- **MiMo-V2.5**
- **MiMo-V2.5-Pro**
- **MiniMax M3**
- **MiniMax M2.7**
- **Qwen3.7 Max**
- **Qwen3.7 Plus**
- **Qwen3.6 Plus**
- **DeepSeek V4 Pro**
- **DeepSeek V4 Flash**
随着我们进行测试和添加新模型,该列表可能会发生变化。
---
## 使用限制
OpenCode Go 包含以下限制:
- **5 小时限制** — 12 美元使用额度
- **每周限制** — 30 美元使用额度
- **每月限制** — 60 美元使用额度
限制以美元价值定义。这意味着你的实际请求数取决于你所使用的模型。较便宜的模型(如 DeepSeek V4 Flash允许更多请求而较高成本的模型如 GLM-5.2)允许较少请求。
下表提供了基于典型 Go 使用模式的预估请求数:
| Model | 每 5 小时请求数 | 每周请求数 | 每月请求数 |
| ----------------- | --------------- | ---------- | ---------- |
| Grok 4.5 | 80 | 190 | 380 |
| GLM-5.2 | 880 | 2,150 | 4,300 |
| GLM-5.1 | 880 | 2,150 | 4,300 |
| Kimi K3 | 140 | 340 | 680 |
| Kimi K2.7 Code | 1,350 | 4,630 | 9,250 |
| Kimi K2.6 | 1,150 | 2,880 | 5,750 |
| MiMo-V2.5 | 30,100 | 75,200 | 150,400 |
| MiMo-V2.5-Pro | 3,250 | 8,150 | 16,300 |
| MiniMax M3 | 3,200 | 8,000 | 16,000 |
| MiniMax M2.7 | 3,400 | 8,500 | 17,000 |
| Qwen3.7 Max | 950 | 2,390 | 4,770 |
| Qwen3.7 Plus | 4,300 | 10,800 | 21,600 |
| Qwen3.6 Plus | 3,300 | 8,200 | 16,300 |
| DeepSeek V4 Pro | 3,450 | 8,550 | 17,150 |
| DeepSeek V4 Flash | 31,650 | 79,050 | 158,150 |
预估值基于观察到的平均请求模式:
- Grok 4.5 — 每次请求 1,100 个输入 token71,500 个缓存 token220 个输出 token
- GLM-5.2/5.1 — 每次请求 700 个输入 token52,000 个缓存 token150 个输出 token
- Kimi K3/K2.7/K2.6 — 每次请求 870 个输入 token55,000 个缓存 token200 个输出 token
- DeepSeek V4 Pro — 每次请求 750 个输入 token82,000 个缓存 token290 个输出 token
- DeepSeek V4 Flash — 每次请求 790 个输入 token68,000 个缓存 token280 个输出 token
- MiMo-V2.5 — 每次请求 830 个输入 token71,500 个缓存 token295 个输出 token
- MiMo-V2.5-Pro — 每次请求 790 个输入 token86,000 个缓存 token305 个输出 token
- MiniMax M3 — 每次请求 510 个输入 token56,000 个缓存 token190 个输出 token
- MiniMax M2.7 — 每次请求 300 个输入 token55,000 个缓存 token125 个输出 token
- Qwen3.7 Max — 每次请求 420 个输入 token66,000 个缓存 token200 个输出 token
- Qwen3.7 Plus — 每次请求 500 个输入 token57,000 个缓存 token190 个输出 token
- Qwen3.6 Plus — 每次请求 500 个输入 token57,000 个缓存 token190 个输出 token
预估值还基于以下每 1M tokens 的价格以及每个模型包含的每月使用额度:
| 模型 | 输入 | 输出 | 缓存读取 | 缓存写入 | 使用额度 |
| ---------------------------- | ----- | ------ | -------- | -------- | -------- |
| Grok 4.5 | $2.00 | $6.00 | $0.50 | - | $15 |
| GLM-5.2 | $1.40 | $4.40 | $0.26 | - | $60 |
| GLM-5.1 | $1.40 | $4.40 | $0.26 | - | $60 |
| Kimi K3 | $3.00 | $15.00 | $0.30 | - | $15 |
| Kimi K2.7 Code | $0.95 | $4.00 | $0.19 | - | $60 |
| Kimi K2.6 | $0.95 | $4.00 | $0.16 | - | $60 |
| MiMo V2.5 | $0.14 | $0.28 | $0.0028 | - | $60 |
| MiMo V2.5 Pro | $1.74 | $3.48 | $0.0145 | - | $15 |
| MiniMax M3 | $0.30 | $1.20 | $0.06 | - | $60 |
| MiniMax M2.7 | $0.30 | $1.20 | $0.06 | $0.375 | $60 |
| MiniMax M2.5 | $0.30 | $1.20 | $0.06 | $0.375 | $60 |
| Qwen3.7 Max | $2.50 | $7.50 | $0.50 | $3.125 | $60 |
| Qwen3.7 Plus (≤ 256K tokens) | $0.40 | $1.60 | $0.04 | $0.50 | $60 |
| Qwen3.7 Plus (> 256K tokens) | $1.20 | $4.80 | $0.12 | $1.50 | $60 |
| Qwen3.6 Plus (≤ 256K tokens) | $0.50 | $3.00 | $0.05 | $0.625 | $60 |
| Qwen3.6 Plus (> 256K tokens) | $2.00 | $6.00 | $0.20 | $2.50 | $60 |
| DeepSeek V4 Pro | $1.74 | $3.48 | $0.0145 | - | $15 |
| DeepSeek V4 Flash | $0.14 | $0.28 | $0.0028 | - | $60 |
你可以在 **<a href={console}>控制台</a>** 中跟踪你当前的使用情况。
:::tip
如果你达到了使用限制,你可以继续使用免费模型。
:::
使用限制可能会随着我们从早期使用和反馈中学习而发生变化。
---
### 超出限制的使用
如果你的 Zen 余额中还有积分,可以在控制台中启用 **使用余额Use balance** 选项。启用后当你达到使用限制时Go 会回退使用你的 Zen 余额,而不是拦截请求。
---
### 为什么某些模型的使用额度较低
使用 Go 时,你每月支付 $10而我们的目标是为你提供 6 倍于此的使用额度。
对于大多数模型,我们通过批量折扣和预留 GPU 容量来实现这一目标。然后,我们通过 6 倍乘数将这些节省的成本回馈给你。
对于某些模型,我们还没有机会协商折扣或以更低的成本托管它们,这可能是因为模型较新,或者其公开价格已经是折扣价。
对于这些模型,你获得的使用额度仍会略高于直接向模型提供商付费;这就是它们在上表中的使用额度乘数较低的原因。
---
## API 端点
你也可以通过以下 API 端点访问 Go 模型。
| 模型 | 模型 ID | 端点 | AI SDK 包 |
| ----------------- | ----------------- | ------------------------------------------------ | --------------------------- |
| Grok 4.5 | grok-4.5 | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| GLM-5.2 | glm-5.2 | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| GLM-5.1 | glm-5.1 | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Kimi K3 | kimi-k3 | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Kimi K2.7 Code | kimi-k2.7-code | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| Kimi K2.6 | kimi-k2.6 | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| DeepSeek V4 Pro | deepseek-v4-pro | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| DeepSeek V4 Flash | deepseek-v4-flash | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| MiMo-V2.5 | mimo-v2.5 | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| MiMo-V2.5-Pro | mimo-v2.5-pro | `https://opencode.ai/zen/go/v1/chat/completions` | `@ai-sdk/openai-compatible` |
| MiniMax M3 | minimax-m3 | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
| MiniMax M2.7 | minimax-m2.7 | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
| MiniMax M2.5 | minimax-m2.5 | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
| Qwen3.7 Max | qwen3.7-max | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
| Qwen3.7 Plus | qwen3.7-plus | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
| Qwen3.6 Plus | qwen3.6-plus | `https://opencode.ai/zen/go/v1/messages` | `@ai-sdk/anthropic` |
你的 OpenCode 配置中的 [模型 ID](/docs/config/#models) 使用 `opencode-go/<model-id>` 格式。例如,对于 Kimi K3你将在配置中使用 `opencode-go/kimi-k3`。
---
### 模型
你可以从以下地址获取可用模型及其元数据的完整列表:
```
https://opencode.ai/zen/go/v1/models
```
---
## 隐私保护
该方案主要面向国际用户,模型托管在 US、EU 和 Singapore以提供稳定的全球访问。我们的提供商遵循零保留政策不会将您的数据用于模型训练。
---
## 目标
我们创建 OpenCode Go 的目的是:
1. 通过低成本订阅让更多人能够 **无门槛地** 使用 AI 编程。
2. 为最佳开源编程模型提供 **可靠的** 访问。
3. 精选经过 **测试和基准评估**,适合编程 Agent 使用的模型。
4. **无锁定no lock-in**,允许你与 OpenCode 一起使用任何其他提供商。