在 Synthorai 上,Claude Sonnet 4 通过兼容 OpenAI 的 /v1/chat/completions 端点调用:换掉 base_url,代码不用改。
- 输入
- $3/M
- 输出
- $15/M
- 缓存读取
- $0.3/M
- 上下文
- 200K
- 对比 GPT-4o
- 便宜约 40%
Benchmark 成绩
Claude Sonnet 4:公布了 57 项成绩,但每一项测过的其他模型都太少,没法比较。
供应商公布: Alibaba (Qwen)
价格在同类中的位置
价格在 68 个同类模型中的位置
这条线标出该模型的价格在 Synthorai 同类模型中的位置,两端分别是最便宜和最贵的模型。这里是基础价,批量、区域和缓存写入的折扣见价格页。
规格与限制
提示词缓存
| 缓存方式 | 显式(需开启) |
|---|---|
| 最小前缀 | 1,024 |
| 有效期 | 默认 5 分钟,可选 1 小时 |
| 写入成本 | 1.25x (5m) / 2x (1h) |
30 秒用上 Claude Sonnet 4
兼容 OpenAI:换掉 base_url,SDK 不用改。POST /v1/chat/completions
from openai import OpenAI
client = OpenAI(
base_url="https://synthorai.io/v1",
api_key="sk-syn-...",
)
resp = client.chat.completions.create(
model="claude-sonnet-4",
messages=[{"role": "user", "content": "Summarize this diff"}],
reasoning_effort="medium",
)
print(resp.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://synthorai.io/v1",
apiKey: "sk-syn-...",
});
const resp = await client.chat.completions.create({
model: "claude-sonnet-4",
messages: [{ role: "user", content: "Summarize this diff" }],
reasoning_effort: "medium",
});
console.log(resp.choices[0].message.content);curl https://synthorai.io/v1/chat/completions \
-H "Authorization: Bearer sk-syn-..." \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4",
"messages": [{"role": "user", "content": "Hello"}],
"reasoning_effort": "medium"
}'package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://synthorai.io/v1"),
option.WithAPIKey("sk-syn-..."),
)
resp, _ := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: "claude-sonnet-4",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Summarize this diff"),
},
ReasoningEffort: openai.ReasoningEffortMedium,
})
fmt.Println(resp.Choices[0].Message.Content)
}import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.chat.completions.*;
import com.openai.models.ReasoningEffort;
OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://synthorai.io/v1")
.apiKey("sk-syn-...")
.build();
ChatCompletion resp = client.chat().completions().create(
ChatCompletionCreateParams.builder()
.model("claude-sonnet-4")
.addUserMessage("Summarize this diff")
.reasoningEffort(ReasoningEffort.MEDIUM)
.build());
System.out.println(resp.choices().get(0).message().content().orElse(""));常见问题
Claude Sonnet 4 API 可以免费试用吗?
可以。新账号有 10 次试用调用,免费额度最高 $1,无需绑卡。按输入 $3/M 计算,光这笔额度就够向 Claude Sonnet 4 发约 41 次请求,每次 ~8K token。
Claude Sonnet 4 的价格是多少?
在 Synthorai 上,Claude Sonnet 4 的输入价为 $3/百万 token,输出价为 $15/百万 token。这就是供应商官网价,平台不加价。缓存命中的输入 token 按 $0.3/M 计费。
Claude Sonnet 4 的上下文长度是多少?
Claude Sonnet 4 的上下文长度(上下文窗口)是 200K token。
Claude Sonnet 4 支持提示词缓存(prompt caching)吗?
支持,但需要主动开启:用 cache_control 断点标记稳定不变的前缀。缓存命中的输入 token 按 $0.3/M 计费(未命中为 $3/M);提示词的稳定前缀至少要有 1,024 个 token 才能缓存(TTL 默认 5 分钟,可选 1 小时)。 提示词缓存指南 →
如何开通 Claude Sonnet 4?
把现有 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 设为 "claude-sonnet-4" 即可。一个 API key 就能调用网关上的全部模型。
相关模型
对比
本页的每个数值都照录自供应商自己的文档(链接见上),并标有核对日期。价格是在整个目录范围内比较的;各家供应商定义不一样的规格项,只说明差异,不画图对比。这里没有任何一项是我们自己测的,也不打分。