First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Claude API Fundamentals: models, messages, tokens, and request/response structure
Which HTTP request header tells the Anthropic Messages API which API version the client is written against?
- anthropic-version Correct answer.
- anthropic-beta
- content-type
- x-api-key
Explanation
Every Messages API call must carry the anthropic-version header, currently set to a dated value such as 2023-06-01, which pins the request/response contract the client expects. The other headers serve different purposes: authentication, content encoding, or opting into pre-release features.
Question 2Claude API Fundamentals: models, messages, tokens, and request/response structure
Which combination of body parameters is required in every Messages API request?
- model, messages, system
- model, stream, messages
- model, temperature, messages
- model, max_tokens, messages Correct answer.
Explanation
The Messages API requires model, max_tokens, and messages; omitting any of them produces a validation error. Parameters such as system, temperature, and stream are optional and fall back to defaults when absent.
Question 3Claude API Fundamentals: models, messages, tokens, and request/response structure
How is the system prompt supplied in a Messages API request?
- As a system-role message appended after the final user message
- In a top-level system field separate from messages Correct answer.
- As the first item in the messages array with role set to system
- Inside the anthropic-version header alongside the date
Explanation
The system prompt lives in its own top-level system parameter, which accepts a string or a list of content blocks. The messages array only accepts the user and assistant roles, so system instructions are never embedded there.
Question 4Claude API Fundamentals: models, messages, tokens, and request/response structure
The content field of a successful Messages API response is best described as which of the following?
- an object keyed by block type
- an array of role-tagged message objects
- an array of content blocks Correct answer.
- a single string containing the generated text
Explanation
Responses return content as an ordered array of content blocks, each with a type such as text, tool_use, or thinking. Clients read the blocks in order rather than assuming one plain string, because a single reply may contain several blocks.
Question 5Claude API Fundamentals: models, messages, tokens, and request/response structure
Which Claude model family is positioned as the fastest and most cost-effective option for high-volume, latency-sensitive tasks?
- Claude Haiku Correct answer.
- Claude Instant
- Claude Opus
- Claude Sonnet
Explanation
The Claude lineup is tiered by capability and cost, with Haiku targeting low latency and high throughput. Opus sits at the top of the capability range and Sonnet in the middle, both generally slower and more expensive per token than Haiku.
Question 6Claude API Fundamentals: models, messages, tokens, and request/response structure
A request omits the temperature parameter. What value does the API use?
- 0.7
- 0.0
- 0.5
- 1.0 Correct answer.
Explanation
Temperature defaults to 1.0 when the field is omitted, and its accepted range is 0.0 through 1.0. Values closer to 0 make output more deterministic, while values closer to 1 increase variability.
Question 7Claude API Fundamentals: models, messages, tokens, and request/response structure
What does the stop_sequences parameter do?
- It caps the number of content blocks in the reply.
- It strips the matched text from the returned content.
- It halts generation when a specified string appears. Correct answer.
- It limits how many tokens the model may generate.
Explanation
stop_sequences accepts custom strings that, when generated, cause the model to stop; the response then reports stop_reason of stop_sequence. Output length is governed separately by max_tokens, which is a token budget rather than a string match.
Question 8Claude API Fundamentals: models, messages, tokens, and request/response structure
Which roles may appear on entries in the messages array?
- user and assistant Correct answer.
- user and system
- user, assistant, and system
- system, user, assistant, and tool
Explanation
The messages array accepts only user and assistant turns, which may be given as a string or as a list of content blocks. System instructions belong in the separate top-level system field, and tool results are delivered as user-turn content blocks rather than as their own role.
Question 9Claude API Fundamentals: models, messages, tokens, and request/response structure
A response comes back with stop_reason set to max_tokens. What does this indicate?
- The model emitted one of the configured stop sequences.
- The request exceeded the model's context window.
- The reply reached max_tokens and may be truncated. Correct answer.
- The model finished and returned its complete answer.
Explanation
The stop_reason field explains why generation ended, and max_tokens means the output token budget was exhausted, so the reply may be cut off mid-thought. A natural finish is reported as end_turn, and a matched custom string is reported as stop_sequence.
Question 10Claude API Fundamentals: models, messages, tokens, and request/response structure
A developer ends the messages array with an assistant-turn message containing the partial text {"name":. What is the expected behavior?
- The partial assistant message is discarded before the request is sent.
- The model restarts the answer and ignores the partial content entirely.
- The request is rejected because a conversation must end on a user turn.
- The model continues generation from that partial text. Correct answer.
Explanation
An assistant turn in the final position acts as a prefill: the model resumes from that content instead of starting over. This is a common technique for forcing output format, such as opening a JSON object so the reply must continue as JSON.
Question 11Claude API Fundamentals: models, messages, tokens, and request/response structure
Claude keeps no state between API calls. What must a client do to maintain a multi-turn conversation?
- Send the full prior conversation in messages on every request. Correct answer.
- Store the response id and resend it with each new user message.
- Pass a conversation_id so the API can reload stored history.
- Enable stream so turns are cached on the server between calls.
Explanation
Each Messages API call is independent, so the client is responsible for replaying the conversation history it wants the model to see. Prior assistant replies are sent back as assistant turns and are billed as input tokens on the next request.
Question 12Claude API Fundamentals: models, messages, tokens, and request/response structure
How can a developer measure the input token count of a prompt without generating a completion?
- Read the input_tokens field from the previous response.
- Post the same payload to the count_tokens endpoint. Correct answer.
- Multiply the number of prompt characters by four.
- Send the request with max_tokens set to zero.
Explanation
The dedicated count_tokens endpoint accepts the same message structure as a real request and returns the token count without producing output. Because tokenization depends on the exact model and content, estimating from character counts is only approximate.
Question 13Claude API Fundamentals: models, messages, tokens, and request/response structure
If the messages array contains two consecutive user messages, how does the API handle them?
- It combines them into a single user turn. Correct answer.
- It ignores the second message and keeps the first.
- It returns a 400 error for invalid role alternation.
- It inserts an empty assistant turn between them.
Explanation
The API normalizes the conversation by merging adjacent turns from the same role into one turn before the model sees it. This lets clients append content without manually coalescing messages, and no validation error is raised.
Question 14Claude API Fundamentals: models, messages, tokens, and request/response structure
Which fields in the response usage object report prompt caching activity?
- total_tokens and cached_tokens, reported only when caching is enabled
- cache_creation_input_tokens and cache_read_input_tokens Correct answer.
- input_tokens and output_tokens, which include all cached content
- prompt_tokens and cached_prompt_tokens
Explanation
The usage object reports cache_creation_input_tokens for tokens written into the cache and cache_read_input_tokens for tokens served from it. The input_tokens and output_tokens fields still describe the non-cached accounting for the request.
Question 15Claude API Fundamentals: models, messages, tokens, and request/response structure
Which content block shape passes an inline base64-encoded image to the model?
- A block with type media carrying a base64 payload string
- A block with type image and a source of type base64 Correct answer.
- A block with type attachment and a local file path
- A block with type file that wraps a data URI string
Explanation
Image blocks use type image with a nested source object whose type is base64, plus media_type and data fields. Images can alternatively be referenced through a source of type url, but local file paths are never sent directly.
Question 16Claude API Fundamentals: models, messages, tokens, and request/response structure
Which pair of parameters both control response randomness and should generally not be tuned together?
- system and metadata
- max_tokens and stop_sequences
- temperature and top_p Correct answer.
- top_k and max_tokens
Explanation
Temperature and top_p are alternative ways to shape the sampling distribution, and Anthropic recommends adjusting one or the other rather than both at once. Stacking changes to both makes the effect on output hard to reason about.
Question 17Claude API Fundamentals: models, messages, tokens, and request/response structure
What is the purpose of the metadata.user_id field?
- It selects which model version will serve the request.
- It tags requests with an end-user identifier for abuse tracking. Correct answer.
- It authenticates the caller in place of the API key.
- It scopes rate limits to an individual end user.
Explanation
metadata.user_id lets a caller attach a stable, non-identifying end-user token so Anthropic can help detect and investigate abuse. It is purely supplemental metadata and has no effect on authentication, quotas, or model routing.
Question 18Claude API Fundamentals: models, messages, tokens, and request/response structure
A response returns stop_reason of tool_use. What should the client do next?
- Retry the same request because the reply was cut off.
- Treat the turn as complete and close the conversation.
- Execute the requested tool and return a tool_result. Correct answer.
- Raise max_tokens and resend the identical prompt.
Explanation
A tool_use stop reason means the model emitted a tool_use block and is waiting for the result. The client runs the tool, then sends a user turn containing a tool_result block so the model can continue the turn.
Question 19Claude API Fundamentals: models, messages, tokens, and request/response structure
Which statement correctly distinguishes the context window from max_tokens?
- The context window bounds total tokens; max_tokens bounds the reply. Correct answer.
- Both terms describe the same cap and differ only in units.
- The context window bounds the input only, and max_tokens bounds the whole conversation.
- max_tokens bounds the full context and the window bounds one reply.
Explanation
The context window is the total budget of tokens the model can consider in one request, covering input plus generated output. max_tokens is a narrower cap on how many tokens may be generated in the reply.
Question 20Claude API Fundamentals: models, messages, tokens, and request/response structure
How does a model alias such as claude-sonnet-4-5 differ from a full model ID such as claude-sonnet-4-5-20250929?
- The alias accepts a larger context window than the dated snapshot.
- The alias is only usable when the stream parameter is true.
- The alias is billed at a lower per-token rate than the dated snapshot.
- The alias points to the latest snapshot and can change over time. Correct answer.
Explanation
An alias resolves to whichever dated snapshot is currently the latest release for that model, so behavior can shift when a new snapshot ships. Pinning the full dated ID freezes behavior for reproducible workloads, and both are priced and sized identically.
Question 21Claude API Fundamentals: models, messages, tokens, and request/response structure
Which sequence of server-sent events describes a streamed text response?
- message_start, content_block_start, content_block_delta, message_delta, content_block_stop, message_stop
- message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop Correct answer.
- content_block_start, message_start, content_block_delta, message_delta, content_block_stop, message_stop
- message_start, content_block_delta, content_block_start, content_block_stop, message_stop, message_delta
Explanation
Streaming opens with message_start, then each block is bracketed by content_block_start and content_block_stop with deltas in between, and the message closes with message_delta followed by message_stop. The message_delta event arrives after all content blocks have stopped and carries final stop_reason and usage totals.
Question 22Claude API Fundamentals: models, messages, tokens, and request/response structure
Which elements contribute to the input_tokens figure reported in a response's usage object?
- The system prompt, all message content, and any tool definitions. Correct answer.
- Only the system prompt plus the final assistant turn.
- Only the messages array, excluding the system prompt.
- Only the text of the most recent user message.
Explanation
input_tokens covers everything the model must read for the request: the system prompt, every turn in the messages array, and any tool schemas supplied. This is why long conversation histories grow input cost on each successive call.
Question 23Claude API Fundamentals: models, messages, tokens, and request/response structure
A request fails with HTTP 529 and an error type of overloaded_error. What is the appropriate client response?
- Rotate the API key, because the credential was rejected.
- Shorten the prompt, since 529 signals a request that is too large.
- Retry with exponential backoff; the API is temporarily overloaded. Correct answer.
- Lower max_tokens, because the output budget was too high.
Explanation
The 529 status with overloaded_error indicates that Anthropic's systems are temporarily saturated, which is transient by nature. Clients should retry with exponential backoff and jitter rather than changing the request payload.
Question 24Claude API Fundamentals: models, messages, tokens, and request/response structure
During a streamed tool call, which delta type carries the incremental JSON for the tool input?
- text_delta
- signature_delta
- tool_use_delta
- input_json_delta Correct answer.
Explanation
Tool arguments arrive as partial JSON strings delivered through input_json_delta events inside the tool_use content block. Clients must concatenate the fragments and parse the result only after the block stops.
Question 25Claude API Fundamentals: models, messages, tokens, and request/response structure
To enable a beta capability such as an extended context window, what must a request include?
- An opt-in flag in the metadata object.
- An anthropic-beta header listing the beta identifier. Correct answer.
- A query string parameter naming the beta feature.
- A beta field inside the messages array.
Explanation
Beta capabilities are gated behind the anthropic-beta request header, whose value names the specific beta identifiers being used. The standard anthropic-version header stays in place alongside it, and no per-message opt-in exists.
Question 26Claude API Fundamentals: models, messages, tokens, and request/response structure
Which HTTP header carries the Anthropic API key on a request to the Messages API?
- x-api-key Correct answer.
- Authorization: Bearer <key>
- anthropic-key
- x-auth-token
Explanation
Requests to the Anthropic Messages API authenticate with an API key supplied in the x-api-key request header, together with the anthropic-version header. Bearer-token and alternate header names are not used for this endpoint.
Question 27Claude API Fundamentals: models, messages, tokens, and request/response structure
A developer wants standing instructions that apply to every turn of a conversation without those instructions appearing as entries in the messages array. Which request field is used?
- tools
- metadata
- system Correct answer.
- stop_sequences
Explanation
The top-level system field carries instructions and context that apply to the whole conversation while remaining outside the messages array. It is a peer of model, max_tokens, and messages, not a message role.
Question 28Claude API Fundamentals: models, messages, tokens, and request/response structure
What is the accepted range of values for the temperature parameter?
- 0 to 2
- 1 to 100
- -1.0 to 1.0
- 0 to 1 Correct answer.
Explanation
Claude models accept a temperature between 0 and 1 inclusive. A value of 0 makes responses as deterministic as the model allows, while higher values increase variability.
Question 29Claude API Fundamentals: models, messages, tokens, and request/response structure
Which top-level field of a Messages API response reports why the model stopped generating?
- usage - the token accounting object for the call
- stop_reason Correct answer.
- id - the unique identifier assigned to the message
- model - the identifier of the model that served the request
Explanation
stop_reason is the field that gives the categorical reason generation ended, such as a natural end of turn, a matched stop sequence, or a token limit. The other top-level fields describe accounting, model identity, and message identity rather than completion status.
Question 30Claude API Fundamentals: models, messages, tokens, and request/response structure
Besides model and messages, which parameter is required in every call to the Messages API?
- top_p
- temperature
- system
- max_tokens Correct answer.
Explanation
max_tokens is a required field with no default value; a request that omits it is rejected with an invalid_request_error. The other sampling and instruction fields are optional.
Question 31Claude API Fundamentals: models, messages, tokens, and request/response structure
How may the content of a single entry in the messages array be supplied?
- A string or an array of blocks Correct answer.
- Only a Base64 string
- Only an array of content blocks
- Only a plain string
Explanation
The content field accepts either a plain string, as a shorthand for a single text block, or an array of content blocks such as text, image, or tool_result. The array form is required when a message mixes block types.
Question 32Claude API Fundamentals: models, messages, tokens, and request/response structure
A response returns with stop_reason set to end_turn. What should the developer conclude?
- The model is waiting for a tool result before it can continue.
- The model finished its reply naturally, so the turn is complete. Correct answer.
- One of the strings supplied in stop_sequences was matched and removed.
- The request exceeded the max_tokens budget before the reply was complete.
Explanation
end_turn means the model completed its response on its own and the assistant turn is finished. The client can append the assistant message and send the next user message to continue the conversation.
Question 33Claude API Fundamentals: models, messages, tokens, and request/response structure
When generation halts because the model produced one of the strings listed in stop_sequences, which response field contains that matched string?
- stop_reason - the categorical reason generation halted
- stop_sequence Correct answer.
- content - the generated text blocks
- usage - the token accounting for the call
Explanation
The stop_sequence field echoes the specific string that triggered the halt, while stop_reason merely records that a stop sequence was matched. The matched sequence itself is not included in the returned content.
Question 34Claude API Fundamentals: models, messages, tokens, and request/response structure
What does the top_k parameter control?
- It caps the total number of tokens the model may generate in one reply.
- It sets how many independent completions the request returns.
- It limits each sampling step to the K most likely tokens. Correct answer.
- It sets the maximum number of stop sequences allowed.
Explanation
top_k restricts the candidate pool at each generation step to the K highest-probability tokens, trimming the tail of the distribution. It is a sampling control, distinct from max_tokens, which caps output length.
Question 35Claude API Fundamentals: models, messages, tokens, and request/response structure
A request returns HTTP 400 with an error type of invalid_request_error. Which cause is most consistent with that response?
- The supplied API key is missing or has been revoked.
- The API is temporarily overloaded and cannot serve the request.
- The request body omitted the required max_tokens field. Correct answer.
- The account has exceeded its configured request rate.
Explanation
invalid_request_error with a 400 status signals a malformed or incomplete request body, such as a missing required field or an invalid parameter value. Rate limits, overload, and authentication failures each map to their own status codes and error types.
Question 36Claude API Fundamentals: models, messages, tokens, and request/response structure
Among the Claude model families, which is designed for the lowest latency and lowest cost?
- The family names do not indicate latency or cost.
- Opus
- Haiku Correct answer.
- Sonnet
Explanation
Haiku is the small, fast family, positioned for high-throughput and latency-sensitive work at the lowest price. Opus is the most capable and most expensive, with Sonnet balanced between the two.
Question 37Claude API Fundamentals: models, messages, tokens, and request/response structure
What does the output_tokens field of the usage object count?
- The tokens the model generated in its reply Correct answer.
- The tokens in the system prompt that was sent with the request
- The tokens in the final text block only, excluding other content blocks
- The tokens in the messages the client included in the request
Explanation
usage.output_tokens reports the tokens generated by the model for that response, across everything it produced. Content sent by the client is counted under input_tokens instead.
Question 38Claude API Fundamentals: models, messages, tokens, and request/response structure
A request enables extended thinking with thinking.budget_tokens set to 8000 while max_tokens is set to 6000. What does the API do?
- It raises max_tokens to 8000 automatically.
- It accepts the request and truncates the visible reply.
- It silently lowers the thinking budget to 6000.
- It rejects the request with a 400 error. Correct answer.
Explanation
The thinking budget must be at least 1024 tokens and strictly less than max_tokens, because thinking tokens are drawn from the same output allowance. A budget of 8000 against max_tokens of 6000 violates that constraint, so validation fails.
Question 39Claude API Fundamentals: models, messages, tokens, and request/response structure
A multi-turn conversation uses extended thinking together with tool use. When resending the assistant's prior turn in the messages array, how should the returned thinking blocks be handled?
- Move them to the start of the messages array as a system message.
- Strip them, since thinking tokens are not billed when resent.
- Replace them with a plain-text summary to reduce the token count.
- Include them unchanged, with signatures and original order. Correct answer.
Explanation
Thinking blocks carry a signature that the API uses to verify they came from the model, so they must be passed back intact and in their original positions within the assistant turn. Altering, reordering, or dropping them breaks continuation and can trigger a validation error.
Question 40Claude API Fundamentals: models, messages, tokens, and request/response structure
A request is rejected with HTTP 429 and an error type of rate_limit_error. Which response header tells the client how long to wait before retrying?
- content-type
- x-request-id
- retry-after Correct answer.
- anthropic-version
Explanation
A 429 response includes a retry-after header giving the delay the client should observe before sending another request. Honoring it, rather than retrying immediately, avoids prolonging the throttling.
Question 41Prompt Design and Prompt Engineering Techniques
Why is it useful to wrap a long document inside XML-style tags such as <contract>...</contract> in a Claude prompt?
- Tags are mandated by the API before Claude accepts long inputs.
- Tag boundaries let Claude separate instructions from document content. Correct answer.
- Tags compress the document so it uses fewer input tokens.
- Tags are mandatory whenever a prompt exceeds the context window.
Explanation
Delimiter tags let Claude treat blocks of text structurally, so it can tell which text is a document and which is an instruction. This reduces the chance of the model following text inside the document as if it were a command, and it improves extraction accuracy. Tags do not alter tokenization or satisfy any API requirement.
Question 42Prompt Design and Prompt Engineering Techniques
What is the primary function of a system prompt in a Claude request?
- It overrides the model's safety training for enterprise accounts.
- It caches user documents so later turns consume fewer tokens.
- It sets persistent role, context, and rules for the whole conversation. Correct answer.
- It stores conversation history that Claude replays in later sessions.
Explanation
The system prompt carries standing instructions that apply across every user turn: persona, tone, business rules, and output conventions. Keeping these rules there, rather than repeating them in each user message, makes behavior consistent. It does not store history, cache documents, or change safety behavior.
Question 43Prompt Design and Prompt Engineering Techniques
Why include a few worked input/output pairs in a prompt?
- They show the model the desired input-to-output pattern to imitate. Correct answer.
- They guarantee the model will not hallucinate on unseen inputs.
- They lower the temperature automatically for the rest of the prompt.
- They remove the need for any system instruction or role definition.
Explanation
Examples communicate format, tone, and decision boundaries more concretely than description alone, and Claude tends to imitate the pattern it is shown. This is especially effective for classification labels, structured output, and stylistic consistency. Examples guide behavior but cannot guarantee correctness on unseen inputs.
Question 44Prompt Design and Prompt Engineering Techniques
What does prefilling the assistant turn accomplish in a Claude request?
- It appends the assistant message to history so later turns can see it.
- It seeds the start of Claude's reply to lock in an output format. Correct answer.
- It forces Claude to skip its safety checks on the first turn.
- It raises the maximum number of output tokens for the reply.
Explanation
When the final message in the request has the assistant role, Claude continues from that text instead of starting fresh. Prefilling an opening brace, a tag, or a phrase therefore constrains the shape of everything that follows. It has no effect on token limits or safety evaluation.
Question 45Prompt Design and Prompt Engineering Techniques
A prompt currently says: "Do not use bullet points." Which rewrite best follows positive-instruction guidance?
- Avoid any use of bullet points or numbered lists in the summary.
- Never format your answer with lists of any kind.
- You must not produce list-style output under any circumstance.
- Write the summary as flowing prose paragraphs. Correct answer.
Explanation
Telling the model what to do is more reliable than telling it what to avoid, because a positive instruction describes the target behavior directly. Negative phrasing still leaves the model to infer the desired alternative. Stating "flowing prose paragraphs" removes that ambiguity.
Question 46Prompt Design and Prompt Engineering Techniques
You are extracting invoice number, date, and total from many documents and need identical output across repeated runs. Which temperature setting fits best?
- Set temperature to 1 so the model explores alternate field values.
- Set temperature to 0 so repeated runs return consistent extractions. Correct answer.
- Set temperature above 1 to increase precision of the extraction.
- Temperature is irrelevant here; adjust max tokens instead.
Explanation
Lower temperature narrows sampling toward the most probable tokens, which is what you want for deterministic, repeatable field extraction. Higher values increase variation, which is desirable for brainstorming but harmful for structured parsing. Output length limits are a separate concern.
Question 47Prompt Design and Prompt Engineering Techniques
Where should a long reference document and the question about it be positioned in a single prompt?
- Split the document across many small messages in random order.
- Put the question first and let the model scan the document afterwards.
- Put the long document first, with the question and instructions after it. Correct answer.
- Summarize the document yourself before sending it to the model.
Explanation
Claude recalls and uses content more reliably when the task instructions and question come after the long material they refer to. This ordering counteracts the tendency to lose track of information buried mid-context. Splitting the input across shuffled messages or summarizing first discards detail you may need.
Question 48Prompt Design and Prompt Engineering Techniques
What does asking Claude to work through its reasoning step by step before giving an answer improve?
- It removes the need to provide examples or a format specification.
- It gives the model intermediate steps to work through before answering. Correct answer.
- It reduces the number of output tokens the model must generate.
- It lowers the temperature of the request automatically.
Explanation
Explicit intermediate reasoning gives the model room to decompose a multi-step problem, which typically improves accuracy on arithmetic, logic, and multi-constraint tasks. It increases rather than decreases output length. It complements, rather than replaces, examples and format instructions.
Question 49Prompt Design and Prompt Engineering Techniques
Which tag-naming practice produces the most reliable results in a complex prompt?
- Use short opaque names such as <a>, <b>, and <c> to save tokens.
- Omit closing tags so the model does not stop generating early.
- Use a different delimiter style for every document in the prompt.
- Use descriptive, consistent names such as <invoice> and <policy_terms>. Correct answer.
Explanation
Tag names act as labels, and meaningful, consistent labels help Claude map each block to its purpose when instructions refer to those blocks. Mixed delimiter styles and missing closing tags break the structural signal. Token savings from cryptic names are negligible compared with the accuracy cost.
Question 50Prompt Design and Prompt Engineering Techniques
You need guaranteed JSON output from Claude. Which combination is most effective?
- Add the phrase "respond in JSON" once at the end of the user turn.
- Raise the temperature so the model can freely choose a format.
- Ask the model to explain its reasoning before writing the JSON.
- Prefill the assistant turn with '{' and specify fields above. Correct answer.
Explanation
Prefilling an opening brace makes a prose preamble structurally impossible, so the completion must continue as a JSON object. Pairing this with an explicit field description removes ambiguity about keys and value types. A single instruction at the end is weaker because the model may still preface the object with text.