Courseiva
Using the Claude API →easyMultiple Choice

CCAO-F Using the Claude API Practice Question

A developer is building a document-summarization service with the Claude API. After upgrading from a Claude 3 model to a newer model, the application's HTTP requests start failing with a 400 error complaining about an unrecognized parameter. The developer's request body includes a field that was accepted before. Which change to the request body is MOST likely required?

⚠ Common exam trap

The trap here is assuming that any 400 from the API means the message structure is wrong, when a single legacy field name is often the sole cause.

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

✓

The deprecated 'max_tokens_to_sample' field must be replaced with 'max_tokens'.

Modern Claude models are called through the Messages API, where the output-length cap is expressed as max_tokens. Requests that still carry the older max_tokens_to_sample field are rejected as malformed, so the minimal correct fix is to rename that field. Parameters such as temperature and system remain top-level and valid, so restructuring them would not resolve the 400 error.

Answer analysis

Option-by-option breakdown

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

  • ✓

    The deprecated 'max_tokens_to_sample' field must be replaced with 'max_tokens'.

    Why this is correct

    The older Text Completions-era field max_tokens_to_sample was removed in favor of max_tokens on the Messages API. A request still sending max_tokens_to_sample to a current model endpoint returns a 400 for an unrecognized parameter, so renaming the field to max_tokens restores compatibility for this summarization service.

  • ✗

    The 'messages' array must be renamed to 'prompt' to match the newer schema.

    Why it's wrong here

    The Messages API uses a messages array of role/content objects; renaming it to prompt would create an even more fundamental schema violation and the request would still be rejected. The reported failure points at a single legacy field, not at the overall message structure used by this summarization application.

  • ✗

    The 'system' prompt must be converted into a user message before sending.

    Why it's wrong here

    The top-level system parameter is a supported part of the Messages API and is the intended way to set persistent instructions. Converting it into a user message would change conversation semantics and would not fix the unrecognized-parameter 400, because the offending field is unrelated to how the system prompt is supplied.

  • ✗

    The 'temperature' parameter must be moved inside the 'metadata' object.

    Why it's wrong here

    Temperature controls randomness in sampling and belongs at the top level of the Messages API request body. Nesting it inside metadata, which only carries structured labels such as user_id, would not be recognized by the API and would still produce the same invalid-parameter 400 error in this summarization scenario.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

Courseiva writes every CCAO-F question from scratch — 259 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.