392 pages for import.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
errors
Claude Developer Platform · in the page
api/errors
…uest ID:", response.Header.Get("request-id")) ``` ```java Java import com.anthropic.client.AnthropicClient; import com.anthropic.client.okhttp.AnthropicOkHttpClient; import com.anthropic.co…
Messages
Claude Developer Platform · in the page
api/messages
…will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema. - `eager_input_streaming: optional boolean or null` Enable eager inpu…
Batches
Claude Developer Platform · in the page
api/messages/batches
…will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema. - `eager_input_streaming: optional boolean or null` Enable ea…
Create a Message Batch
Claude Developer Platform · in the page
api/messages/batches/create
…will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema. - `eager_input_streaming: optional boolean or null` Enable ea…
Count tokens in a Message
Claude Developer Platform · in the page
api/messages/count_tokens
…will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema. - `eager_input_streaming: optional boolean or null` Enable eager inpu…
Create a Message
Claude Developer Platform · in the page
api/messages/create
…will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema. - `eager_input_streaming: optional boolean or null` Enable eager inpu…
Before
Claude Developer Platform · in the page
api/migration-2026-10-21
…cs/anthropic-sdk-go/v2`. A new major version of a Go module has a new import path, so change each import of `github.com/anthropics/anthropic-sdk-go`, and of its packages such as `github.com/anthropics…
Message Batches API
Claude Developer Platform · in the page
build-with-claude/batch-processing
…``` ```python Python from anthropic.types.message_create_params import MessageCreateParamsNonStreaming from anthropic.types.messages.batch_create_params import Request client = anthropic.An…
citations
Claude Developer Platform · in the page
build-with-claude/citations
…document mentions " }, { "type": "text", "text": "important findings", "citations": [ { "type": "content_block_location", "cited_text": "These are…
claude-in-amazon-bedrock
Claude Developer Platform · in the page
build-with-claude/claude-in-amazon-bedrock
…DK. </Tab> <Tab title="Python"> ```python from anthropic import AnthropicBedrockMantle client = AnthropicBedrockMantle(aws_region="us-east-1") message = client.messages.create(…
claude-in-microsoft-foundry
Claude Developer Platform · in the page
build-with-claude/claude-in-microsoft-foundry
…message '{role: user, content: "Hello!"}' ``` ```python Python import os from anthropic import AnthropicFoundry client = AnthropicFoundry( api_key=os.environ.get("ANTHROPIC_FOUNDRY_A…
anthropic-managed
Claude Developer Platform · in the page
build-with-claude/claude-models-on-google-cloud/anthropic-managed
…e with Claude Models on Google Cloud (Anthropic managed), replace its import and client constructor with the ones in the following examples. For a cURL sample, apply the three differences listed earli…
google-managed
Claude Developer Platform · in the page
build-with-claude/claude-models-on-google-cloud/google-managed
…gle managed). </CodeGroupItem> ```python Python from anthropic import AnthropicVertex project_id = "MY_PROJECT_ID" region = "global" client = AnthropicVertex(project_id=project_id, regi…
claude-on-amazon-bedrock-legacy
Claude Developer Platform · in the page
build-with-claude/claude-on-amazon-bedrock-legacy
…1.0</version> </dependency> ``` ```java Java import com.anthropic.client.AnthropicClient; import com.anthropic.client.okhttp.AnthropicOkHttpClient; import com.anth…
claude-platform-on-aws
Claude Developer Platform · in the page
build-with-claude/claude-platform-on-aws
…```python Python from token_generator_for_aws_external_anthropic import TokenGenerator from anthropic import AnthropicAWS token = TokenGenerator(region="us-west-2").get_token() client = A…
sent_count = len(messages sent in the compaction request)
Claude Developer Platform · in the page
build-with-claude/compaction
…response.ToParam()) fmt.Println(response) ``` ```java Java import com.anthropic.models.beta.messages.BetaContextManagementConfig; import com.anthropic.models.beta.messages.BetaCompact2026…
compaction-background
Claude Developer Platform · in the page
build-with-claude/compaction-background
…up exclude="shell, php"> ```python Python from concurrent.futures import Future, ThreadPoolExecutor import anthropic from anthropic.types.beta import BetaMessage, BetaMessageParam client =…
compaction-keep-recent-turns
Claude Developer Platform · in the page
build-with-claude/compaction-keep-recent-turns
…Group exclude="shell"> ```python Python from anthropic.types.beta import BetaMessageParam client = anthropic.Anthropic() # Set this near your real input budget. It is low here so a short con…
compaction-on-demand
Claude Developer Platform · in the page
build-with-claude/compaction-on-demand
…ummarize YAML ``` ```python Python from anthropic.types.beta import BetaMessageParam client = anthropic.Anthropic() history: list[BetaMessageParam] = [ { "role": "user",…
compaction-thinking-blocks
Claude Developer Platform · in the page
build-with-claude/compaction-thinking-blocks
…Group exclude="shell"> ```python Python from anthropic.types.beta import BetaMessageParam, BetaThinkingConfigParam client = anthropic.Anthropic() # Claude Fable 5.1 is the first model that c…
compaction-threshold
Claude Developer Platform · in the page
build-with-claude/compaction-threshold
…response.ToParam()) fmt.Println(response) ``` ```java Java import com.anthropic.models.beta.messages.BetaContextManagementConfig; import com.anthropic.models.beta.messages.BetaCompact2026…
context-editing
Claude Developer Platform · in the page
build-with-claude/context-editing
…log.Fatal(err) } fmt.Println(response) ``` ```java Java import com.anthropic.models.beta.messages.BetaWebSearchTool20250305; import com.anthropic.models.beta.messages.BetaContextManage…
context-windows
Claude Developer Platform · in the page
build-with-claude/context-windows
…known as *context rot*. This makes curating what's in context just as important as how much space is available. <Tip> For more on why long contexts degrade and how to engineer around it, see [Effec…
effort
Claude Developer Platform · in the page
build-with-claude/effort
…ok { fmt.Println(textBlock.Text) } } ``` ```java Java import com.anthropic.models.messages.OutputConfig; void main() { AnthropicClient client = AnthropicOkHttpClient.fromEnv()…
This will automatically use the environment variable VOYAGE_API_KEY.
Claude Developer Platform · in the page
build-with-claude/embeddings
…embedding lookup speed and end-to-end latency. This is a particularly important consideration for large-scale production deployments. * Customization: options for continued training on private data, o…
extended-thinking
Claude Developer Platform · in the page
build-with-claude/extended-thinking
…Printf("\nResponse: %s", block.Text) } } ``` ```java Java import com.anthropic.client.okhttp.AnthropicOkHttpClient; import com.anthropic.models.messages.MessageCreateParams; import com…
fast-mode
Claude Developer Platform · in the page
build-with-claude/fast-mode
…panic(err) } fmt.Println(message) } ``` ```java Java import com.anthropic.errors.InternalServerException; import com.anthropic.errors.RateLimitException; // ... // Disable SDK a…
files
Claude Developer Platform · in the page
build-with-claude/files
…ext": print(block.text) ``` ```typescript TypeScript import fs from "node:fs/promises"; // ... const client = new Anthropic(); // Read the text file const textContent = await…
handling-stop-reasons
Claude Developer Platform · in the page
build-with-claude/handling-stop-reasons
…l valid but was limited by context window } ``` ```java Java import com.anthropic.models.beta.messages.BetaMessage; import com.anthropic.models.beta.messages.BetaStopReason; import com.an…
mid-conversation-effort-example
Claude Developer Platform · in the page
build-with-claude/mid-conversation-effort-example
…lf. <CodeGroup exclude="shell:cURL, shell:CLI"> ```python Python import atexit import concurrent.futures import hashlib import json import os import shutil import subprocess import…
mid-conversation-system-messages
Claude Developer Platform · in the page
build-with-claude/mid-conversation-system-messages
…ok { fmt.Println(textBlock.Text) } } ``` ```java Java import com.anthropic.models.beta.AnthropicBeta; import com.anthropic.models.beta.messages.BetaMessage; import com.anthropic.mo…
multilingual-support
Claude Developer Platform · in the page
build-with-claude/multilingual-support
…s for this evaluation ensures high-quality translations, particularly important for languages with fewer digital resources. </Note> *** ## Set the response language Claude infers the response langu…
overview
Claude Developer Platform · in the page
build-with-claude/overview
…n) | Extended 1-hour cache duration for less frequently accessed but important context, complementing the standard 5-minute cache.…
pdf-support
Claude Developer Platform · in the page
build-with-claude/pdf-support
…egacy), there are two distinct document processing modes: <Note> **Important:** To access Claude's full visual PDF understanding capabilities in the Converse API, you must enable citations. Without…
preserved-thinking
Claude Developer Platform · in the page
build-with-claude/preserved-thinking
…s: %d\n", len(response.InputTransformations)) ``` ```java Java import com.anthropic.models.beta.AnthropicBeta; import com.anthropic.models.beta.messages.BetaMessage; import com.anthropic.mo…
Request 2 caches its request content (not the response)
Claude Developer Platform · in the page
build-with-claude/prompt-caching
…) } fmt.Println(response.Usage.RawJSON()) ``` ```java Java import com.anthropic.models.messages.CacheControlEphemeral; // ... public class PromptCachingExample { public static vo…
claude-prompting-best-practices
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/claude-prompting-best-practices
…your instructions, such as explaining to Claude why such behavior is important, can give Claude more information about your goals and help it deliver more targeted responses. <Accordion title="Examp…
Delivering work
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-fable-5-1
…e nudge follows it. <CodeGroup exclude="shell"> ```python Python import anthropic from anthropic.types.beta import ( BetaMessageParam, BetaToolParam, BetaToolResultBlockParam,…
prompting-claude-opus-4-8
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-4-8
…rough the problem before responding. ``` Effort is likely to be more important for this model than for any prior Opus, so experiment with it actively when you upgrade. On Claude Opus 4.8, thinking i…
prompting-claude-opus-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-5
…o do. While working, give a brief update only when you find something important or change direction. When you finish, lead with the outcome: your first sentence should answer "what happened" or "what…
prompting-claude-sonnet-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-sonnet-5
…users. When limiting the number of required user interactions, it's important to specify the task, intent, and relevant constraints upfront in the first human turn. Providing well-specified, clear,…
refusals-and-fallback
Claude Developer Platform · in the page
build-with-claude/refusals-and-fallback
…back-credit). </CodeGroupItem> ```python Python from anthropic import Anthropic, BetaFallbackState, BetaRefusalFallbackMiddleware # On a refusal, the middleware retries on the listed fallbac…
search-results
Claude Developer Platform · in the page
build-with-claude/search-results
…ntent). </CodeGroupItem> ```python Python from anthropic.types import ( MessageParam, TextBlockParam, SearchResultBlockParam, ToolResultBlockParam, ) client = Anthr…
skills-guide
Claude Developer Platform · in the page
build-with-claude/skills-guide
…log.Fatal(err) } fmt.Println(response) ``` ```java Java import com.anthropic.models.messages.ContainerParams; import com.anthropic.models.messages.SkillParams; import com.anthropic.m…
structured-outputs
Claude Developer Platform · in the page
build-with-claude/structured-outputs
…``` </Tab> <Tab title="Python"> ```python from pydantic import BaseModel # ... class ContactInfo(BaseModel): name: str email: str plan_interest: str…
thinking
Claude Developer Platform · in the page
build-with-claude/thinking
…fmt.Printf("\nResponse: %s", v.Text) } } ``` ```java Java import com.anthropic.models.messages.ThinkingConfigAdaptive; void main() { AnthropicClient client = AnthropicOkHttpClient…
thinking-steering-and-cost
Claude Developer Platform · in the page
build-with-claude/thinking-steering-and-cost
…/prompt-caching) page. </CodeGroupItem> ```python Python import requests client = Anthropic() def fetch_article_content(url): text = requests.get(url).text line…
thinking-tool-workflows
Claude Developer Platform · in the page
build-with-claude/thinking-tool-workflows
…} fmt.Println(response) ``` ```java Java import com.anthropic.models.messages.ThinkingConfigAdaptive; // ... AnthropicClient client = AnthropicOkHttpClient…
token-counting
Claude Developer Platform · in the page
build-with-claude/token-counting
…log.Fatal(err) } fmt.Println(response) ``` ```java Java import com.anthropic.models.messages.MessageCountTokensParams; import com.anthropic.models.messages.MessageTokensCount; // ...…
vision
Claude Developer Platform · in the page
build-with-claude/vision
…], ) print(message.content) ``` ```typescript TypeScript import Anthropic, { toFile } from "@anthropic-ai/sdk"; import fs from "node:fs"; const anthropic = new Anthropic(); // Upl…