Hy4 Preview vs Kimi K2.7 Code
As of October 27, 2026, Kimi K2.7 Code costs 14% more per input token than Hy4 Preview ($0.95 vs $0.834 per 1M) and has a 256K-token context window versus 1M.
Hy4 Preview vs Kimi K2.7 Code side by side
| Hy4 Preview | Kimi K2.7 Code | |
|---|---|---|
| Input, per 1M tokens | $0.834 | $0.95 |
| Output, per 1M tokens | $2.501 | $4.00 |
| Cache read, per 1M tokens | $0.042 | $0.19 |
| Cache write, per 1M tokens | – | – |
| Context window | 1,024,000 tokens | 262,144 tokens |
| Max output | 64,000 tokens | 262,144 tokens |
| Image input | No | Yes |
| Tool calling | Yes | Yes |
| Structured output (JSON) | Yes | Yes |
| Prompt caching | Yes | Yes |
| Reasoning | Yes | Yes |
| Providers on LiteLLM | 2 | 17 |
| Price shown is from | Opencode GO | Moonshot AI |
| Added to LiteLLM | September 16, 2026 | June 2026 |
Cheapest provider for each
- Hy4 Preview: Opencode GO at $0.834 input and $2.501 output per 1M tokens (
opencode_go/hy4-preview) - Kimi K2.7 Code: DeepInfra at $0.68 input and $3.40 output per 1M tokens (
deepinfra/moonshotai/Kimi-K2.7-Code)
When to pick which
Pick Hy4 Preview for
- Costs 12% less per input token: $0.834 vs $0.95 per 1M.
- Larger context window: 1,024,000 vs 262,144 tokens.
Pick Kimi K2.7 Code for
- Supports image input, which Hy4 Preview doesn't list.
- Returns up to 262,144 tokens per response, vs 64,000.
From differences in the data above only; where the data is equal, no reason is given.
Call Hy4 Preview or Kimi K2.7 Code with LiteLLM
Both use the OpenAI format through LiteLLM, so switching is a model name change. Set each provider's API key in the environment first.
from litellm import completion
messages = [{"role": "user", "content": "Hello!"}]
# Hy4 Preview
response = completion(model="opencode_go/hy4-preview", messages=messages)
# Kimi K2.7 Code
response = completion(model="moonshot/kimi-k2.7-code", messages=messages)
# Hy4 Preview, falling back to Kimi K2.7 Code if the call fails
response = completion(model="opencode_go/hy4-preview", messages=messages, fallbacks=["moonshot/kimi-k2.7-code"])FAQ
Which is cheaper, Hy4 Preview or Kimi K2.7 Code?
Hy4 Preview is cheaper at 3 input tokens per output token: $1.251 per 1M tokens blended ($0.834 input, $2.501 output), versus $1.712 ($0.95 and $4.00) for Kimi K2.7 Code, as of October 27, 2026.
Which has the larger context window, Hy4 Preview or Kimi K2.7 Code?
Hy4 Preview has the larger context window: 1,024,000 tokens, versus 262,144 for Kimi K2.7 Code.
Can I switch from Hy4 Preview to Kimi K2.7 Code without changing my code?
Yes. Through LiteLLM both use the OpenAI format, so switching means changing the model name from "opencode_go/hy4-preview" to "moonshot/kimi-k2.7-code", or pointing a LiteLLM gateway model alias at the other model. You can also use one as a fallback for the other.
