Seedream 5.0 Pro está no ar | Experimente no Gerador de Imagens →
anthropic
anthropic/claude-sonnet-4

anthropic/claude-sonnet-4

Data de lançamento: 2025-05-23

200,000 context · $3.00/M input tokens · $15.00/M output tokens

Claude Sonnet 4 significantly enhances the capabilities of its predecessor, Sonnet 3.7, excelling in both coding and reasoning tasks with improved precision and controllability. Achieving state-of-the-art performance on SWE-bench (72.7%),...

Preços

Pagamento por uso

Sem custo inicial, pague apenas pelo que usar

Entrada$3.00 / M Tokens
Saída$15.00 / M Tokens
Cache Read$0.30 / M Tokens
Cache Write$3.75 / M Tokens

Experimentar o modelo

anthropic/claude-sonnet-4
Online
anthropic
Olá! Sou um assistente de IA útil. Em que posso ajudar?
Pronto para usar este modelo em um coding agent local?Setup do agente

Uso da API

Use os exemplos de código abaixo para integrar com nossa API:

import OpenAI from 'openai';

if (!process.env.WAVESPEED_API_KEY) throw new Error('Set WAVESPEED_API_KEY');
const client = new OpenAI({
  apiKey: process.env.WAVESPEED_API_KEY,
  baseURL: 'https://llm.wavespeed.ai/v1',
  timeout: 120_000,
  maxRetries: 2,
});

try {
  const response = await client.chat.completions.create({
    model: 'anthropic/claude-sonnet-4',
    messages: [{ role: 'user', content: 'Hello!' }],
  });
  console.log(response.choices[0]?.message?.content ?? '');
} catch (error) {
  console.error('LLM request failed:', error);
  process.exitCode = 1;
}

Introdução do modelo

Anthropic claude-sonnet-4

anthropic claude-sonnet-4


Why It Looks Great

  • Large Language Model architecture for efficient processing
  • 1000000 context window for long document handling
  • Competitive pricing at $3.3/$16.5 per million tokens

Key Features

  • Context Window: 1000000 tokens
  • Max Output: 64000 tokens
  • Vision: Supported
  • Function Calling: Supported

Specifications

SpecificationValue
ProviderAnthropic
Model TypeLarge Language Model (LLM)
ArchitectureN/A
Context Window1000000 tokens
Max Output64000 tokens
InputText
OutputText
VisionSupported
Function CallingSupported

Pricing

Token TypeCost per Million Tokens
Input$3.3
Output$16.5

How to Use

  1. Write your prompt — describe the task, provide context, and specify desired output format.
  2. Submit — the model processes your request and returns the response.

API Integration

Base URL: https://llm.wavespeed.ai/v1 API Endpoint: chat/completions Model ID: anthropic/claude-sonnet-4


API Usage

Python SDK

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://llm.wavespeed.ai/v1"
)

response = client.chat.completions.create(
    model="anthropic/claude-sonnet-4",
    messages=[
        {"role": "user", "content": "Hello!"}
    ]
)

print(response.choices[0].message.content)

cURL

curl https://llm.wavespeed.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "anthropic/claude-sonnet-4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Notes

  • Model: anthropic/claude-sonnet-4
  • Provider: Anthropic

Info

Provedoranthropic
Tipollm

Funcionalidades suportadas

Entrada
TextoImagem
Saída
Texto
Contexto200,000
Saída máx.64,000
Vision✓ Suportado
Function Calling✓ Suportado

Guia de acesso à API

Base URLhttps://llm.wavespeed.ai/v1
API Endpointchat/completions
ID do modeloanthropic/claude-sonnet-4

Claude Sonnet 4 API

anthropic/claude-sonnet-4

Claude Sonnet 4 significantly enhances the capabilities of its predecessor, Sonnet 3.7, excelling in both coding and reasoning tasks with improved precision and controllability. Achieving state-of-the-art performance on SWE-bench (72.7%),...

Entrada

$3 /M

Saída

$15 /M

Contexto

200K

Saída máx.

64K

Vision

Suportado

Uso de ferramentas

Suportado

Experimente Claude Sonnet 4 no WaveSpeedAI

Acesse Claude Sonnet 4 através da nossa API unificada — compatível com OpenAI, sem inicializações a frio, preços transparentes.

Perguntas frequentes sobre Claude Sonnet 4

Quanto custa Claude Sonnet 4 via API?+

Preços no WaveSpeedAI: $3.00 por milhão de tokens de entrada e $15.00 por milhão de tokens de saída. Prompt caching e batch processing são cobrados separadamente e reduzem o custo efetivo em cargas longas e repetitivas.

Qual é a janela de contexto do Claude Sonnet 4?+

Claude Sonnet 4 suporta até 200K tokens de contexto e até 64K tokens de saída por requisição.

Claude Sonnet 4 é compatível com OpenAI?+

O WaveSpeedAI disponibiliza Claude Sonnet 4 em https://llm.wavespeed.ai/v1 pela interface Chat Completions compatível com OpenAI. Na maioria dos clientes OpenAI SDK, basta alterar a base URL e a chave API; campos opcionais dependem do modelo.

Como começo a usar o Claude Sonnet 4?+

Entre no WaveSpeedAI, crie uma chave API em Access Keys e envie uma requisição para https://llm.wavespeed.ai/v1/chat/completions com o model id mostrado acima. Consulte o catálogo atual para disponibilidade, recursos e preços.

APIs LLM relacionadas

Claude Sonnet 4 | Anthropic LLM API Pricing & Performance | WaveSpeedAI