Free Claude 3.5 Sonnet API on Vercel AI Gateway

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

关于该模型

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 免费试用此模型。

调用代码示例

javascript
import { generateText } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';

// Powered by Vercel AI Gateway's monthly credits (No Anthropic Key needed if configured in Vercel project)
const { text } = await generateText({
  model: anthropic('claude-3-5-sonnet-latest'),
  prompt: 'Write a robust React hook for fetching and caching data.',
});
console.log(text);