One change
token-counting
build-with-claude/token-counting
Nearest release: v2.1.239, published 2 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
build-with-claude/token-counting Changed · +4 / -2 lines
from line 516
```python Python import base64 - import httpx + import httpx2 image_url = "https://platform.claude.com/docs/images/vision-example.jpg" image_media_type = "image/jpeg" - image_data = base64.standard_b64encode(httpx.get(image_url).content).decode("utf-8") + image_data = base64.standard_b64encode(httpx2.get(image_url).content).decode("utf-8") client = anthropic.Anthropic()
from line 771
```json Output { "input_tokens": 1028 } ``` + +An embedded image block that sets [`"oversized_image": "error"`](https://platform.claude.com/docs/en/build-with-claude/vision-coordinates#oversized-image-error) is rejected at count time exactly as the Messages API would reject it. ### Count tokens in messages with thinking