Courseiva
Using the Claude API →hardMultiple Choice

CCAO-F Using the Claude API Practice Question

Exhibit

{
  "model": "claude-3-5-sonnet-20240620",
  "messages": [
    {"role": "user", "content": "Analyze this data: [DATA]"}
  ],
  "system": "You are a data analyst.",
  "max_tokens": 4096
}

Refer to the exhibit. An engineer wants to use Prompt Caching to optimize this request. What is the correct way to modify the request body to enable this?

⚠ Common exam trap

Candidates often try to enable caching by adding a top-level parameter or a system prompt flag, forgetting that 'cache_control' must be placed inside the specific content block.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Nest a 'cache_control' object within the content block of the message.

Prompt caching requires the inclusion of a 'cache_control' block within the message content. This tells the API to store the processed state of that specific chunk. This is critical for high-latency or high-cost prompts because it allows for faster processing of subsequent requests that share the same cached prefix, significantly reducing latency and cost for repetitive tasks like data analysis.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Add a 'cache_control' field to the root level of the JSON body.

    Why it's wrong here

    The 'cache_control' object must be placed inside the content block of the message, not the root level of the JSON request. The root level parameters are reserved for model selection, tokens, and system prompts. Placing it at the root will cause an invalid request error from the API.

  • ✓

    Nest a 'cache_control' object within the content block of the message.

    Why this is correct

    Prompt caching is activated by adding a cache_control block to the content of a message. This instructs the Anthropic API to store the preceding tokens in the cache. This is the correct structural way to enable the caching feature as defined in the Anthropic API technical documentation.

  • ✗

    Rename the 'system' field to 'system_cached'.

    Why it's wrong here

    There is no 'system_cached' parameter in the API. Prompt caching is a structural feature that works through the content blocks of messages, not by modifying the names of existing top-level parameters. Misnaming parameters will simply result in an error, as the API does not recognize such fields.

  • ✗

    Enable 'caching=true' in the request headers.

    Why it's wrong here

    There is no 'caching' header for the Anthropic API. Prompt caching is managed entirely within the body of the request, specifically within the 'content' array of the 'messages' parameter. This ensures that caching is granular and can be applied to specific parts of the prompt rather than the whole.

About these practice questions

This CCAO-F question is part of Courseiva's 259-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Anthropic exam blueprint

This CCAO-F practice question is part of Courseiva's free Anthropic certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CCAO-F exam.