The Anthropic API has a 5MB limit on base64-encoded images, not raw file size. Base64 encoding increases size by ~33% (4/3 ratio), so a 4MB raw image becomes ~5.3MB encoded, exceeding the limit. Changed MAX_IMAGE_SIZE from 5MB to ~3.75MB (5MB * 3/4) to trigger resizing before the base64-encoded result exceeds the API limit. Also updated target resize size to 3.6MB to leave margin.