Check the second-turn payload when upgrading Anthropic SDK clients on CometAPI
If an application already uses Anthropic’s native Messages format through CometAPI, an SDK upgrade can change a boundary that is easy to miss: turning the completed first response back into parameters for the next request.
Anthropic’s Python SDK v1.5.0 release notes list Message.to_param() and BetaMessage.to_param(). They also note a fix that leaves parsed_output out of dumped text blocks (release notes). Those entries justify inspecting the conversion helper; they do not prove a universal round trip, a particular installed signature, or that every content block is valid input.
CometAPI’s native path keeps the Anthropic client and calls client.messages.create with https://api.cometapi.com as the base URL (CometAPI guide). The guide distinguishes that route from its OpenAI-compatible path and recommends separate request builders when contracts diverge. That makes the integration decision concrete: do not silently feed a native response through a generic Chat Completions serializer.
A cautious upgrade check:
- Pin the SDK version and an explicitly verified Claude model ID for the CometAPI Messages route. Do not infer current model availability from this release note.
- Capture a representative first-turn response as sanitized test data. Run the installed
to_param()helper and compare its structure with the application’s current serializer. - Inspect the resulting blocks. Confirm that fields intended only for output—especially parsed data—are not being sent as text-block input. Treat the helper’s exact output as something to verify, not something this article has executed.
- Build a second request that genuinely needs the first response, add the next user turn, and validate the request shape against the selected native route. Record accepted fields and any rejection; do not call a one-turn success evidence of two-turn compatibility.
Keep the old serializer available for comparison during the migration, and make the test fail loudly when required conversation content disappears. BetaMessage.to_param() is not proof that a beta endpoint or every beta field is supported by CometAPI. The useful outcome is a recorded compatibility decision for your route and SDK version—not a claim that the upgrade fixed a CometAPI defect.