# Claude Sonnet 4.6 Model id on AIHubMix: `claude-sonnet-4-6` Create an API key: https://console.aihubmix.com/ > Claude Sonnet 4.6 delivers frontier intelligence at scale—built for coding, agents, and enterprise workflows. Use cases include: Agents: Sonnet 4.6 excels at complex, multi-step tasks requiring sustained reasoning and adaptive decision-making—ideal for workflows where reliability and autonomy matter most. Coding: Sonnet 4.6 is built for iterative development work, handling complex codebases without losing quality as you guide it through building, refactoring, and debugging. It can compress multi-day projects into hours with the technical depth to deliver production-ready solutions. Enterprise workflows: Sonnet 4.6 powers agents that manage professional projects from start to finish, leveraging memory to maintain context across files with a step-change improvement in creating spreadsheets, slides, and docs. Financial analysis: Sonnet 4.6 connects the dots across regulatory filings, market reports, and internal data—enabling sophisticated modeling and proactive compliance. Cybersecurity: Sonnet 4.6 brings professional-grade analysis to security workflows, correlating logs, vulnerability databases, and threat intelligence for proactive threat detection and automated incident response. Computer use: Sonnet 4.6 delivers confident, consistent navigation with more human-like browsing—enabling better web QA, workflow automation, and advanced user experiences. - Developer: Anthropic - Context window: 1,000,000 tokens - Input modalities: text, image - Capabilities: Thinking, Streaming, Tool calling, Web search, Code interpreter, Computer use, Memory tool, Structured outputs, Citations, Prompt caching - Pricing: $3/M input tokens, $15/M output tokens ## Endpoints (base URL: https://aihubmix.com) - `POST /v1/chat/completions` — OpenAI Chat Completions (`Authorization: Bearer $AIHUBMIX_API_KEY`) - `POST /gemini/v1beta/models/claude-sonnet-4-6:generateContent` — Google Gemini (`x-goog-api-key: $AIHUBMIX_API_KEY`; streaming: `:streamGenerateContent?alt=sse`) - `POST /v1/messages` — Anthropic Messages (`x-api-key: $AIHUBMIX_API_KEY` + `anthropic-version: 2023-06-01`) ## Example ```bash curl -s https://aihubmix.com/v1/chat/completions \ -H "Authorization: Bearer $AIHUBMIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"Hello"}]}' ``` ## Response Without `stream`, `/v1/chat/completions` returns a standard Chat Completions object: ```json {"id":"...","object":"chat.completion","model":"claude-sonnet-4-6","choices":[{"message":{"role":"assistant","content":"..."}}],"usage":{"prompt_tokens":12,"completion_tokens":24,"total_tokens":36}} ``` With `"stream": true` the response is `text/event-stream`: read each `data:` JSON chunk until `data: [DONE]`. The Messages and Gemini endpoints return their protocols' native response shapes (Anthropic / Google). ## Errors Error responses carry a `tid` (trace id) — include it when contacting support. Reference: https://docs.aihubmix.com/en/FAQs/HTTP-Codes.md - 400 — parameter error; most are passed through from the upstream provider (media: `prompt_missing`, `size_not_supported`, `n_not_within_range`, …) - 401 — missing `Authorization` header, or the key is invalid/expired - 403 — `insufficient_user_quota` (top up at https://console.aihubmix.com/), account suspended, or this key is not allowed to use this model - 429 — rate limited; back off and retry - 503 — no channel can serve the request (check the model id and your access), or the upstream provider is throttling; retry later ## More - Model page: https://aihubmix.com/model/claude-sonnet-4-6 - Try in browser: https://playground.aihubmix.com/?model=claude-sonnet-4-6 - Compare with another model (human-facing, side-by-side specs and pricing): https://aihubmix.com/compare/claude-sonnet-4-6/{other_model_id} - Full parameter schema (machine-readable, authoritative): https://aihubmix.com/model-data/models/claude-sonnet-4-6.be16dab3.json — per-protocol parameters with types, ranges, enums and defaults. Refreshed together with this page; if it ever 404s, re-resolve via `https://aihubmix.com/model-data/index.json` (find this id, fetch its `path`) - Generate runnable code programmatically: npm `@aihubmix/codegen` — the generator behind the Playground's "Get Code" (4 protocols × 7 languages, media endpoints included); the body it builds is the exact wire body the Playground sends, so generated snippets and real requests cannot diverge. `@aihubmix/model-schema` (npm) translates the parameter schema above into codegen input - Site index for agents: https://aihubmix.com/llms.txt · Onboarding: https://aihubmix.com/agents.md --- Canonical version of this document: https://aihubmix.com/model/claude-sonnet-4-6/llms.txt