vision changedbuild-with-claude/vision
Nearest release: v2.1.309, published 3 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.
Recorded here
Lines+95added
Lines−81removed
From line
128
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits15to this page, all time
The whole hunk
from line 128, old and new numbered
/
from line 128
128128 source: {
129129 type: "base64",
130130 media_type: "image/jpeg",
131 data: imageData // Base64-encoded image data as string
131 data: imageData // base64-encoded image data as string
132132 }
133133 },
134134 {
from line 203
203203 ```java Java
204204 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
205205 String imageData =
206 "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC";
206 "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC";
207207
208208 List<ContentBlockParam> contentBlockParams = List.of(
209 ContentBlockParam.ofImage(
210 ImageBlockParam.builder()
211 .source(
212 Base64ImageSource.builder()
213 .mediaType(Base64ImageSource.MediaType.IMAGE_PNG)
214 .data(imageData)
215 .build()
216 )
217 .build()
218 ),
219 ContentBlockParam.ofText(TextBlockParam.builder().text("Describe this image.").build())
209 ContentBlockParam.ofImage(
210 ImageBlockParam.builder()
211 .source(
212 Base64ImageSource.builder()
213 .mediaType(Base64ImageSource.MediaType.IMAGE_PNG)
214 .data(imageData)
215 .build()
216 )
217 .build()
218 ),
219 ContentBlockParam.ofText(TextBlockParam.builder()
220 .text("Describe this image.")
221 .build())
220222 );
221223 Message message = client
222 .messages()
223 .create(
224 MessageCreateParams.builder()
225 .model(Model.CLAUDE_OPUS_5_5)
226 .maxTokens(1024)
227 .addUserMessageOfContentBlockParams(contentBlockParams)
228 .build()
229 );
224 .messages()
225 .create(
226 MessageCreateParams.builder()
227 .model(Model.CLAUDE_OPUS_5_5)
228 .maxTokens(1024)
229 .addUserMessageOfContentBlockParams(contentBlockParams)
230 .build()
231 );
230232
231233 IO.println(message);
232234 ```
from line 236
234236 ```php PHP
235237 $client = new Client();
236238
237 $imageData = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC";
239 $imageData = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC';
238240
239241 $message = $client->messages->create(
240242 maxTokens: 1024,
from line 256
254256 ],
255257 ],
256258 ],
257 model: 'claude-opus-5-5',
259 model: Model::CLAUDE_OPUS_5_5,
258260 );
259261
260262 echo json_encode($message, JSON_PRETTY_PRINT), PHP_EOL;
from line 451
449451 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
450452
451453 List<ContentBlockParam> contentBlockParams = List.of(
452 ContentBlockParam.ofImage(
453 ImageBlockParam.builder()
454 .source(
455 UrlImageSource.builder()
456 .url("https://platform.claude.com/docs/images/vision-example.jpg")
457 .build()
458 )
459 .build()
460 ),
461 ContentBlockParam.ofText(TextBlockParam.builder().text("Describe this image.").build())
454 ContentBlockParam.ofImage(
455 ImageBlockParam.builder()
456 .source(
457 UrlImageSource.builder()
458 .url("https://platform.claude.com/docs/images/vision-example.jpg")
459 .build()
460 )
461 .build()
462 ),
463 ContentBlockParam.ofText(TextBlockParam.builder()
464 .text("Describe this image.")
465 .build())
462466 );
463467 Message message = client
464 .messages()
465 .create(
466 MessageCreateParams.builder()
467 .model(Model.CLAUDE_OPUS_5_5)
468 .maxTokens(1024)
469 .addUserMessageOfContentBlockParams(contentBlockParams)
470 .build()
471 );
468 .messages()
469 .create(
470 MessageCreateParams.builder()
471 .model(Model.CLAUDE_OPUS_5_5)
472 .maxTokens(1024)
473 .addUserMessageOfContentBlockParams(contentBlockParams)
474 .build()
475 );
472476 System.out.println(message);
473477 ```
474478
from line 752
748752 import com.anthropic.models.files.FileMetadata;
749753 import com.anthropic.models.files.FileUploadParams;
750754 // ...
751 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
755 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
752756
753 // Upload the image file
754 FileMetadata file = client.files().upload(
755 FileUploadParams.builder()
756 .file(
757 MultipartField.<InputStream>builder()
758 .value(Files.newInputStream(Path.of("vision-example.jpg")))
759 .filename("vision-example.jpg")
760 .contentType("image/jpeg")
761 .build()
762 )
763 .build()
764 );
757 // Upload the image file
758 FileMetadata file = client.files().upload(
759 FileUploadParams.builder()
760 .file(
761 MultipartField.<InputStream>builder()
762 .value(Files.newInputStream(Path.of("vision-example.jpg")))
763 .filename("vision-example.jpg")
764 .contentType("image/jpeg")
765 .build()
766 )
767 .build()
768 );
765769
766 // Use the uploaded file in a message
767 ImageBlockParam imageParam = ImageBlockParam.builder().fileSource(file.id()).build();
770 // Use the uploaded file in a message
771 ImageBlockParam imageParam = ImageBlockParam.builder()
772 .fileSource(file.id())
773 .build();
768774
769 MessageCreateParams params = MessageCreateParams.builder()
770 .model(Model.CLAUDE_OPUS_5_5)
771 .maxTokens(1024)
772 .addUserMessageOfContentBlockParams(
773 List.of(
774 ContentBlockParam.ofImage(imageParam),
775 ContentBlockParam.ofText(
776 TextBlockParam.builder().text("Describe this image.").build()
777 )
778 )
779 )
780 .build();
775 MessageCreateParams params = MessageCreateParams.builder()
776 .model(Model.CLAUDE_OPUS_5_5)
777 .maxTokens(1024)
778 .addUserMessageOfContentBlockParams(
779 List.of(
780 ContentBlockParam.ofImage(imageParam),
781 ContentBlockParam.ofText(
782 TextBlockParam.builder()
783 .text("Describe this image.")
784 .build()
785 )
786 )
787 )
788 .build();
781789
782 Message message = client.messages().create(params);
783 System.out.println(message.content());
790 Message message = client.messages().create(params);
791 System.out.println(message.content());
784792 ```
785793
786794 ```php PHP
from line 1097
10891097 String image2Data = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGNgYPgPAAEDAQAIicLsAAAAAElFTkSuQmCC";
10901098
10911099 List<ContentBlockParam> contentBlockParams = List.of(
1092 ContentBlockParam.ofText(TextBlockParam.builder().text("Image 1:").build()),
1100 ContentBlockParam.ofText(TextBlockParam.builder()
1101 .text("Image 1:")
1102 .build()),
10931103 ContentBlockParam.ofImage(
10941104 ImageBlockParam.builder()
10951105 .source(
from line 1110
11001110 )
11011111 .build()
11021112 ),
1103 ContentBlockParam.ofText(TextBlockParam.builder().text("Image 2:").build()),
1113 ContentBlockParam.ofText(TextBlockParam.builder()
1114 .text("Image 2:")
1115 .build()),
11041116 ContentBlockParam.ofImage(
11051117 ImageBlockParam.builder()
11061118 .source(
from line 1124
11121124 .build()
11131125 ),
11141126 ContentBlockParam.ofText(
1115 TextBlockParam.builder().text("How are these images different?").build()
1127 TextBlockParam.builder()
1128 .text("How are these images different?")
1129 .build()
11161130 )
11171131 );
11181132
from line 1177
11631177 ],
11641178 ],
11651179 ],
1166 model: 'claude-opus-5-5',
1180 model: Model::CLAUDE_OPUS_5_5,
11671181 );
11681182
11691183 echo $message;
from line 1244
12301244
12311245The maximum size per image is:
12321246
1233* 10 MB (base64-encoded) when using the Claude API directly.
1234* 5 MB (base64-encoded) on Amazon Bedrock and Claude Models on Google Cloud (Google managed).
1247* 10 MB (base64-encoded) on the Claude API and Claude Models on Google Cloud (Google managed).
1248* 5 MB (base64-encoded) on Amazon Bedrock.
12351249* 10 MB on [claude.ai](https://claude.ai/).
12361250
12371251<Note>
1238 Although the API supports up to 600 images per request, [request size limits](https://platform.claude.com/docs/en/api/overview#request-size-limits) can be reached first: 32 MB for standard endpoints, and lower on some partner-operated platforms, such as Amazon Bedrock and Claude Models on Google Cloud (Google managed). For many images, consider uploading with the [Files API](https://platform.claude.com/docs/en/build-with-claude/vision#files-api-image-example) and referencing by `file_id` to keep request payloads small.
1252 Although the API supports up to 600 images for each request, [request size limits](https://platform.claude.com/docs/en/api/overview#request-size-limits) can be reached first: 32 MB for standard endpoints, and lower on some partner-operated platforms, such as Amazon Bedrock and Claude Models on Google Cloud (Google managed). For many images, consider [uploading with the Files API](https://platform.claude.com/docs/en/build-with-claude/vision#files-api-image-example) and referencing by `file_id` to keep request payloads small.
12391253
12401254 Even when using the Files API, requests with many large images can fail before reaching the 600-image count. Reduce image dimensions or file sizes (for example, by downsampling) before uploading (see [Resolution and token cost](https://platform.claude.com/docs/en/build-with-claude/vision#evaluate-image-size)).
12411255</Note>
No line in this hunk matches that.