Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial
HomeDocsSearch
Search the documentation

1,300 pages for code.

Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.

mid-conversation-system-messages Claude Developer Platform · in the page build-with-claude/mid-conversation-system-messages …ls` returns a 400 error (on the Claude API, with `error.details.error_code` set to `tool_reference_unresolved`). A `tool_addition` block can instead [carry the tool's full definition](https://platform… multilingual-support Claude Developer Platform · in the page build-with-claude/multilingual-support …h keeps the instruction stable across every turn of a conversation. <CodeGroup> ```bash cURL curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-k… overview Claude Developer Platform · in the page build-with-claude/overview …| Up to 1M tokens for processing large documents, extensive code bases, and long conversations.… pdf-support Claude Developer Platform · in the page build-with-claude/pdf-support …ways: 1. As a URL reference to a PDF hosted online 2. As a base64-encoded PDF in `document` content blocks 3. By a `file_id` from the [Files API](https://platform.claude.com/docs/en/build-with-claud… preserved-thinking Claude Developer Platform · in the page build-with-claude/preserved-thinking …tegration append-only regardless of your account's age**, so the same code works on every account, including newer accounts enforced by default. ## Who needs to change anything Nothing changes for y… Request 2 caches its request content (not the response) Claude Developer Platform · in the page build-with-claude/prompt-caching …gets cached. The simplest way to start is with automatic caching: <CodeGroup> ```bash cURL curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-k… claude-prompting-best-practices Claude Developer Platform · in the page build-with-claude/prompt-engineering/claude-prompting-best-practices …tone for your use case. Even a single sentence makes a difference: <CodeGroup> ```bash cURL curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-k… prompting-claude-fable-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-fable-5 …utput on financial analysis, spreadsheets, slides, and documents. * **Code review and debugging.** Bug-finding recall (outside the cybersecurity domains the safety classifiers cover) is noticeably hig… Delivering work Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-fable-5-1 …tool results, and a fresh turn-scoped copy of the nudge follows it. <CodeGroup exclude="shell"> ```python Python import anthropic from anthropic.types.beta import ( BetaMessageParam,… prompting-claude-haiku-5-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-haiku-5-5 …ting-claude-haiku-5-5#prevent-early-stopping-in-long-agent-prompts) * Code changes are reported as done without a check that exercises them: [Tell coding agents to verify their changes](https://platfo… prompting-claude-opus-4-8 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-opus-4-8 …t in the [frontend-design skill](https://github.com/anthropics/claude-code/blob/main/plugins/frontend-design/skills/frontend-design/SKILL.md). However, Claude Opus 4.8 generates distinctive, creative… prompting-claude-opus-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-opus-5 …le-turn edits, where the difference from prior models is smaller. * **Code review and bug-finding:** Claude Opus 5 reviews code with high precision and recall: it finds real bugs at a high rate per pa… prompting-claude-opus-5-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-opus-5-5 …abilities that matter most for prompting are: * **Agentic coding and code review:** The model is strongest on multistep work in a real repository, such as carrying a change through a large code base… prompting-claude-sonnet-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-sonnet-5 …mpt. The [frontend-design skill](https://github.com/anthropics/claude-code/blob/main/plugins/frontend-design/skills/frontend-design/SKILL.md) provides a fuller treatment, but this snippet works well a… prompting-claude-sonnet-5-5 Claude Developer Platform · in the page build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5 …rompting-claude-sonnet-5-5#mid-turn-user-messages-and-task-budgets) * Code changes are reported as done without a test or build run: [Verification on coding tasks](https://platform.claude.com/docs/en/… refusals-and-fallback Claude Developer Platform · in the page build-with-claude/refusals-and-fallback ….com/docs/en/build-with-claude/refusals-and-fallback#manual-retry). <CodeGroup> ```bash cURL curl --fail-with-body -sS https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KE… search-results Claude Developer Platform · in the page build-with-claude/search-results …e retrieval step runs every time. ### Example: Knowledge base tool <CodeGroup exclude="shell"> <CodeGroupItem language="cURL"> The tool-calling flow needs search logic in your application, whi… skills-guide Claude Developer Platform · in the page build-with-claude/skills-guide …skills). </Note> Skills integrate with the Messages API through the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool). Whether using pre-built S… streaming Claude Developer Platform · in the page build-with-claude/streaming …c and async streams. See the documentation in each SDK for details. <CodeGroup exclude="shell:cURL"> ```bash CLI ant messages create --stream \ --model claude-opus-5-5 \ --max-tokens 1024… structured-outputs Claude Developer Platform · in the page build-with-claude/structured-outputs …lper that validates responses still enforces every constraint in your code. **Example:** A field with `minimum: 100` becomes a plain integer in the sent schema, and the SDK adds `{minimum: 100}` to t… task-budgets Claude Developer Platform · in the page build-with-claude/task-budgets …Add `task_budget` to `output_config` and include the beta header: <CodeGroup> ```bash cURL curl https://api.anthropic.com/v1/messages \ -N \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H… thinking Claude Developer Platform · in the page build-with-claude/thinking …ed"` so the thinking text is visible, and use a large `max_tokens`: <CodeGroup> ```bash cURL curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropi… thinking-steering-and-cost Claude Developer Platform · in the page build-with-claude/thinking-steering-and-cost …f: <Accordion title="Effort changes invalidate the prompt cache"> <CodeGroup exclude="shell:cURL, shell:CLI"> <CodeGroupItem language="cURL"> This workflow needs more logic than a single… thinking-tool-workflows Claude Developer Platform · in the page build-with-claude/thinking-tool-workflows …ing-thinking-blocks); this page shows those rules applied in runnable code. ## The rules this walkthrough applies Each link leads to the full statement on the Thinking page: * [Limit tool choice to… thinking-troubleshooting Claude Developer Platform · in the page build-with-claude/thinking-troubleshooting …d back differs from the one the API returned, most often because your code filters content blocks by type and drops `redacted_thinking` blocks, or rebuilds the assistant message instead of echoing it.… token-counting Claude Developer Platform · in the page build-with-claude/token-counting …gents-and-tools/tool-use/server-tools) such as web search, web fetch, code execution, and tool search (every server tool except the [advisor tool](https://platform.claude.com/docs/en/agents-and-tools/… vision Claude Developer Platform · in the page build-with-claude/vision …image` content blocks using one of three source types: 1. A base64-encoded image embedded in the request body 2. A URL reference to an image hosted online 3. A `file_id` returned by the [Files API](h… vision-coordinates Claude Developer Platform · in the page build-with-claude/vision-coordinates …`1000`."* Always ask for pixel coordinates and normalize in your own code if you need to. To get coordinates as machine-readable JSON instead of prose, define a schema with [structured outputs](https… working-with-messages Claude Developer Platform · in the page build-with-claude/working-with-messages …/models/opus-5-5/migration-guide#opus-46-breaking-changes). </Note> <CodeGroup> ```bash cURL #!/bin/sh curl https://api.anthropic.com/v1/messages \ -H "x-api-key: $ANTHROPIC_API_KEY" \… API usage primer for Claude Claude Developer Platform · in the page claude_api_primer …-5-20251001 ``` ## Calling the API ### Basic request and response <CodeGroup exclude="shell:cURL, typescript, csharp, go, java, php, ruby"> ```bash CLI ant messages create \ --model claude-… apply Claude Developer Platform · in the page cli-sdks-libraries/cli/apply --- title: Manage resources as code with ant apply url: https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply description: Declare agents, environments, skills, memory stores, deployments,… On a remote host without a browser: Claude Developer Platform · in the page cli-sdks-libraries/cli/authentication …pass `--no-browser` to print the authorize URL and paste the returned code back into the terminal. ```bash CLI ant auth login # On a remote host without a browser: ant auth login --no-browser # Bin… quickstart Claude Developer Platform · in the page cli-sdks-libraries/cli/quickstart …bodies </Card> <Card title="CLI scripting and automation" icon="code" href="https://platform.claude.com/docs/en/cli-sdks-libraries/cli/scripting"> Version control for API resources, scriptin… scripting Claude Developer Platform · in the page cli-sdks-libraries/cli/scripting …, chain ant CLI commands in scripts, operate on resources from Claude Code, and authenticate curl calls with CLI credentials. --- This page covers task-oriented workflows built on the `ant` CLI. For… using Claude Developer Platform · in the page cli-sdks-libraries/cli/using …is scanned document."} ]}' ``` The CLI detects the file type and encodes binary files as base64 automatically. To force a specific encoding use `@file://` for plain text or `@data://` for base64. E… apple-foundation-models Claude Developer Platform · in the page cli-sdks-libraries/libraries/apple-foundation-models …e Foundation Models framework supports server-side language models * Xcode 27 (beta) * A Claude API key from the [Claude Console](https://platform.claude.com/) for development. See [Authentication](ht… openai-sdk Claude Developer Platform · in the page cli-sdks-libraries/libraries/openai-sdk …r that lets you use the OpenAI SDK to test the Claude API. With a few code changes, you can evaluate Anthropic model capabilities. --- <Note> This compatibility layer is primarily intended to test… middleware Claude Developer Platform · in the page cli-sdks-libraries/middleware …ude SDK provides a middleware (or interceptor) hook that lets you run code before a request is sent and after the response is received. Use middleware for cross-cutting concerns such as logging, custo… overview Claude Developer Platform · in the page cli-sdks-libraries/overview …DK surface </Card> </CardGroup> ## Building agents or using Claude Code? The CLI, client SDKs, and libraries are for calling the Claude API yourself: you send each request and handle each response… csharp Claude Developer Platform · in the page cli-sdks-libraries/sdks/csharp …lications written in C#. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers C#-specific SDK feature… go Claude Developer Platform · in the page cli-sdks-libraries/sdks/go …lications written in Go. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers Go-specific SDK feature… java Claude Developer Platform · in the page cli-sdks-libraries/sdks/java …asynchronous operations. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers Java-specific SDK featu… php Claude Developer Platform · in the page cli-sdks-libraries/sdks/php …PHP 8.1.0+ application. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers PHP-specific SDK featur… For Amazon Bedrock support Claude Developer Platform · in the page cli-sdks-libraries/sdks/python …, and Microsoft Foundry. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers Python-specific SDK fea… Automatically handles tool execution loop Claude Developer Platform · in the page cli-sdks-libraries/sdks/ruby …e `connection_pool` gem. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers Ruby-specific SDK featu… typescript Claude Developer Platform · in the page cli-sdks-libraries/sdks/typescript …ypeScript or JavaScript. <Info> For API feature documentation with code examples, see the [API reference](https://platform.claude.com/docs/en/api/overview). This page covers TypeScript-specific SDK… get-started Claude Developer Platform · in the page get-started …to get a URL you can open on another device, then paste the returned code back into the terminal. For non-interactive environments such as CI, see [CLI authentication options](https://platform.claude… home Claude Developer Platform · in the page home …key in Claude Console </HomeQuickChip> <HomeQuickChip icon="CodeBrackets" href="https://platform.claude.com/docs/en/api/overview"> API reference </HomeQuickChip> ```python Pyt… intro Claude Developer Platform · in the page intro …create your API key. Keep the key out of source control, client-side code, and prompts. Check whether your workload can use Workload Identity Federation instead of a static key. [Read the authen… access-transparency Claude Developer Platform · in the page manage-claude/access-transparency …ccess occurs only for safety review or incident response. See [Reason codes](https://platform.claude.com/docs/en/manage-claude/access-transparency#reason-codes). Access Transparency is available to…
Feedback