What is the purpose of the 'anthropic-version' header required in Claude API requests?
Select an answer to reveal the explanation.
Short Explanation and Infographic
The anthropic-version header tells the API which version of the API spec your client speaks — like a handshake that ensures the server and client agree on the message format.
Full explanation below image
Full Explanation
The 'anthropic-version' header (e.g., '2023-06-01') declares the API version the client is targeting. This allows Anthropic to make backwards-incompatible changes in newer API versions while supporting older clients. If a client sends an older version value, Anthropic's servers respond with the corresponding API behavior for that version. This is different from the model version (specified in the 'model' request parameter). Option A confuses API version with model version. Option C describes SDK versioning, not an API header. Option D is nonsensical.