CCDV-F Claude API Mechanics Practice Question
A developer is streaming a long Claude response using the Messages API with stream: true. Their client code reads Server-Sent Events and appends text to the UI. Mid-stream, the connection drops and the client reconnects by re-issuing the same request from scratch. Users complain that the answer restarts from the beginning. What is the most accurate explanation of what is happening?
⚠ Common exam trap
The trap here is assuming that streaming supports resumable delivery with an event ID like some message-queue protocols, when in fact each request is a fresh, non-resumable generation.
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
✓
Streaming responses are stateless; a dropped connection cannot be resumed, so re-issuing the request starts a brand new generation and the partial text already shown is discarded.
Streaming responses from the Messages API are not resumable: each HTTP request produces an independent generation delivered as Server-Sent Events. When the transport fails, the client cannot ask the server to continue from the last token it saw. The correct mitigation is to persist partial output locally, avoid blindly restarting the UI, and design retries that tolerate duplicate or truncated content.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Streaming responses are stateless; a dropped connection cannot be resumed, so re-issuing the request starts a brand new generation and the partial text already shown is discarded.
Why this is correct
Streaming in the Messages API is a one-shot delivery of an in-progress generation. If the HTTP connection drops, the server-side generation is not resumable by the client, so re-issuing the request begins a new generation from the same prompt. This is why the answer restarts. Clients must persist partial output and design idempotent retries rather than expecting continuation.
- ✗
The client must call the count_tokens endpoint before reconnecting so the server can splice the new stream onto the previous tokens.
Why it's wrong here
count_tokens returns a token count for a given input and does not influence or enable stream continuation. There is no server-side token splicing behavior tied to it. Using this endpoint before a reconnect would only add latency and cost without addressing the dropped stream; the new request still produces an independent generation regardless of how many times tokens are counted.
- ✗
The Messages API supports resuming a stream from the last received event, so the client should have sent the last event ID back on reconnect.
Why it's wrong here
The Messages API streaming interface does not provide a resume-from-offset mechanism where the client supplies a prior event identifier to continue an interrupted generation. Reconnecting simply starts a fresh generation, which is why users see the response begin again. Assuming a resume capability exists misdiagnoses the issue and leads developers to look for a nonexistent parameter instead of designing for retries.
- ✗
Setting a higher max_tokens on the reconnect lets the API detect the earlier partial output and continue from where it stopped.
Why it's wrong here
max_tokens caps the number of tokens generated for a single request; it does not act as a signal for the API to recall or continue a prior interrupted response. The server keeps no reference to the dropped stream. Raising it may allow a longer answer but will not prevent the visible restart that users are reporting.
About these practice questions
This CCDV-F question is part of Courseiva's 257-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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 CCDV-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 CCDV-F exam.