Courseiva
Using the Claude API →hardMultiple Choice

CCAO-F Using the Claude API Practice Question

A developer is tuning a classification workload that sends many short prompts to the Claude Messages API. They want to reduce cost and latency without changing the model or the prompt text. They set up prompt caching for the shared system prompt. Which configuration correctly enables caching for that system prompt block?

⚠ Common exam trap

The trap here is assuming caching is a global request flag or a separate stored resource, when it is actually declared inline on individual content blocks.

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

✓

Add a cache_control object with type "ephemeral" to the system prompt content block in the request.

Prompt caching in the Messages API is opt-in per content block using a cache_control field with type "ephemeral". Marking the shared system prompt lets the API reuse that prefix across requests, cutting cost and latency for repeated short prompts. No top-level flag or separate resource is involved, and the model and prompt text stay unchanged.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Set a top-level enable_cache boolean to true in the request body alongside the model and max_tokens fields.

    Why it's wrong here

    There is no top-level enable_cache parameter in the Messages API. Caching is controlled per content block through cache_control, not by a global flag. A request using this invented field would simply not activate caching, so the developer would see no cost or latency improvement and might wrongly conclude caching is unavailable for the workload.

  • ✗

    Send the system prompt as a separate request first, then reference its id in subsequent message requests.

    Why it's wrong here

    The Messages API does not expose a separate system prompt resource with an id to reference later. Prompt caching is inline: the same prefix is marked with cache_control within each request and the API reuses it when the prefix matches. This invented two-step flow would add complexity and fail to enable caching at all.

  • ✗

    Add a cache_control field to the model parameter so the selected model is cached between calls.

    Why it's wrong here

    cache_control applies to content blocks such as system prompts, tools, or messages, not to the model parameter. The model is a scalar identifier, not cacheable content. Attaching cache control there is invalid and would not produce cached prefixes, so the shared system prompt would be reprocessed on every request and the intended savings would not materialize.

  • ✓

    Add a cache_control object with type "ephemeral" to the system prompt content block in the request.

    Why this is correct

    Prompt caching is enabled per content block by attaching a cache_control field with type "ephemeral". Placing it on the system prompt block marks that prefix for caching, so repeated requests reuse the cached tokens and reduce both cost and latency. This is the documented mechanism and requires no change to the model or prompt wording.

About these practice questions

One of 259 original CCAO-F practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.