token-counting changedbuild-with-claude/token-counting
Nearest release: v2.1.304, published under an hour after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+3added
Lines−6removed
From line
479
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits18to this page, all time
The whole hunk
from line 479, old and new numbered
/
from line 479
479479 ```bash cURL
480480 #!/bin/sh
481481
482 IMAGE_URL="https://platform.claude.com/docs/images/vision-example.jpg"
483 IMAGE_MEDIA_TYPE="image/jpeg"
484 IMAGE_BASE64=$(curl -s "$IMAGE_URL" | base64 | tr -d '\n')
482 IMAGE_BASE64=$(curl -s "https://platform.claude.com/docs/images/vision-example.jpg" | base64 | tr -d '\n')
485483
486484 curl https://api.anthropic.com/v1/messages/count_tokens \
487485 -H "x-api-key: $ANTHROPIC_API_KEY" \
from line 492
494492 {"role": "user", "content": [
495493 {"type": "image", "source": {
496494 "type": "base64",
497 "media_type": "$IMAGE_MEDIA_TYPE",
495 "media_type": "image/jpeg",
498496 "data": "$IMAGE_BASE64"
499497 }},
500498 {"type": "text", "text": "Describe this image"}
from line 503
505503 ```
506504
507505 ```bash CLI
508 IMAGE_URL="https://platform.claude.com/docs/images/vision-example.jpg"
509 curl -s "$IMAGE_URL" -o ./vision-example.jpg
506 curl -s "https://platform.claude.com/docs/images/vision-example.jpg" -o ./vision-example.jpg
510507
511508 ant messages count-tokens <<'YAML'
512509 model: claude-opus-5-5
No line in this hunk matches that.