Claude’s Preserved Thinking 400: Do Not Replay an Edited Thinking Block
Editing, reordering or truncating preserved-thinking history can invalidate signatures; repeating the request does not help.
Integrating and tuning Anthropic's Claude models.
Editing, reordering or truncating preserved-thinking history can invalidate signatures; repeating the request does not help.
A token is not a character count; English approximations do not transfer mechanically to Chinese, and history/tools consume budget.
The window includes input, history, tools and output; max_tokens is an output budget, not extra space.
Caching splits a prompt prefix into three prices — normal input, cache write, cache read. You only start saving on the second reuse, and one channel switch on a gateway can reset your hit rate to zero.
Claude's native protocol differs from OpenAI's, but a gateway gives you two doors — the native messages endpoint or the OpenAI-compatible chat/completions. Here is the setup for each, plus the three places people break.
The SalpX gateway is OpenAI-SDK compatible. Point base_url at https://www.salpx.com/v1 and you are done.