D2: Messages API Fundamentals
Claude Certified Developer – Foundations exam practice questions · 12 flashcards
Question
Which endpoint generates Claude responses?
1 / 12
Tip: Space flips the card, ← / → navigate.
Show all 12 Messages API Fundamentals practice questions and answers
- Which endpoint generates Claude responses?POST /v1/messages (the Messages API).
- Which headers does a direct Messages API call need?x-api-key, anthropic-version (e.g. 2023-06-01) and content-type: application/json.
- What are the three required request parameters?model, max_tokens and messages.
- Where does the system prompt go in an API request?In the top-level system parameter, not as a message role.
- Which roles can messages have?user and assistant, typically alternating, starting with user.
- Is the Messages API stateful?No. It's stateless; you send the full conversation history with every request.
- What does max_tokens control?The maximum number of output tokens Claude may generate; it's a hard cap, not a target.
- What does stop_reason 'max_tokens' mean?The response was cut off at the output limit and is likely incomplete.
- What are the common stop_reason values?end_turn, max_tokens, stop_sequence, tool_use, pause_turn and refusal.
- What does the usage object report?input_tokens and output_tokens, plus cache creation and cache read tokens when caching is used.
- What content block types can a response contain?text, tool_use and thinking blocks (plus server-tool result blocks when used).
- What does temperature do?Controls randomness (0–1); lower is more deterministic, higher more varied.