Claude Certified Developer – Foundations

CCDV-F, from Anthropic's partner academy (anthropic-partners.skilljar.com). This page holds a fast high-level overview plus a thorough, code-heavy guide to the Claude developer surface: the Messages API, tool use, streaming, caching, extended thinking, the Batch and Files APIs, the Python/TypeScript SDKs, the Claude Agent SDK, and MCP. Overview items link straight into their deep-dive sections.

$125 USD 53 questions 120 minutes 720/1000 to pass valid 12 months 8 weighted domains
⚡ Open the 1-page Cram Jam sheet

Part 1 — High-Level Overview

What & Why

The Claude Certified Developer – Foundations exam is Anthropic's entry-level credential for engineers who build applications on top of Claude: calling the Messages API directly, wiring up tool use, streaming responses to a UI, managing multi-turn conversations, and choosing between the raw API, an official SDK, the Claude Agent SDK, or Claude Code for a given job. It is a new program, run through Anthropic's academy partner Skilljar rather than a page on anthropic.com/careers-style branding — expect it to evolve faster than a mature vendor exam.

Unlike a scenario-heavy cloud-architecture exam, this is closer to a working-knowledge quiz for API developers: request/response shapes, parameter names, event sequences, and "what does this code do / what's wrong with it" style items are likely to dominate, based on the recommended background (Python or TypeScript fluency, comfort with REST APIs) that third-party write-ups report.

Who it's for Engineers who already write code against REST APIs and want to formalize what they know about the Claude API surface — the Messages API, tool use, streaming, the SDKs, and MCP. It is not a prompt-engineering or AI-safety-policy exam; it is a builder's exam. Full detail in §1 Exam Details.

Exam at a Glance

AttributeValue
Price125 USD
Pre-exam requirementReview the Exam Guide, Certification Terms & Conditions, and Anthropic Certification Exam Policy before your session
Items53, multiple-choice and multiple-response (each item states how many responses to select)
Domains8, weighted — see Official Exam Blueprint below
Time120 minutes
Passing scoreScaled score of 720, on a scale of 100–1,000
Validity12 months from the date the credential is awarded
DeliveryProctored: online proctored and/or test center, per program policy. Scheduled through the Anthropic Partner Academy and Pearson VUE
Result reportingPass/fail with scaled score (100–1,000), plus percent-correct by domain on the score report

→ Deep dive: §1 Exam Details

Official Exam Blueprint

These numbers are quoted directly from Anthropic's official CCDV-F Exam Guide — there is a published, weighted blueprint of eight domains, not just a domain count. The guide is subject to change; re-check the current PDF on anthropic-partners.skilljar.com before booking.

#DomainWeight
1Agents and Workflows14.7%
2Applications and Integration33.1%
3Claude Code3.1%
4Eval, Testing, and Debugging2.6%
5Model Selection and Optimization16.8%
6Prompt and Context Engineering11.0%
7Security and Safety8.1%
8Tools and MCPs10.6%
One domain is a third of the exam Applications and Integration alone is 33.1% — roughly a third of all items — covering API mechanics, application design, software-engineering foundations, and configuration management. Weight your study time accordingly; see the domain map in §0.

Sub-skill weights (where published)

DomainSub-skillWeight
1 · Agents and WorkflowsAgent Architecture4.5%
Agent Construction with Claude5.3%
Agent Patterns and Frameworks4.9%
2 · Applications and IntegrationUnderstanding Requirements3.4%
Systems Life Cycle2.8%
Claude API Mechanics6.8%
Software Engineering Foundations7.4%
Claude Application Design8.6%
Configuration Management4.1%
3 · Claude CodeClaude Code Operation3.1%
4 · Eval, Testing, and DebuggingDebugging and Error Handling2.6%
5 · Model Selection and OptimizationLLM Fundamentals5.2%
Technical Fundamentals6.1%
Model Selection and Tradeoffs2.7%
Cost and Token Management2.8%
6 · Prompt and Context EngineeringContext Engineering3.8%

The remaining sub-skills of Domain 6, and all sub-skills of Domains 7 (Security and Safety) and 8 (Tools and MCPs), were not cleanly extractable from the source PDF — only the domain-level weights above are reliable for those.

The Developer Surface Area

This guide is organized around the actual surface area a Claude developer touches, from the raw HTTP request up to full agents, rather than around the eight official domain names — that organization reads better as a study path. The domain map in §0 ties the two together, so you can also study by blueprint weight. Study the surface area below in this order — each layer depends on the one before it.

Core
Messages API — request/response, roles, content blocks, stop reasons
Extend
Streaming, tool use, structured output, extended thinking
Scale
Prompt caching, Batch API, Files API, rate limits & retries
Build
SDKs, Claude Agent SDK, MCP, production deployment
LayerWhat it coversDeep dive
Messages API fundamentalsStateless request/response shape, roles, content block types, system prompt, sampling params, stop_reason.→ §2
Interaction patternsServer-sent event streaming; tool use / function calling; structured JSON extraction; extended thinking.→ §3–6
Scale & costPrompt caching; the asynchronous Batch API; the Files API, vision, and citations; errors, rate limits, retries, token counting.→ §7–9
Build & shipModel selection; the Python and TypeScript SDKs; the Claude Agent SDK; MCP servers; production concerns.→ §10–12
Study by domain instead? Use §0's domain map to jump straight to the sections that cover a given official domain, weighted by how much of the exam it's worth.

Core API Snapshot

If you can read and predict the output of every snippet below, you cover most of what this exam is likely to test.

Messages

POST /v1/messages — model, max_tokens, messages, optional system/tools/stream. → details

Streaming

SSE event types: message_start → content_block_start/delta/stop (×N) → message_delta → message_stop. → details

Tool Use

tool_use block → you run the function → tool_result block back in a user turn. → details

Caching

cache_control: {"type":"ephemeral"} on a content block. → details

Batch

POST /v1/messages/batches — async, ~50% cheaper, up to 24h turnaround. → details

MCP

Standard protocol for tools/resources/prompts over stdio or HTTP. → details

→ Full SDK setup, side by side, in §10

Recommended Materials

This certification is new (2025-era) and there is not yet a mature third-party practice-exam ecosystem the way there is for AWS. Be conservative: the highest-value study time is spent in Anthropic's own primary documentation and cookbooks, not in unverified "practice exam" listings.

The reliable stack: docs.claude.com (the Messages API reference, guides, and API changelog) → the Anthropic Cookbook on GitHub for runnable examples → Anthropic's own courses on anthropic-partners.skilljar.com (the same platform hosting this exam) → modelcontextprotocol.io for MCP. Treat anything else, especially paid "CCDV-F practice question" bundles, with skepticism until you've verified the seller against Anthropic's own materials.

→ Full breakdown with sources and cautions (§14)

Study Plan (Quick Version)

This is a hands-on exam subject — reading docs without running code will not build the pattern recognition the exam rewards.

  1. Week 1: curl the Messages API directly, no SDK. Learn the raw JSON shapes for requests, responses, streaming events, and errors.
  2. Week 2: switch to the Python and TypeScript SDKs; add tool use, then prompt caching, then extended thinking. Read every stop_reason your code hits.
  3. Week 3: build a tiny MCP server, wire it into a client, then run the Batch API on a handful of requests and read the results JSONL. Review the Cram Jam and the worked examples.

→ Detailed day-by-day plan (§15)  ·  ⚡ Cram Jam one-pager  ·  → Exam-day tips & traps (§16)

Part 2 — Thorough Study Guide

0 · Domain-to-Section Map

This guide is organized by developer surface area, not by the eight official domain names — that reads better as a linear study path. Use the table below to study by blueprint weight instead: find your weakest domain, jump to the sections that cover it.

Domain (weight)Covered in
1 · Agents and Workflows (14.7%)§4.3 Multi-Step Tool Use, §10.4 Claude Agent SDK, §13 Decision Guides
2 · Applications and Integration (33.1%)§2 Messages API, §9 Errors, Rate Limits & Retries, §10 Models & SDKs, §12 Production Concerns, §13 Decision Guides
3 · Claude Code (3.1%)§10.4 Claude Agent SDK (Claude Code comparison), §13 Decision Guides
4 · Eval, Testing, and Debugging (2.6%)§12 Production Concerns (eval & regression testing), §9 Errors, Rate Limits & Retries, §18 Worked Examples (code-reading / bug-spotting items)
5 · Model Selection and Optimization (16.8%)§10.1 Model IDs & Families, §13 Decision Guides, §7 Prompt Caching, §9.4 Token Counting
6 · Prompt and Context Engineering (11.0%)§2.4 System Prompt, §6 Extended Thinking, §7 Prompt Caching
7 · Security and Safety (8.1%)§12 Production Concerns (safety & guardrails, secrets handling, PII)
8 · Tools and MCPs (10.6%)§4 Tool Use / Function Calling, §11 MCP for Developers
Two facts that should change your study plan

Domain 2, Applications and Integration, is 33.1% of the exam on its own — by far the heaviest domain, spanning API mechanics, application design, software-engineering foundations, and configuration management. If you only have time to master one area deeply, this is it.

Domains 3 and 4 are tiny by weight — Claude Code is 3.1% and Eval/Testing/Debugging is 2.6%, under 6% of the exam combined. That is a little surprising given the credential explicitly says it validates "designing and running evals, debugging failure modes through trace analysis, and validating structured output." Don't skip those skills because the domain weight looks small — the tension between what the credential claims to validate and how few items it dedicates to it is worth knowing about going in, not smoothing over.

↑ back to top

1 · Exam Details

Source: Anthropic's official CCDV-F Exam Guide

The facts in this section are quoted from Anthropic's official CCDV-F Exam Guide PDF (linked from anthropic-partners.skilljar.com): the exam costs $125 USD; candidates must review the Exam Guide, the Certification Terms and Conditions, and the Anthropic Certification Exam Policy before their session; there are 53 items (multiple-choice and multiple-response, each stating how many responses to select) across 8 weighted domains (see Official Exam Blueprint); a 120-minute time limit; delivery is proctored — online proctored and/or test center, per program policy; a passing score is a scaled 720 on a 100–1,000 scale; the credential is valid 12 months from the date it's awarded; and the score report gives pass/fail plus percent-correct by domain.

This program is still young and the guide is subject to change. Before you book, re-check the current Exam Guide PDF on anthropic-partners.skilljar.com rather than relying solely on this page.

What the exam validates

Per the Exam Guide, CCDV-F validates that a candidate can build with Claude — including designing and running evals, debugging failure modes through trace analysis, and validating structured output — not just recall API syntax.

Closed-book rules

  • Proctored delivery: online proctored and/or test center, per program policy. Registration and scheduling run through the Anthropic Partner Academy and Pearson VUE: you create a Pearson VUE account from the confirmation email, then choose either online proctoring or a Pearson test center.
  • No Claude, no documentation, no browser tabs, no external tools — you cannot look anything up mid-exam. This is the opposite of how you actually work as a Claude developer day to day, so the exam is testing recall, not lookup speed.
  • Standard proctoring hygiene applies: quiet private room, valid photo ID, webcam, no notes, no second monitor, no phone in reach.

Target candidate (reported)

Python or TypeScript fluency and comfort working against REST APIs. This tracks with the weight the blueprint puts on Applications and Integration (§0) — API mechanics and application design rather than pure architecture-scenario reasoning.

↑ back to top

2 · The Messages API

Everything else in this guide — streaming, tools, caching, thinking, batches — is a variation on one endpoint: POST https://api.anthropic.com/v1/messages. Master its shape first.

2.1 · Request Shape & Roles

A minimal request needs a model, a max_tokens budget, and a messages array. Every message has a role of either user or assistant — there is no "system" role inside messages; the system prompt is a separate top-level field (see §2.4).

Minimal request (curl)

curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4-5-20250929",
    "max_tokens": 1024,
    "messages": [
      {"role": "user", "content": "Explain what a stop_reason is, in one sentence."}
    ]
  }'

Response shape

{
  "id": "msg_01XyZ...",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-4-5-20250929",
  "content": [
    { "type": "text", "text": "A stop_reason tells you why the model stopped generating." }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": { "input_tokens": 21, "output_tokens": 14 }
}

Required request headers are x-api-key (or an OAuth bearer token, depending on how your key was issued), anthropic-version (a date string pinning the API version), and content-type: application/json. The response's content is always an array of content blocks, never a bare string — a common code-reading trap on this exam.

2.2 · Content Blocks

Both requests and responses use content blocks instead of plain strings, so a single turn can mix text with images, documents, tool calls, and reasoning.

Block typeAppears inPurpose
textRequest & responsePlain text. A message's content can also just be a bare string, which the API treats as a single text block — shorthand for the simple case.
imageRequest (user turn)Vision input, as base64 bytes or a Files API reference.
documentRequest (user turn)PDF input; can enable citations.
tool_useResponse (assistant turn)The model's request to call a function, with an id, name, and parsed input.
tool_resultRequest (user turn)Your function's output, keyed back to a tool_use_id.
thinking / redacted_thinkingResponse (assistant turn)Extended-thinking reasoning trace, only when the thinking param is enabled.
Code-reading trap message.content[0].text works only if you know the first block is text. A response that used tool use will have a tool_use block (possibly after a leading text block explaining the plan) — indexing blindly into content[0] is a common source of bugs the exam likes to test.

2.3 · Multi-Turn State (the API is stateless)

The Messages API has no server-side session or conversation memory. Every call is independent; "multi-turn" simply means you resend the entire growing messages array each time, including the assistant's own prior replies verbatim.

Turn 2 resends turn 1 in full

{
  "model": "claude-sonnet-4-5-20250929",
  "max_tokens": 1024,
  "messages": [
    {"role": "user", "content": "What's the capital of France?"},
    {"role": "assistant", "content": [{"type": "text", "text": "Paris."}]},
    {"role": "user", "content": "What's its population?"}
  ]
}

Drop the earlier turns and Claude has no idea "its" refers to Paris. This is also why prompt caching matters so much in practice — resending a long history on every turn is expensive without it.

Roles must alternate messages should alternate user/assistant starting with user (consecutive same-role messages are allowed and get concatenated by convention, but a well-formed conversation alternates). The final message does not have to be from the user — ending on an assistant message is the standard way to prefill the start of Claude's next reply.

2.4 · System Prompt

The system prompt is a top-level system field, not a message with role: "system". It sets persona, instructions, and constraints that apply to the whole conversation and is not part of the alternating user/assistant turn structure.

System prompt as a top-level field

{
  "model": "claude-sonnet-4-5-20250929",
  "max_tokens": 1024,
  "system": "You are a terse API support bot. Answer in one sentence.",
  "messages": [
    {"role": "user", "content": "How do I stream a response?"}
  ]
}

system can also be an array of content blocks (typically text blocks), which is how you attach cache_control to part of a long system prompt — see §7.

2.5 · Sampling Params & Stop Sequences

ParamRequired?What it does
max_tokensRequiredHard cap on tokens generated in this response. It is a ceiling, not a target — the model may stop earlier for other reasons.
temperatureOptional (0–1)Sampling randomness. Lower = more deterministic/focused; higher = more varied. Default is moderate; use low values (near 0) for extraction/classification tasks.
top_p / top_kOptionalAlternative/complementary sampling controls (nucleus and top-k sampling). Typically leave at defaults unless you have a specific reason to tune them.
stop_sequencesOptionalAn array of strings; generation halts the moment one is produced, and the sequence itself is not included in the output.

2.6 · stop_reason Values

stop_reasonMeaning
end_turnClaude finished naturally — the normal, successful case.
max_tokensHit the max_tokens ceiling before finishing. The response is likely truncated mid-thought; increase the budget or handle partial output.
stop_sequenceOne of your stop_sequences strings was generated.
tool_useClaude wants to call one or more tools; the response contains tool_use block(s) and you must respond with matching tool_result block(s) to continue.
pause_turnUsed with certain long-running/agentic flows (e.g. server-side tools) where the turn is paused mid-way and should be continued by sending the conversation back as-is.
refusalClaude declined to generate content for policy reasons.
Most common bug Treating every response as final text. If you don't branch on stop_reason == "tool_use", your tool-use loop silently stops after one turn and never actually executes the function the model asked for.

↑ back to top

3 · Streaming (Server-Sent Events)

Set "stream": true to receive the response incrementally as a Server-Sent Events (SSE) stream instead of one JSON blob. Each SSE frame has an event: name and a data: JSON payload.

Event sequence for a plain-text reply

event: message_start
data: {"type":"message_start","message":{"id":"msg_01...","role":"assistant","content":[],"stop_reason":null,"usage":{"input_tokens":21,"output_tokens":1}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"A "}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"stop_reason "}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"output_tokens":14}}

event: message_stop
data: {"type":"message_stop"}

Occasional ping events keep the connection alive and can be ignored. Errors mid-stream arrive as an error event rather than an HTTP error code, since the HTTP response already started.

  • Deltas are typed. A text block streams text_delta chunks; a tool_use block's input streams as input_json_delta chunks containing partial JSON fragments you must concatenate and parse only once complete; extended-thinking blocks stream thinking_delta (and a final signature_delta).
  • Multiple content blocks each get their own index. A response with a leading text block and a following tool_use block streams block 0's events fully, then content_block_start for index 1, and so on.
  • Both SDKs offer a higher-level streaming helper (Python: client.messages.stream(...) as a context manager with a .text_stream iterator; TypeScript: an async iterable / event-emitter interface) so you don't have to hand-parse SSE frames yourself in normal application code.
Trap Don't try to JSON.parse() each input_json_delta fragment on its own — it's a partial string and will not be valid JSON until all fragments for that block are concatenated.

↑ back to top

4 · Tool Use / Function Calling

Tool use lets Claude call functions you define — looking up data, performing calculations, or taking an action — rather than only generating text. Claude never executes anything itself; it only ever asks you to.

4.1 · The Tool Use Cycle

  1. You send a request with a tools array describing available functions.
  2. Claude replies with stop_reason: "tool_use" and one or more tool_use content blocks, each with an id, a name, and a parsed input object matching your schema.
  3. Your application code actually runs the function with that input.
  4. You send a new request with the full history so far, plus a new user message containing a tool_result block for each tool_use_id, holding the function's output.
  5. Claude continues — either with a final text answer (end_turn) or by requesting another tool call.

Tool definition

{
  "name": "get_weather",
  "description": "Get the current weather for a given city.",
  "input_schema": {
    "type": "object",
    "properties": {
      "location": { "type": "string", "description": "City and state, e.g. San Francisco, CA" },
      "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] }
    },
    "required": ["location"]
  }
}

The schema is standard JSON Schema. Claude uses the description fields — on the tool and on each property — to decide both whether to call the tool and what to put in each field, so vague descriptions are a common source of wrong tool calls.

Claude's tool_use response

{
  "content": [
    { "type": "tool_use", "id": "toolu_01A...", "name": "get_weather",
      "input": { "location": "San Francisco, CA", "unit": "celsius" } }
  ],
  "stop_reason": "tool_use"
}

Sending the tool_result back

{
  "model": "claude-sonnet-4-5-20250929",
  "max_tokens": 1024,
  "tools": [ /* same tools array as before */ ],
  "messages": [
    {"role": "user", "content": "What's the weather in SF?"},
    {"role": "assistant", "content": [
      {"type": "tool_use", "id": "toolu_01A...", "name": "get_weather",
       "input": {"location": "San Francisco, CA", "unit": "celsius"}}
    ]},
    {"role": "user", "content": [
      {"type": "tool_result", "tool_use_id": "toolu_01A...", "content": "15°C, partly cloudy"}
    ]}
  ]
}

The tools array must be resent on this follow-up call too — remember, the API is stateless (§2.3). A tool_result can also carry "is_error": true when the function itself failed, so Claude can react (retry differently, apologize, ask for clarification) instead of treating a stack trace as real data.

4.2 · Tool Definitions & tool_choice

tool_choiceBehavior
{"type": "auto"}Default. Claude decides whether to use a tool or answer directly.
{"type": "any"}Claude must call some tool, but you don't pick which one.
{"type": "tool", "name": "get_weather"}Force this specific tool. The classic technique for reliable structured extraction — see §5.
{"type": "none"}Disable tool use for this call even if tools is present.

4.3 · Parallel & Multi-Step Tool Use

A single response can contain multiple tool_use blocks when Claude decides several independent calls are needed at once (e.g. checking weather in three cities). Run them all, then return all their tool_result blocks together in one follow-up user message, matched by tool_use_id — order inside the array doesn't have to match the call order, since each result is keyed explicitly.

Multi-step tool use is simply this cycle repeated: keep looping "send request → get tool_use → run function → send tool_result" until stop_reason comes back end_turn. This loop is exactly what the Claude Agent SDK and Claude Code automate for you (§10.4).

↑ back to top

5 · Structured Outputs

Three ways to get reliably-shaped data out of Claude, roughly in order of how much control they give you:

ApproachHow it worksWhen to use
Forced single-tool extractionDefine one tool whose input_schema is your desired output shape, and set tool_choice to force that tool. Claude's tool_use.input is then your structured object, already schema-validated by the model's own JSON generation.The most robust, well-established pattern for "give me JSON matching this shape" today — works on every model version, no special beta flags.
Prompted JSON + parsingInstruct Claude in the system prompt to reply with only JSON matching a described shape, then json.loads()/JSON.parse() the text block yourself, with a repair/retry step for malformed output.Quick prototypes, or models/paths where forced tool choice isn't convenient. Least reliable of the three — budget for parse failures.
Schema-constrained output modesAnthropic's docs (docs.claude.com) describe additional structured-output capabilities beyond forced tool choice. Check the current API reference for exact parameter names and availability before relying on one in production or on the exam.Whenever available for your model/use case and you want generation itself constrained to a schema, not just requested to follow one.

Forced single-tool extraction, end to end

tools = [{
    "name": "extract_invoice",
    "description": "Extract structured fields from an invoice.",
    "input_schema": {
        "type": "object",
        "properties": {
            "vendor": {"type": "string"},
            "total_cents": {"type": "integer"},
            "due_date": {"type": "string", "description": "ISO 8601 date"}
        },
        "required": ["vendor", "total_cents", "due_date"]
    }
}]

response = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=512,
    tools=tools,
    tool_choice={"type": "tool", "name": "extract_invoice"},
    messages=[{"role": "user", "content": f"Extract fields from:\n\n{invoice_text}"}],
)

invoice = response.content[0].input  # already a dict matching the schema
Why this beats prompted JSON With forced tool choice, Claude's output is generated against the JSON Schema at the API layer, so you skip the fragile "hope it doesn't wrap the JSON in a markdown fence or add a sentence before it" failure mode of plain prompted JSON.

↑ back to top

6 · Extended Thinking

Extended thinking gives Claude a visible scratchpad for working through hard problems before answering, on models that support it. Enable it with a thinking parameter carrying a token budget.

Enabling extended thinking

{
  "model": "claude-opus-4-1-20250805",
  "max_tokens": 4096,
  "thinking": { "type": "enabled", "budget_tokens": 2048 },
  "messages": [
    {"role": "user", "content": "A train leaves at 2pm going 60mph, another at 3pm going 75mph on the same route. When does the second catch the first?"}
  ]
}

Response includes a thinking block before the answer

{
  "content": [
    { "type": "thinking", "thinking": "Let d1(t)=60t, d2(t)=75(t-1)...", "signature": "EqQBCgYI..." },
    { "type": "text", "text": "The second train catches the first at 6pm." }
  ],
  "stop_reason": "end_turn"
}
  • budget_tokens is a target ceiling for the thinking block and must be less than max_tokens; give it real headroom (low four-figure token budgets, not a token or two) or thinking barely engages.
  • When thinking is enabled, sampling is constrained — you generally cannot freely tune temperature/top_p/top_k the way you can with thinking off. Verify current constraints in the docs before relying on a specific combination.
  • If you continue a multi-turn or tool-use conversation, you must pass the thinking block(s) back unmodified alongside the rest of the assistant turn — Claude uses the preserved reasoning (and its signature, a verification token) to stay consistent across turns.
  • Sometimes a redacted_thinking block appears instead of thinking — the reasoning was flagged internally and its content is encrypted rather than shown, but it must still be passed back on later turns exactly like a normal thinking block.
When to use it Extended thinking helps most on multi-step reasoning, math, and planning tasks. It costs more output tokens and latency, so leaving it off for straightforward extraction/classification/formatting tasks is usually the right call — see the decision table in §13.

↑ back to top

7 · Prompt Caching

Prompt caching lets you mark a prefix of your request — typically a long system prompt, a big set of few-shot examples, or a large document — so Anthropic can reuse the already-processed version on a later call instead of reprocessing it from scratch.

Marking a block cacheable

{
  "model": "claude-sonnet-4-5-20250929",
  "max_tokens": 1024,
  "system": [
    { "type": "text",
      "text": "<50 pages of product documentation the assistant should always have>",
      "cache_control": { "type": "ephemeral" } }
  ],
  "messages": [
    {"role": "user", "content": "How do I reset a customer's password?"}
  ]
}
  • Where it goes: cache_control can be attached to blocks in system, messages, and tools. Everything up to and including the last cache-marked block is treated as one cacheable prefix.
  • Minimum size: a block must be reasonably long to be worth caching — Anthropic enforces a minimum cacheable prefix length that varies by model tier; check the current docs for the exact token floor before assuming a short prompt will actually cache.
  • Cost shape: writing to the cache costs a premium over a normal input token on that call; reading a cache hit on a later call costs a large discount versus a normal input token. Net win whenever the same prefix is reused more than once or twice.
  • Usage fields: the response's usage object reports cache_creation_input_tokens and cache_read_input_tokens separately from plain input_tokens, so you can verify hits/misses instead of guessing.
  • TTL: a cache entry is short-lived by default (on the order of minutes) and refreshes on reuse; an extended-TTL option exists for longer-lived caches — verify current durations in the docs, they are the kind of number this exam's own sources warn changes.
Trap Caching only pays off if the prefix is byte-for-byte identical across calls. Interpolating a timestamp or a user ID into the middle of your cached system prompt busts the cache on every request — put anything that varies after the cached block, not inside it.

↑ back to top

8 · Batch, Files, Vision & Citations

8.1 · Batch API

For large, non-urgent workloads (bulk classification, offline evaluation runs), the Batch API accepts many requests at once, processes them asynchronously, and returns results at a substantial cost discount versus calling /v1/messages once per item synchronously.

Submitting a batch

POST /v1/messages/batches
{
  "requests": [
    { "custom_id": "row-1",
      "params": { "model": "claude-haiku-4-5-20251001", "max_tokens": 256,
                  "messages": [{"role": "user", "content": "Classify sentiment: 'Great product!'"}] } },
    { "custom_id": "row-2",
      "params": { "model": "claude-haiku-4-5-20251001", "max_tokens": 256,
                  "messages": [{"role": "user", "content": "Classify sentiment: 'Terrible support.'"}] } }
  ]
}

Each entry's params is exactly a normal Messages API request body. The response gives you a batch id and a processing_status; poll GET /v1/messages/batches/{id} until it reports completion, then fetch the JSONL results, one line per custom_id, each holding either a succeeded message or an error for that row.

Batches typically complete well within a day, and are the right default whenever your workload can tolerate that latency in exchange for materially lower cost — see the decision table in §13.

8.2 · Files API & Vision

The Files API lets you upload an image, PDF, or other document once and reference it by ID across many requests, instead of re-encoding and re-sending the same base64 payload on every call.

Upload, then reference by file_id

# upload once
curl https://api.anthropic.com/v1/files \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -F "file=@invoice.pdf"
# -> {"id": "file_01ABC...", "type": "file", "filename": "invoice.pdf", ...}
{
  "model": "claude-sonnet-4-5-20250929",
  "max_tokens": 1024,
  "messages": [{
    "role": "user",
    "content": [
      { "type": "document", "source": { "type": "file", "file_id": "file_01ABC..." } },
      { "type": "text", "text": "Summarize this invoice." }
    ]
  }]
}

For plain vision without reuse, an image block can instead carry inline base64 bytes directly. Use the Files API when the same asset is reused across multiple calls, or when it's large enough that repeated inline base64 is wasteful.

8.3 · Citations

When a document content block sets "citations": {"enabled": true}, Claude's text response can include citation metadata pointing back to the specific passage of the source document that supports each claim, instead of you having to trust an unverifiable summary.

Requesting citations on a document

{
  "type": "document",
  "source": { "type": "file", "file_id": "file_01ABC..." },
  "citations": { "enabled": true }
}

The resulting text blocks carry per-sentence citation objects referencing the source document and location, which you can render as footnotes/highlights in a UI — useful anywhere hallucination risk on document Q&A matters.

↑ back to top

9 · Errors, Rate Limits & Retries

9.1 · Error Types & Status Codes

Error response shape

{
  "type": "error",
  "error": { "type": "rate_limit_error", "message": "Number of request tokens has exceeded your per-minute rate limit." }
}
HTTP statuserror.typeMeaning
400invalid_request_errorMalformed request — bad JSON, missing required field, invalid parameter value.
401authentication_errorMissing or invalid API key.
403permission_errorKey is valid but lacks permission for this resource/action.
404not_found_errorReferenced resource doesn't exist (e.g. an unknown model ID, an expired file).
413request_too_largeRequest body exceeds the maximum allowed size.
429rate_limit_errorYou've exceeded a request- or token-based rate limit — see §9.2.
500api_errorAn unexpected error on Anthropic's side.
529overloaded_errorThe API is temporarily overloaded — safe and expected to retry with backoff.

9.2 · Rate-Limit Headers

Every response carries headers reporting your current standing against both request-count and token-count limits, so a well-behaved client can throttle itself before hitting a 429 rather than only reacting after the fact.

Header familyMeaning
anthropic-ratelimit-requests-limit / -remaining / -resetRequests-per-minute budget for your account/key tier.
anthropic-ratelimit-tokens-limit / -remaining / -resetCombined input+output token-per-minute budget.
anthropic-ratelimit-input-tokens-* / anthropic-ratelimit-output-tokens-*Separate input-token and output-token budgets, where applicable.
retry-afterPresent on 429/529 responses — seconds to wait before retrying.

9.3 · Retries & Idempotency

  • Retry 429 and 529 (and transient network errors) with exponential backoff and jitter; both official SDKs do this automatically for a configurable number of attempts.
  • Do not blindly retry 400-class errors — the request itself is wrong and will fail identically every time until you fix it.
  • Respect the retry-after header when present instead of guessing a backoff interval.
  • For operations where an accidental duplicate call would be costly (e.g. triggering a side-effecting tool twice), design your own application-level idempotency around your tool execution layer — the safest place to dedupe is your own function-call handling, since a retried Messages API call around the same conversation state is not automatically deduplicated for you.

9.4 · Token Counting

Before you send an expensive request, you can count how many input tokens it will consume without actually generating a response, using the same request body against a dedicated endpoint.

Counting tokens ahead of a call

POST /v1/messages/count_tokens
{
  "model": "claude-sonnet-4-5-20250929",
  "messages": [{"role": "user", "content": "How many tokens is this?"}]
}
# -> {"input_tokens": 10}

↑ back to top

10 · Models & SDKs

10.1 · Model IDs & Families

Claude ships in three tiers that trade off capability against cost and latency, and model IDs encode the family, a version, and (usually) a release date.

FamilyPositioning
OpusHighest capability, highest cost/latency — hardest reasoning, agentic, and coding tasks.
SonnetThe default balance of capability, cost, and speed for most production workloads.
HaikuFastest and cheapest — high-volume, latency-sensitive, or simple classification/extraction tasks.
Don't memorize a specific ID as "the" current model Model IDs (e.g. claude-sonnet-4-5-20250929) are versioned and dated, and new ones ship regularly — this guide's examples use plausible, correctly-shaped IDs to illustrate the naming pattern, not a promise of what's current. Always check docs.claude.com's models page for the live list, and prefer pinning to a dated ID (not a rolling alias) in production code you don't want to silently change behavior underneath you.

10.2 · Python SDK

Setup and a basic call

pip install anthropic
import anthropic

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY from the environment

message = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Say hello in Haiku form."}],
)
print(message.content[0].text)

Streaming with the context-manager helper

with client.messages.stream(
    model="claude-sonnet-4-5-20250929",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write a short poem about APIs."}],
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)
    final_message = stream.get_final_message()

10.3 · TypeScript SDK

Setup and a basic call

npm install @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic(); // reads ANTHROPIC_API_KEY from the environment

const message = await client.messages.create({
  model: "claude-sonnet-4-5-20250929",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Say hello in Haiku form." }],
});
console.log(message.content[0].text);

Streaming with an async iterator

const stream = client.messages.stream({
  model: "claude-sonnet-4-5-20250929",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Write a short poem about APIs." }],
});

stream.on("text", (text) => process.stdout.write(text));
const finalMessage = await stream.finalMessage();

10.4 · Claude Agent SDK

The Claude Agent SDK packages the same agent loop that powers Claude Code — model call → tool use → execute → repeat — into a library you can embed in your own application, instead of hand-rolling the tool-use cycle from §4 yourself. It manages context/conversation state, exposes built-in tools (reading/writing files, running shell commands), lets you register custom tools, supports connecting MCP servers, and enforces configurable permission modes over what the agent is allowed to do without asking.

Conceptual shape (verify exact API against current docs.claude.com)

# Python
from claude_agent_sdk import query

async for message in query(prompt="Refactor the auth module to use async/await."):
    print(message)
// TypeScript
import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({ prompt: "Refactor the auth module to use async/await." })) {
  console.log(message);
}
Raw API vs SDK vs Agent SDK vs Claude Code See the full decision table in §13 — in short: raw API/SDK when you own the loop and want full control; Agent SDK when you want Claude Code's agent loop embedded inside your own product; Claude Code itself when you want a ready-made terminal/IDE coding agent, not a library.

↑ back to top

11 · MCP for Developers

The Model Context Protocol (MCP) is an open, JSON-RPC-based standard (see modelcontextprotocol.io) for connecting an AI application to external tools, data, and prompt templates through a common interface, instead of writing bespoke integration code per data source per app.

Three primitives

PrimitiveWho invokes itPurpose
ToolsThe modelExecutable functions the model can call — the MCP equivalent of the tool-use functions in §4, but defined once in a server and reusable across every MCP-aware client.
ResourcesThe application/userRead-only, addressable data (a file, a database row, a URL) the app can attach as context — not something the model decides to call mid-conversation.
PromptsThe userReusable, parameterized prompt templates a user can explicitly invoke (e.g. a slash command), rather than something the model reaches for autonomously.

Building a minimal server (Python)

A one-tool MCP server over stdio

pip install mcp
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("weather")

@mcp.tool()
def get_weather(location: str) -> str:
    """Get the current weather for a location."""
    return f"It's sunny in {location}."

if __name__ == "__main__":
    mcp.run(transport="stdio")

Transports

TransportWhen to use
stdioThe client launches the server as a local subprocess and talks over stdin/stdout. Simplest option; the default for local tools, CLIs, and dev-machine integrations.
Streamable HTTPThe server runs remotely/independently and the client connects over HTTP; needed whenever the server isn't a process the client can spawn itself, e.g. a shared team server or a hosted third-party integration.

Connecting a server to a client

Registering a stdio MCP server with a client

{
  "mcpServers": {
    "weather": { "command": "python", "args": ["weather_server.py"] }
  }
}

The client (Claude Code, Claude Desktop, or your own Claude Agent SDK application) spawns the configured command, performs the MCP handshake, and then exposes that server's tools/resources/prompts to the model just like any natively-registered tool.

When to build an MCP server instead of a plain function

  • Reuse across clients/apps — write the integration once (say, "our internal ticketing system") and every MCP-aware client (Claude Code, your own app, a teammate's app) can use it without re-implementing the tool.
  • Third-party/remote data sources — MCP standardizes auth, discovery, and the request/response shape for connecting to systems you don't control end to end.
  • You need resources or prompts, not just tools — plain function/tool-use (§4) only covers the "tool" primitive; resources and prompts are MCP-specific concepts with no equivalent in the raw Messages API.
  • Skip it for a single, in-process function used by exactly one application — a plain tool definition (§4) is less machinery and ships faster.

↑ back to top

12 · Production Concerns

  • Error handling & retries: branch on stop_reason and HTTP status explicitly (§2.6, §9.1); use SDK-provided retry/backoff rather than hand-rolling it; never silently swallow a tool_result error — surface it back to the model with is_error: true so it can react.
  • Timeouts: long generations, especially with extended thinking or large tool-use loops, can run well past a naive short HTTP timeout; set client timeouts deliberately, and use streaming so your application gets partial progress instead of one long blocking call.
  • Observability & logging: log usage (including cache read/write and thinking-token counts), stop_reason, model ID, and latency per call; this is what lets you catch cost regressions, truncated responses, and unexpected refusals before users report them.
  • Evaluation & regression testing of prompts: treat prompts and tool definitions like code — keep a labeled eval set, re-run it whenever you change a prompt/model/schema, and diff outputs before shipping. A model or prompt upgrade that "feels fine" in manual spot checks can silently regress a specific case an eval set would have caught.
  • Safety & guardrails: validate tool inputs before executing them (never trust tool_use.input as pre-sanitized, especially for anything touching the filesystem, a shell, or a database); constrain what tools an agent can call based on the user's actual permissions, not just what's technically wired up.
  • Secrets handling: never put an API key in client-side code; proxy Claude API calls through your own backend for any browser or mobile app so the key never leaves your server.
  • PII: be deliberate about what enters prompts, especially anything logged or cached — a cached system prompt or logged request body containing PII persists exactly as long as your caching/logging policy says it does.
  • Deployment patterns: synchronous request/response for interactive UX; streaming for anything user-facing where perceived latency matters; the Batch API for large offline workloads; queue-and-worker architectures around tool execution when tools themselves are slow or rate-limited independently of Claude.

↑ back to top

13 · Decision Guides

Raw API vs SDK vs Agent SDK vs Claude Code

NeedUse
Full control, no dependency, another language's HTTP clientRaw Messages API over HTTP
Idiomatic Python/TypeScript, built-in retries/streaming helpersOfficial SDK
Embed a full agent loop (tools + context management) inside your own productClaude Agent SDK
A ready-made terminal/IDE coding agent, not a library you integrateClaude Code

Sync vs streaming vs batch

NeedUse
Short, simple, latency doesn't matter muchSynchronous /v1/messages
User-facing, perceived responsiveness mattersStreaming
Large volume, latency tolerant (minutes–hours OK), cost-sensitiveBatch API

Tool use vs structured output vs plain text parsing

NeedUse
Take a real action (call an external system, run code)Tool use
Extract a reliably-shaped object, no external actionForced single-tool extraction (§5)
One-off, low-stakes, can tolerate occasional parse failuresPrompted JSON + manual parsing

Caching vs shortening the prompt vs retrieval

SituationUse
Same large context reused across many callsPrompt caching
Context is large but mostly irrelevant per-queryRetrieval (fetch only the relevant slice) instead of sending it all
Context is large, one-off, never reusedShorten/summarize it — caching won't pay off on a single use

Model selection by cost/latency/capability

SituationUse
High-volume classification/extraction, latency-sensitiveHaiku family
General production workload, balanced needsSonnet family
Hardest reasoning/agentic/coding tasks, cost secondaryOpus family

Extended thinking on vs off

SituationChoice
Multi-step math, planning, ambiguous/hard reasoningOn, with a meaningful token budget
Simple extraction, formatting, classification, latency-sensitiveOff — the extra tokens and latency buy nothing

↑ back to top

14 · Study Materials

This is a new exam. Be skeptical of anything claiming to be an official-equivalent "CCDV-F practice test" bundle unless it's clearly sourced from Anthropic itself — the ecosystem hasn't matured the way AWS's has.

ResourceWhat it's good for
docs.claude.comThe authoritative API reference, guides, and changelog — the single most exam-relevant source for this content.
Anthropic Cookbook (GitHub, anthropics/anthropic-cookbook)Runnable, real example code for tool use, caching, vision, and more — read the code, don't just skim the prose.
Anthropic Academy (anthropic-partners.skilljar.com)The platform this certification itself runs on — its own courses are the most directly aligned prep material available.
modelcontextprotocol.ioPrimary MCP documentation — the spec, SDK guides, and example servers.
Community blog posts / videosUseful for a second explanation of a concept, but verify any code sample or parameter name against docs.claude.com before trusting it — third-party content ages quickly against a fast-moving API.
Be conservative Do not pay for a "practice exam" bundle for this certification without first verifying, from the seller's own sample questions, that its facts (question count, format, passing score) match Anthropic's official Exam Guide — a bad practice-exam vendor can simply be repeating another bad source, and this guide's own numbers should be re-checked against the current PDF too.

↑ back to top

15 · Study Plan

About three weeks, hands-on heavy. Active recall beats passive reading here more than usual, because a large share of the exam's likely content is exact-shape recall (parameter names, event sequences, stop_reason values) that only sticks if you've typed it yourself.

  1. Days 1–3: curl the Messages API directly. No SDK yet. Send a request, read the response shape, deliberately trigger a max_tokens truncation and a stop_sequence stop so you've seen both stop_reason values with your own eyes, not just read about them.
  2. Days 4–7: switch to the Python SDK, then the TypeScript SDK. Rebuild the same three or four requests in both languages. Add streaming; watch the raw SSE frames once with curl's -N flag before relying on the SDK's streaming helper.
  3. Days 8–11: add tool use. Build a two-tool agent loop by hand (no Agent SDK yet) so you feel the tool_use → tool_result cycle directly. Then try forced single-tool extraction (§5) on a real document.
  4. Days 12–15: add prompt caching to a long system prompt and verify the cache_read_input_tokens field actually shows a hit on the second call. Try extended thinking on a genuinely hard reasoning prompt and a trivial one, and notice when it does and doesn't help.
  5. Days 16–18: build a minimal MCP server (the weather example in §11 is enough) and connect it to a client. Submit a small Batch API job and read the JSONL results file yourself.
  6. Days 19–21: deliberately trigger a 429 (or read Anthropic's docs on how rate limits behave) so the header names in §9.2 aren't abstract; review the Cram Jam and every worked example in §18; sleep well the night before.

⚡ Cram Jam one-pager  ·  → Exam-day tips & traps (§16)

↑ back to top

16 · Exam-Day Tips and Traps

  • Closed book, for real. Proctored delivery (online proctored and/or test center, per program policy) means no Claude, no docs.claude.com, no browser tabs, no external tools during the exam — the opposite of daily developer workflow. If your knowledge of a parameter name is "I'd look it up," that's a gap to close before exam day, not during it.
  • Standard proctoring hygiene: quiet private room, valid photo ID ready, webcam positioned per instructions, clear desk, no phone in reach, no second monitor.
  • No penalty structure has been publicly confirmed either way — treat every question as scored and answer all of them rather than leaving any blank, which is safe under essentially every scoring model.
  • Read code-reading questions for the exact bug: an off-by-one content-block index, a missing stop_reason branch, a tools array dropped on the tool_result follow-up call, a cache_control block placed after something that varies per request. These "spot the bug" items reward having actually written this code yourself.
  • Study by domain weight, not just by section order: Applications and Integration is a third of the exam (§0) — make sure API mechanics, application design, and configuration management are rock solid before polishing lighter-weight areas.
  • Re-verify the logistics before booking: these figures come from Anthropic's official Exam Guide, but the program is young enough that the guide itself can change. Check the current Exam Guide PDF on anthropic-partners.skilljar.com immediately before you book.

↑ back to top

17 · Glossary

TermMeaning
Content blockA typed unit inside a message's content array — text, image, document, tool_use, tool_result, thinking.
Extended thinkingA visible reasoning scratchpad the model produces before answering, enabled via the thinking param.
IdempotencyThe property that repeating an operation has the same effect as doing it once — a design goal for retryable tool execution.
MCPModel Context Protocol — an open standard for exposing tools, resources, and prompts to AI clients.
PrefillEnding a request's messages array on an assistant turn to constrain how Claude's next reply begins.
Prompt cachingMarking a request prefix so a later, identical prefix reuses prior processing at a discount.
Redacted thinkingA thinking block whose content is encrypted rather than shown, still required on later turns.
TermMeaning
SSEServer-Sent Events — the streaming transport used by stream: true responses.
Stop reasonField explaining why generation ended: end_turn, max_tokens, stop_sequence, tool_use, pause_turn, refusal.
Tool choiceThe tool_choice param controlling whether/which tool Claude must call.
Tool resultA tool_result content block returning a function's output, keyed by tool_use_id.
Tool useA tool_use content block: the model's request to call a named function with parsed input.
Transport (MCP)How an MCP client and server communicate: stdio (local subprocess) or Streamable HTTP (remote).
UsageResponse field reporting input/output/cache-read/cache-creation token counts for billing and observability.

↑ back to top

18 · Worked Example Questions

Standalone-item style, matching the reported exam format. Several are code-reading questions, since real code matters for this exam.

Example 1 — Roles

"Which of the following is a valid role value inside the messages array of a Messages API request?"

A) system   B) developer   C) assistant   D) function

Correct: C. Only user and assistant are valid message roles. A) is wrong because the system prompt is a separate top-level system field, never a message role. B) and D) don't exist in this API at all — they resemble roles from other vendors' chat APIs, a classic distractor pattern.

Example 2 — Multi-turn state

"A developer's chatbot forgets earlier context after the third user turn, even though each request succeeds with a 200 response. What is the most likely cause?"

A) The API has a hidden 2-turn context limit   B) The application is not resending the full message history on each call   C) max_tokens is too low   D) The system prompt was not cached

Correct: B. The Messages API is stateless; the application is responsible for resending the growing conversation every time. A) is false — there's no such fixed hidden limit. C) affects response length, not memory of earlier turns. D) affects cost/latency, not correctness of conversation memory.

Example 3 — Code reading, tool use

Given this handler, what is the bug?

response = client.messages.create(model=MODEL, max_tokens=1024, tools=tools, messages=messages)
messages.append({"role": "assistant", "content": response.content})
result = run_tool(response.content[0])
messages.append({"role": "user", "content": [
    {"type": "tool_result", "tool_use_id": response.content[0].id, "content": result}
]})

A) tool_result must be in an assistant message, not user   B) It assumes content[0] is the tool_use block and ignores any other tool_use blocks in the response   C) tools should not be resent on the follow-up call   D) tool_use_id should be response.id, not the block's id

Correct: B. If Claude's response contains a leading text block or more than one tool_use block, indexing content[0] blindly and running only that one tool silently drops the others. A) is false — tool_result blocks belong in a user message. C) is false — the stateless API needs tools resent every call. D) is false — tool_use_id must match the specific block's own id, not the message's top-level id.

Example 4 — stop_reason

"A request sets max_tokens: 100 and Claude's answer would naturally need about 400 tokens. What stop_reason is returned, and what should the developer do?"

A) end_turn; nothing, this is normal   B) max_tokens; treat the output as truncated and consider raising the budget or continuing the generation   C) refusal; rephrase the prompt   D) stop_sequence; add a stop sequence

Correct: B. Hitting the token ceiling before finishing naturally always returns max_tokens, and the content is very likely cut off mid-thought. A), C), D) describe unrelated stopping conditions that don't match "ran out of budget before finishing."

Example 5 — Prompt caching

"A developer adds cache_control: {"type": "ephemeral"} to a system prompt block that includes an interpolated request_id string unique to every call. Cache hits never occur. Why?"

A) cache_control only works on messages, never system   B) The cached prefix must be byte-for-byte identical across calls, and the varying request_id breaks that on every call   C) Ephemeral caches only last one call by design   D) Caching requires the Batch API

Correct: B. Caching keys on an exact-match prefix; any per-call variation inside the cached block busts it every time. A) is false — system blocks are a normal, common place to cache. C) misdescribes ephemeral caching, which is meant to be reused across subsequent calls within its TTL. D) is unrelated — caching works on ordinary synchronous calls.

Example 6 — Streaming

"While streaming a response that includes a tool_use block, a developer tries to JSON.parse() every individual input_json_delta chunk as it arrives. What happens?"

A) It works, each delta is always valid JSON   B) It throws on most chunks, because each delta is only a partial fragment of the full JSON string until the block completes   C) The API rejects malformed partial parses server-side   D) input_json_delta is only emitted after the full input is ready

Correct: B. Deltas are streamed as fragments meant to be concatenated; only the fully-assembled string is guaranteed valid JSON. A), C), D) all mischaracterize how the delta stream is chunked.

Example 7 — Structured outputs

"A team wants the most reliable way to get Claude to return an object matching a specific JSON shape, using only capabilities documented and stable today. What should they do?"

A) Ask nicely in the prompt and hope for valid JSON   B) Define a single tool whose input_schema matches the desired shape and force it via tool_choice   C) Set temperature: 0 only   D) Use extended thinking to "reason its way" to valid JSON

Correct: B. Forced single-tool extraction generates against a JSON Schema at the API layer, the most robust widely-available pattern. A) is the least reliable option, prone to wrapping/prose contamination. C) reduces randomness but doesn't constrain shape. D) adds reasoning, not schema enforcement.

Example 8 — Extended thinking continuity

"In a multi-turn tool-use conversation with extended thinking enabled, a developer strips the thinking block out of the assistant turn before resending history, keeping only the final text/tool_use blocks. What is the likely consequence?"

A) None — thinking blocks are purely cosmetic and can be discarded   B) The next call may error or lose reasoning continuity, since preserved thinking (with its signature) must be passed back unmodified on later turns   C) The cache is invalidated but nothing else changes   D) Extended thinking automatically re-enables itself using the stripped content

Correct: B. Thinking blocks (and their signatures) are meant to be round-tripped unmodified in ongoing conversations; stripping them breaks the intended continuity/verification the signature provides. A), C), D) all understate or misdescribe the requirement.

Example 9 — Errors & retries

"A client receives repeated 400 invalid_request_error responses and retries each one three times with exponential backoff before giving up. Is this a sound retry strategy?"

A) Yes — all errors should be retried with backoff   B) No — a 400 indicates a malformed request that will fail identically every time; only 429/529/transient network errors are worth retrying   C) No — 400 errors should be retried without backoff, immediately   D) Yes, but only if retry-after is present

Correct: B. A 400 means the request itself is invalid; retrying an unchanged invalid request just repeats the failure and wastes time/quota. A), C), D) all recommend retrying a class of error that isn't transient.

Example 10 — Batch vs synchronous

"A company needs to classify 200,000 archived support tickets overnight, with no user waiting on any individual result. Which approach best fits?"

A) 200,000 synchronous /v1/messages calls in a tight loop   B) The Batch API, submitted as one job and polled for completion   C) Streaming each request for lower perceived latency   D) Extended thinking on every request to maximize accuracy

Correct: B. Large volume, latency-tolerant, cost-sensitive, no interactive user — exactly the Batch API's use case, at a substantial cost discount versus per-call synchronous calls. A) works but is slower and more expensive. C) streaming optimizes perceived latency, irrelevant with no user waiting. D) adds cost/latency without addressing the actual constraint (volume/cost).

Example 11 — MCP primitives

"A developer wants users to be able to explicitly invoke a saved, parameterized 'summarize this ticket' template from a client's UI, rather than have the model decide on its own when to use it. Which MCP primitive fits?"

A) Tool   B) Resource   C) Prompt   D) Sampling

Correct: C. Prompts are user-invoked, reusable templates — exactly this "explicitly triggered by the user" pattern. A) Tools are model-invoked, not user-triggered. B) Resources are read-only context data, not an invocable action. D) is not one of MCP's three core primitives in this context.

Example 12 — Code reading, streaming vs sync

Given this snippet, what will response be?

response = client.messages.create(
    model=MODEL, max_tokens=1024, stream=True,
    messages=[{"role": "user", "content": "hi"}],
)
print(response.content[0].text)

A) The final text of the reply, same as a non-streaming call   B) An iterator/stream object of SSE events, not a completed Message — response.content will raise or behave unexpectedly   C) A list of every delta already concatenated   D) The first SSE frame's raw JSON string

Correct: B. With stream=True, the call returns a stream you must iterate (or use the dedicated .stream() helper) — it is not a completed Message object with a ready content array, so treating it like one is a bug. A) and C) describe the non-streaming case. D) misdescribes what the SDK hands back.

Example 13 — Model selection

"A product needs to classify 50,000 short product reviews per hour by sentiment, as cheaply and quickly as possible, with straightforward single-label output. Which model family is the best fit?"

A) Opus   B) Sonnet   C) Haiku   D) Whichever model supports the longest context window

Correct: C. High volume, simple classification, cost/latency-sensitive — exactly Haiku's positioning. A) is needlessly expensive/slow for this task. B) is a reasonable middle ground but not the best fit when cost/speed dominate and the task is simple. D) context window length is irrelevant to this requirement.

↑ back to top

↑ back to top