anthropic-version header error
Resolve missing or invalid anthropic-version header errors when making direct HTTP requests to the Claude API.
Updated 8/20/2026Powered by Tickd.ai
When making direct HTTP requests to the Claude API without using official Anthropic SDKs, you must manually supply a header specifying which API version your integration target uses. Missing or incorrectly formatted version headers will cause your request to be rejected instantly by the API gateway. Follow these steps to configure your headers correctly.
1. Add the mandatory API version key
Every manual HTTP call to the Claude API must include the anthropic-version header. This allows the backend to handle backward compatibility. Ensure your request header dictionary contains the key anthropic-version paired with the appropriate API date string (for example, 2023-06-01).
2. Check for casing and middleware stripping
HTTP headers are technically case-insensitive, but some proxy servers, custom firewalls, or aggressive security tools might sanitise or drop custom headers that contain hyphens. Verify that your server environment is not removing or renaming anthropic-version before it reaches the external internet. Testing your raw curl command directly from your server command line can help isolate this middleware issue.
3. Account status and billing validations
If your headers are perfectly formatted but you still receive authentication or state-based rejections, ensure your account has not run out of active credits; see our checklist for resolving Claude Billing and Payment Problems. A lack of funds can sometimes surface as generic gateway header or authentication rejections when custom configurations are used.
4. Align SDK equivalents when migrating
If you are migrating code from an official SDK to a custom fetch request, the official libraries inject this version header automatically under the hood. To emulate this behaviour in raw languages (such as PHP, Go, or raw C# HTTP clients), you must explicitly set the header in your client configuration object rather than assuming the payload handles it.
5. Use the exact date format required
Anthropic versions are defined by specific dates rather than semantic version numbers (like v1 or v2). Do not guess the version string. Using an unsupported date string like '2024-01-01' will cause the API gateway to reject your connection. Stick to the officially supported dates, most commonly 2023-06-01, to maintain a stable handshake.