TL;DR:复杂编码和 agentic 任务选 Grok 4.7,轻量任务想省 token 选 Grok 4.6。两代在 HiAPI 完全同价(输入 $0.84 / 输出 $2.52 每百万 token)、同 500K 上下文,唯一决定性的是任务类型。Grok 4.7 已在 HiAPI 上线,打开模型页直接试玩,新用户注册送 200 积分。
一眼看懂:两代差在哪
| 维度 | Grok 4.7 | Grok 4.6 |
|---|---|---|
| 平台价(每百万 token,输入/输出) | $0.84 / $2.52 | $0.84 / $2.52(同价) |
| 上下文 | 500K | 500K |
| 编码能力(Terminal-Bench 4.0,官方自报) | 38.0% | 20.3% |
| 定位 | 官方默认推荐,主打编码与 agentic 任务 | 上一代旗舰,在售 |
| token 消耗(第三方 traictory.com,高 effort 无封顶) | 约 81K/任务,约为 4.6 两倍 | 较低 |
| 推理档位 | low / medium / high / xhigh,默认 high | 同左 |
| 知识截止 | 2026-05 | 更早 |
价格、上下文、推理档位完全一样,真正的分水岭是编码能力和输出习惯。下面用两组同提示词实测说话。
同一条提示词(一):LRU 缓存编码题
2026-10-29 在 HiAPI 生产环境实测,两边同参数(推理档位默认 high、max_tokens 封顶)、各跑一次:
提示词:
写一个 Python 的 LRU 缓存类,要求 O(1) 的 get 和 put、支持 TTL(过期自动失效)、线程安全。只给代码和不超过 5 行的使用说明。
Grok 4.7 的回答(39.7s,输出 3285 token,约 $0.011):
class LRUCache:
def __init__(self, capacity: int, default_ttl: Optional[float] = None):
if capacity <= 0:
raise ValueError("capacity must be positive")
self.capacity = capacity
self.default_ttl = default_ttl
self._data: OrderedDict[Hashable, tuple[Any, Optional[float]]] = OrderedDict()
self._lock = threading.Lock()
def get(self, key: Hashable, default: Any = None) -> Any:
with self._lock:
item = self._data.get(key)
if item is None:
return default
value, expire_at = item
if expire_at is not None and time.monotonic() >= expire_at:
del self._data[key]
return default
self._data.move_to_end(key)
return value
def put(self, key: Hashable, value: Any, ttl: Optional[float] = None) -> None:
with self._lock:
ttl = self.default_ttl if ttl is None else ttl
if ttl is not None and ttl <= 0:
self._data.pop(key, None)
return
expire_at = None if ttl is None else time.monotonic() + ttl
if key in self._data:
self._data.move_to_end(key)
elif len(self._data) >= self.capacity:
self._data.popitem(last=False)
self._data[key] = (value, expire_at)
(全文含 import 和使用示例,以上为正文主体;4.7 用 time.monotonic() 计 TTL,并支持 get 传默认值。)
Grok 4.6 的回答(61.9s,输出 3915 token,约 $0.012):
class LRUCache:
def __init__(self, capacity, default_ttl=None):
if not isinstance(capacity, int) or capacity < 1:
raise ValueError("capacity must be positive int")
self.capacity = capacity
self.default_ttl = default_ttl
self._cache = OrderedDict()
self._lock = threading.Lock()
def get(self, key):
with self._lock:
if key not in self._cache:
return None
value, expire_at = self._cache[key]
if expire_at is not None and time.time() > expire_at:
del self._cache[key]
return None
self._cache.move_to_end(key)
return value
def put(self, key, value, ttl=None):
with self._lock:
now = time.time()
expire_at = None
effective_ttl = ttl if ttl is not None else self.default_ttl
if effective_ttl is not None:
expire_at = now + effective_ttl
if expire_at <= now:
if key in self._cache:
del self._cache[key]
return
if key in self._cache:
self._cache.move_to_end(key)
elif len(self._cache) >= self.capacity:
self._cache.popitem(last=False)
self._cache[key] = (value, expire_at)
两组代码都完整满足要求:OrderedDict 实现 O(1)、TTL 惰性过期、threading.Lock 线程安全,均可直接运行。
同一条提示词(二):注水池推理题
一个水池,单开进水管 6 小时注满,单开排水管 8 小时排空。现在水池是空的,同时打开进水管和排水管,问几小时后水池恰好注满?请写出推理过程再给出答案。
| Grok 4.7 | Grok 4.6 | |
|---|---|---|
| 耗时 / 输出 token | 8.3s / 573 | 18.5s / 637 |
| 答案 | 24 小时 | 24 小时 |
两边都用 LaTeX 写出了 1/6 − 1/8 = 1/24 → 1 ÷ 1/24 = 24 的完整过程,结论和推导等价。
看得见的差异
- 编码题 4.7 快 22 秒(39.7s vs 61.9s),输出反而更短(3285 vs 3915 token)
- 推理题两者都答对且过程等价
- 输出习惯上 4.7 更爱用结构化标题和 LaTeX 公式,行文更紧凑;4.6 同样用 LaTeX,但略啰嗦一点(637 vs 573 token)
- 本次 capped 实测(max_tokens 封顶)里,4.7 的输出 token 没有多于 4.6。第三方 traictory.com 的「每任务约 81K token、约 2 倍于 4.6」是高 effort、无封顶口径,两组数据不矛盾也不该混用
- 官方自报 Terminal-Bench 4.0 从 20.3% 提到 38.0%,与上面编码题的体感方向一致
- 这两组对照和另外 5 个场景实跑(排障、代码审查、方案设计等)共 9 次请求全部正常结束(finish=stop),无截断
按场景怎么选
- 做复杂编码、长时程 agentic 任务,选 Grok 4.7
- 做日常轻量问答、格式转换、简单脚本,选 Grok 4.6,输出不缩水还省 token
- 已经在用 4.6 且稳定,不必强迁;新任务先拿 4.7 试,不满意随时切回
- 预算敏感又想要 4.7 的能力:两代同价,差的是消耗量,轻量任务用 4.6 就是省钱
切换成本:只改一个字段
两代走同一个 /v1/chat/completions 接口,参数完全一致,把 model 从 grok-4.6 改成 grok-4.7 即可,其余代码不动:
import requests
resp = requests.post(
"https://api.hiapi.ai/v1/chat/completions",
headers={"Authorization": "Bearer $HIAPI_API_KEY"},
json={
"model": "grok-4.7", # 改这里
"messages": [{"role": "user", "content": "你的任务"}],
},
)
常见问题
Grok 4.7 比 4.6 贵吗? 不贵在单价:HiAPI 上两代同价,输入 $0.84 / 输出 $2.52 每百万 token。第三方 traictory.com 报告称 4.7 在高 effort 无封顶条件下每任务约 81K token、约为 4.6 两倍,指的是消耗量不是单价;我们在 max_tokens 封顶的实测里 4.7 并未多于 4.6。
4.7 有什么已知短板? Cursor 社区有部分用户反馈 4.7 偶发幻觉、代码合并出错、token 消耗大,一些用户回退 4.6。简单任务继续用 4.6 就是稳妥替代。
上下文和推理档位有区别吗? 没有。两代都是 500K 上下文、low / medium / high / xhigh 四档推理,默认 high。
哪里能直接试? Grok 4.7 模型页在线试玩,新用户注册送 200 积分。想看价格细节读 Grok 4.7 API 价格,上手接入看 Grok 4.7 API 指南,场景提示词见 Grok 4.7 提示词案例;还在用旧版的可以对照 Grok 4.6 模型页。





