Token counting returns 404, and that is expected
POST /v1/messages/count_tokens answers 404 with {"type":"error","error":{"type":"not_found_error","message":"Token counting is not supported for this platform"}} whenever the key resolves to an OpenAI-compatible group. Every model sold here is on such a platform (GLM, Kimi, DeepSeek, Qwen, MiniMax), so this endpoint is never available in practice. Claude Code degrades to its own estimate and keeps working; treat the 404 in your logs as normal rather than a broken key.