Claude Sonnet API
Add Claude Sonnet, Anthropic's best balance of speed and intelligence, to your app. Access every Sonnet model through a single API with Puter.js — no API keys, no backend.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.chat("Explain quantum computing in simple terms", {
model: "anthropic/claude-sonnet-4-6"
}).then(response => {
console.log(response.message.content);
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat("Explain quantum computing in simple terms", {
model: "anthropic/claude-sonnet-4-6"
}).then(response => {
document.body.innerHTML = response.message.content;
});
</script>
</body>
</html>
The Sonnet API for Production Workloads
Speed Meets Intelligence
Sonnet pairs frontier-class quality with fast responses, the workhorse for daily use and scaled production.
Cost-Efficient at Scale
Opus-level performance on many tasks at a fraction of the cost, ideal for high-volume, latency-sensitive apps.
Strong Coding & Agents
Tops real-world coding and agentic benchmarks, built for autonomous agents and multi-step workflows.
1M-Token Context
Fit entire codebases, long documents, and extended conversations into a single context window of up to one million tokens.
Vision & PDF Input
Send images and PDFs alongside text for document analysis, extraction, and vision-heavy pipelines.
Long-Running Agents
Reliable tool calling and computer use across long-horizon tasks, with adjustable thinking effort.
Claude Sonnet Models Compared
Every Claude Sonnet model available through Puter.js, with context, output limits, and per-million-token pricing. Click a model for full specs and examples.
| Model | Context | Max Output | Input / 1M | Output / 1M |
|---|---|---|---|---|
Claude Sonnet 4.6
anthropic/claude-sonnet-4-6 |
1M | 64K | $3 | $15 |
Claude Sonnet 4.5
anthropic/claude-sonnet-4-5 |
200K | 64K | $3 | $15 |
Claude Sonnet 4
anthropic/claude-sonnet-4 |
200K | 64K | $3 | $15 |
Claude 3.7 Sonnet (Thinking) (legacy)
anthropic/claude-3.7-sonnet:thinking |
200K | 64K | $3 | $15 |
Claude 3.7 Sonnet (legacy)
anthropic/claude-3-7-sonnet |
200K | 8K | $3 | $15 |
Claude 3.5 Sonnet (legacy)
anthropic/claude-3-5-sonnet |
200K | 8K | $3 | $15 |
Which Claude Sonnet Model Should You Use?
Pick the Claude Sonnet model that fits your workload — capability, latency, or cost.
Claude Sonnet 4.6
Claude Sonnet 4.6 is Anthropic's best balance of speed and intelligence, built for scaled production, agents, and coding, with a 1M-token context window. Use it as your default for everyday production workloads.
View Claude Sonnet 4.6 →Claude Sonnet 4.5
Other versions like Claude Sonnet 4.5 stay available for pinned, reproducible deployments and cost-sensitive workloads that don't need the very latest model.
View Claude Sonnet 4.5 →Use Claude Sonnet in Seconds
Add Claude Sonnet to your app with just a few lines of code.
No API keys, no backend, no configuration required.
// npm install @heyputer/puter.js
import { puter } from '@heyputer/puter.js';
puter.ai.chat("Explain quantum computing in simple terms", {
model: "anthropic/claude-sonnet-4-6"
}).then(response => {
console.log(response.message.content);
});
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat("Explain quantum computing in simple terms", {
model: "anthropic/claude-sonnet-4-6"
}).then(response => {
document.body.innerHTML = response.message.content;
});
</script>
</body>
</html>
How Claude Sonnet Performs
Claude Sonnet 4.6 on standard evaluations, scored by Artificial Analysis.
Frequently Asked Questions
The Claude Sonnet API gives you access to Anthropic's best balance of speed and intelligence, built for scaled production, agents, and coding — including Claude Sonnet 4.6 — through Puter.js. You can call any Claude Sonnet model from your app with no API keys and no backend.
Yes, it is free for you as the developer when you use it through Puter.js. With the User-Pays model, each of your users covers their own usage through their Puter account, so you can ship Claude Sonnet-powered apps at no cost to you.
Start with Claude Sonnet 4.6 as your default. Other versions like Claude Sonnet 4.5 suit pinned, cost-aware deployments.
Claude Sonnet 4.6 is priced at $3 per million input tokens and $15 per million output tokens at the API level. Through Puter.js it is free for developers under the User-Pays model.
Claude Sonnet 4.6 supports a context window of 1M tokens and can generate up to 64K tokens in a single response.
No. Puter.js handles authentication and infrastructure for you, so you can use the Claude Sonnet API without any API key, an Anthropic account, a server, or any configuration.
Yes — the Claude Sonnet API through Puter.js works with any JavaScript framework, Node.js, or plain HTML. Just include the library and start building.
Related Resources
Learn how to use Claude Sonnet and other models with Puter.js.