Free Claude 3.5 Sonnet API on Vercel AI Gateway

通过 Vercel AI Gateway 免费访问 Claude 3.5 Sonnet。

更新于 2026/7/23 个代码示例
加载评分…

关于该模型

Why choose Claude 3.5 Sonnet?

Claude 3.5 Sonnet stands out as the industry leader for coding tasks. It natively supports computer use capabilities, excels at understanding large codebases, and provides incredibly nuanced reasoning in its outputs.

如何免费接入 (通过 Vercel AI Gateway)

为什么选择通过 Vercel 调用?

Vercel 为每个团队(包括免费的 Hobby 个人计划)每月提供了价值 $5 的系统层 AI 额度。只要您当月的调用未超出 $5 的等值 token 消耗,即可通过 Vercel AI SDK 免费试用此模型。

在浏览器里试用

选个模型、粘贴你自己的免费 Key,即可运行。你的 Key 只用于调用一次该提供商,绝不存储在我们的服务器上。

选个模型、粘贴你自己的免费 Key,即可运行。你的 Key 只用于调用一次该提供商,绝不存储在我们的服务器上。

调用代码示例

curl
curl https://ai-gateway.vercel.sh/v1/chat/completions \
  -H "Authorization: Bearer $AI_GATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"anthropic/claude-3.5-sonnet","messages":[{"role":"user","content":"Refactor this function into smaller pure functions."}]}'
python
from openai import OpenAI

client = OpenAI(base_url="https://ai-gateway.vercel.sh/v1", api_key="AI_GATEWAY_API_KEY")
response = client.chat.completions.create(
    model="anthropic/claude-3.5-sonnet",
    messages=[{"role": "user", "content": "Refactor this function into smaller pure functions."}],
)
print(response.choices[0].message.content)
javascript
import { generateText } from "ai";

const { text } = await generateText({
  model: "anthropic/claude-3.5-sonnet",
  prompt: "Refactor this function into smaller pure functions.",
});

console.log(text);

社区反馈

评论与你的 GitHub 账号绑定,登录后即可参与讨论。