Courseiva
Using the Claude API →easyMultiple Choice

CCAO-F Using the Claude API Practice Question

A developer is writing the first integration test against the Claude Messages API using the official Anthropic SDK. The test must send a single user turn and read the model's text reply. Which request structure correctly represents the required Messages API input?

⚠ Common exam trap

The trap here is carrying over the legacy completions habit of sending a top-level prompt string, or treating the system prompt as a message role, instead of using the messages array with user and assistant roles.

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

✓

A messages array containing one object with role "user" and content set to the prompt string, plus the model and max_tokens parameters.

The Messages API expects a required model, a required max_tokens, and a messages array whose entries use role "user" or "assistant" with string or block content. A single user message with a string prompt is the smallest valid request. System instructions are passed through a separate top-level system field, and the model must always be named explicitly, so the other structures would be rejected before generation.

Answer analysis

Option-by-option breakdown

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

  • ✗

    A messages array with alternating user and assistant turns, and the model name omitted because it is inferred from the endpoint.

    Why it's wrong here

    The model identifier is a required request parameter; it is not inferred from the endpoint, since one endpoint serves many models. Omitting it causes an error regardless of how well-formed the messages array is. Additionally, a first single-turn test does not need alternating turns, so this structure is both incomplete and unnecessarily complex.

  • ✗

    A messages array with a single object whose role is "system" and content set to the prompt, plus max_tokens.

    Why it's wrong here

    The system prompt is not expressed as a message with role "system" in the messages array. It is passed separately as a top-level system parameter, and messages must use the "user" and "assistant" roles. A message array containing only a system role is invalid, so this request would be rejected and the test would never reach the model.

  • ✗

    A prompt parameter containing the text, plus the model name, with no messages array.

    Why it's wrong here

    The Messages API does not accept a top-level prompt parameter; that shape belongs to the older text-completion style interface. Sending a request without a messages array will be rejected as malformed. The developer must supply the conversation turns as messages, so this structure fails before the model is ever invoked.

  • ✓

    A messages array containing one object with role "user" and content set to the prompt string, plus the model and max_tokens parameters.

    Why this is correct

    The Messages API requires a model, a max_tokens value, and a messages array. Each message has a role of "user" or "assistant" and content that is a string or a list of content blocks. A single user message with a string prompt is the minimal valid request, so this structure satisfies the API contract for a first integration test.

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.