v0.21.0 — Anthropic-native /v1/messages fixes
Fixes the Anthropic-native /v1/messages surface (what Claude Code and the official anthropic SDK talk to).
Added
/v1/messages/count_tokensendpoint (#72) — resolves the model through the same router as/v1/messagesand forwards to Anthropic's realcount_tokens, returning{"input_tokens": N}verbatim. Non-billable. Previously 404'd, so clients silently fell back to approximate local token estimation.
Fixed
/v1/messagestraffic invisible to metrics & budget (#71) —record_requestdroppedtype="messages"entries, so all Anthropic-native traffic was missing from Prometheus counters and the budget tracker. The recorder now acceptsmessagesentries and the handler computes cost/status/latency/token counts on both paths (streaming usage recovered from SSEmessage_start/message_delta).max_tokensnot reconciled vs the routed model's output ceiling (#73) — on amax_tokens: N > M400,/v1/messagesnow clamps toMand retries once (streaming + non-streaming), tagging non-streaming responses withX-NadirClaw-MaxTokens-Clamped: true.nadirclaw testfailed for Claude subscription tokens (#74) — it calledlitellm.completion()directly, sendingsk-ant-oat*tokens asx-api-keyinstead ofAuthorization: Bearer+ theoauth-2025-04-20beta header the server uses. It now probes Anthropic models through the same OAuth path as the running server.
Full test suite green (831 passed).