Claude 3 Haiku
Claude 3 Haiku handles enterprise document workloads at a fraction of Opus-tier cost, serving as the speed-and-affordability anchor of the Claude 3 family.
View API reference- Input and output price
- Prices from: Input $0.25, Output $1.25, Per 1M tokens
- 24h uptime
- Loading AI Gateway uptime
import { streamText } from 'ai'
const result = streamText({ model: 'anthropic/claude-3-haiku', prompt: 'Why is the sky blue?'})Copy link to headingPlayground
Try out Claude 3 Haiku by Anthropic. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Claude 3 Haiku
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Copy link to headingUptime24 hours
Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.
Copy link to headingThroughput24 hours
P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.
Copy link to headingLatency24 hours
P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.
Getting started
Call Claude 3 Haiku through AI Gateway with the AI SDK generateText and streamText functions, or through the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages APIs by changing the base URL. AI Gateway authenticates the request and routes it to an available provider.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the text generation quickstart.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'anthropic/claude-3-haiku', prompt: 'Why is the sky blue?', });
console.log(result.text);}
main().catch(console.error);Top-level parameters
The same Claude 3 Haiku request in each API format AI Gateway supports.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'anthropic/claude-3-haiku', system: 'You are a concise technical assistant.', prompt: 'Summarize the tradeoffs between static generation and SSR.', maxOutputTokens: 1024, temperature: 0.5, });
console.log(result.text);}
main().catch(console.error);Standard parameters like prompt, messages, temperature, and tools work as documented in the AI SDK docs. These are the parameters with model-specific behavior.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model ID in the form creator/model, e.g. anthropic/claude-3-haiku. AI Gateway routes the request to an available provider. |
maxOutputTokens | number | No | Hard cap on generated tokens. Claude 3 Haiku supports up to 4,096 output tokens. |
providerOptions | Record<string, JSONValue> | No | AI Gateway routing options under gateway, plus any provider-native options under the provider’s own namespace — see the table below. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Text | — | — | — | — | Prompt and response share the 200K-token context window |
| Image | — | URL, base64, Uint8Array | — | — | Sent as image parts in messages; counts as input tokens |
Provider options
Set AI Gateway routing options under providerOptions.gateway. For provider-specific options, pass them under the provider’s namespace as documented by the AI SDK.
Learn more in the AI SDK anthropic provider docs.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'anthropic/claude-3-haiku', prompt: 'Why is the sky blue?', providerOptions: { gateway: { only: ['bedrock', 'vertexAnthropic'], }, }, });
console.log(result.text);}
main().catch(console.error);These AI Gateway routing options apply to every model. Provider-specific options pass through under the provider’s own namespace (for example providerOptions.anthropic) exactly as documented by the AI SDK.
| Parameter | Type | Required | Description |
|---|---|---|---|
providerOptions.gateway.only | string[] | No | Restrict routing to these provider slugs. Requests fail over only within the listed providers. |
providerOptions.gateway.order | string[] | No | Preferred provider order. Listed providers are tried first; unlisted providers remain available as fallbacks. |
providerOptions.gateway.sort | 'cost' | 'ttft' | 'tps' | No | Rank candidate providers by price, time to first token, or tokens per second instead of the default routing order. |
providerOptions.gateway.zeroDataRetention | boolean | No | Route only to providers with a zero-data-retention policy for this model. |
Routing across providers
AI Gateway serves the same model through multiple providers and fails over automatically. order expresses a preference while keeping every provider eligible; only is a hard allowlist — if none of the listed providers are available the request fails instead of falling back.
Options under a provider's own namespace (for example providerOptions.anthropic) are forwarded to that provider with the request. Providers ignore option namespaces that don't apply to them, so it is safe to set provider options alongside gateway routing options.
Image input
Send images alongside text as message parts. Images count as input tokens.
import { generateText } from 'ai';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'anthropic/claude-3-haiku', messages: [ { role: 'user', content: [ { type: 'text', text: 'Describe this image.' }, { type: 'image', image: 'https://example.com/photo.jpg' }, ], }, ], });
console.log(result.text);}
main().catch(console.error);Tool calling
Expose tools the model can call. Define each tool’s inputs with a Zod schema.
import { generateText, tool } from 'ai';import { z } from 'zod';import 'dotenv/config';
async function main() { const result = await generateText({ model: 'anthropic/claude-3-haiku', prompt: 'What is the weather in San Francisco?', tools: { getWeather: tool({ description: 'Get the current weather for a location', inputSchema: z.object({ location: z.string() }), execute: async ({ location }) => ({ location, temperatureC: 18 }), }), }, });
console.log(result.text);}
main().catch(console.error);Copy link to headingAbout Claude 3 Haiku
Claude 3 Haiku launched on March 13, 2024 as the fastest, lowest-cost model in the Claude 3 family. Anthropic positioned it alongside Sonnet (mid-tier) and Opus (highest capability). Claude 3 Haiku targets workloads where throughput and cost per token outweigh peak reasoning depth.
Speed defined the release. Anthropic described Claude 3 Haiku as substantially faster than peer models in its performance tier for the majority of workloads, with throughput dropping on prompts that exceed 32K tokens. See live throughput on this page for current numbers.
Anthropic noted a 1:5 input-to-output token ratio at launch.
Claude 3 Haiku ships with the same vision architecture as Sonnet and Opus. It accepts photos, charts, graphs, and technical diagrams as input. Anthropic highlighted document analysis (quarterly filings, contracts, legal cases), responsive customer support chat, and large-dataset annotation as primary use cases. Claude 3 Haiku launched on the Claude API and Amazon Bedrock, with Google Cloud Vertex AI following shortly after.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: Claude 3 Haiku keeps high-volume annotation and chat pipelines economical. Use AI Gateway per-request cost tracking to compare actual spend against Sonnet or newer Haiku generations. See live rates in the pricing panel on this page.
- Zero Data Retention: Zero Data Retention is available for this model. It is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Claude 3 Haiku
Best for
- High-volume document analysis: Processing contracts, filings, and legal cases where throughput drives pipeline feasibility
- Customer support chat: Requiring fast response times and consistent instruction following across long conversation histories
- Image and chart annotation at scale: Using shared Claude 3 vision capabilities at the lowest per-image cost in the family
- Data extraction and labeling pipelines: Cost per token is the binding constraint and mid-tier reasoning suffices
- Enterprise content moderation: Screening large queues of text and images with fast turnaround
Consider alternatives when
- Deep multi-step reasoning: Sonnet or Opus handles complex code generation and deep reasoning better
- Extended thinking or computer use: Those capabilities arrived in later model generations
- Long-context prompts: Haiku's throughput drops on prompts exceeding 32K tokens
- Claude 3.5-era improvements: Claude 3.5 Haiku matches Opus-level benchmarks at comparable speed
Copy link to headingConclusion
Claude 3 Haiku occupies the speed-and-cost floor of the Claude 3 generation. It remains a practical choice for teams running high-volume, latency-sensitive pipelines where the task complexity fits within a fast-tier model's capability range. Later Haiku generations raised the capability ceiling significantly, but the original Claude 3 Haiku still serves workloads optimized for raw throughput.
Copy link to headingFrequently Asked Questions
How fast is Claude 3 Haiku compared to other Claude 3 models?
Anthropic described Claude 3 Haiku as substantially faster than peer models in its performance tier at launch. See live throughput on this page for current numbers.
What happens to Claude 3 Haiku's speed on long prompts?
Prompts exceeding 32K tokens reduce throughput meaningfully. Factor this slowdown into latency estimates if your workload regularly involves long-context inputs.
Can Claude 3 Haiku process images?
Yes. Haiku shares the same vision architecture as Sonnet and Opus. It processes photos, charts, graphs, and technical diagrams. Anthropic highlighted enterprise document analysis and large-scale image annotation as primary vision use cases.
How does Claude 3 Haiku differ from Claude 3.5 Haiku?
Claude 3.5 Haiku matched Claude 3 Opus on many intelligence benchmarks while maintaining Haiku-class speed. The original Claude 3 Haiku is faster on a per-token basis but operates at a lower capability tier. Choose based on whether throughput or reasoning depth matters more.
What is the cost of processing images with Claude 3 Haiku?
Exact per-image cost depends on image resolution and token count. Check the pricing panel on this page for current rates.
How do I authenticate requests to Claude 3 Haiku through AI Gateway?
Configure your Anthropic API key in your AI Gateway project settings. AI Gateway routes requests to
bedrock,vertexand handles authentication, retries, and failover. Use the identifieranthropic/claude-3-haikuin your API calls.Is Claude 3 Haiku suitable for agentic workflows?
Haiku handles structured tool calling and simple multi-step tasks. For complex agentic workflows that require deep planning, later Sonnet or Haiku generations offer stronger instruction following and tool use accuracy.
Your use is subject to Anthropic's Terms & Privacy Policies.