working-with-messages changedbuild-with-claude/working-with-messages
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+15added
Lines−13removed
From line
114
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits19to this page, all time
The whole hunk
from line 114, old and new numbered
/
from line 114
114114 $message = $client->messages->create(
115115 maxTokens: 1024,
116116 messages: [['role' => 'user', 'content' => 'Hello, Claude']],
117 model: 'claude-opus-5-5',
117 model: Model::CLAUDE_OPUS_5_5,
118118 );
119119 echo json_encode($message, JSON_PRETTY_PRINT), PHP_EOL;
120120 ```
from line 278
278278 ['role' => 'assistant', 'content' => 'Hello!'],
279279 ['role' => 'user', 'content' => 'Can you describe LLMs to me?'],
280280 ],
281 model: 'claude-opus-5-5',
281 model: Model::CLAUDE_OPUS_5_5,
282282 );
283283
284284 echo json_encode($message, JSON_PRETTY_PRINT), PHP_EOL;
from line 507
507507 ```bash cURL
508508 #!/bin/sh
509509
510 # Option 1: Base64-encoded image
510 # Option 1: base64-encoded image
511511 IMAGE_BASE64=$(curl "https://platform.claude.com/docs/images/vision-example.jpg" | base64 | tr -d '\n')
512512
513513 curl https://api.anthropic.com/v1/messages \
from line 552
552552 ```
553553
554554 ```bash CLI
555 # Option 1: Base64-encoded image (CLI auto-encodes binary @file refs)
555 # Option 1: base64-encoded image (CLI auto-encodes binary @file refs)
556556 curl -s "https://platform.claude.com/docs/images/vision-example.jpg" \
557557 -o ./vision-example.jpg
558558
from line 591
591591 import base64
592592 import httpx2
593593
594 # Option 1: Base64-encoded image
594 # Option 1: base64-encoded image
595595 image_url = "https://platform.claude.com/docs/images/vision-example.jpg"
596596 image_media_type = "image/jpeg"
597597 image_data = base64.standard_b64encode(httpx2.get(image_url).content).decode("utf-8")
from line 644
644644 ```typescript TypeScript
645645 const anthropic = new Anthropic();
646646
647 // Option 1: Base64-encoded image
647 // Option 1: base64-encoded image
648648 const imageUrl = "https://platform.claude.com/docs/images/vision-example.jpg";
649649 const imageMediaType = "image/jpeg";
650650 const imageArrayBuffer = await (await fetch(imageUrl)).arrayBuffer();
from line 709
709709
710710 AnthropicClient client = new();
711711
712 // Option 1: Base64-encoded image
712 // Option 1: base64-encoded image
713713 string imageUrl = "https://platform.claude.com/docs/images/vision-example.jpg";
714714
715715 using HttpClient httpClient = new();
from line 772
772772 ```go Go
773773 client := anthropic.NewClient()
774774
775 // Option 1: Base64-encoded image
775 // Option 1: base64-encoded image
776776 imageURL := "https://platform.claude.com/docs/images/vision-example.jpg"
777777
778778 req, err := http.NewRequest("GET", imageURL, nil)
from line 830
830830 ```java Java
831831 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
832832
833 // Option 1: Base64-encoded image
833 // Option 1: base64-encoded image
834834 String imageUrl = "https://platform.claude.com/docs/images/vision-example.jpg";
835835
836836 HttpClient httpClient = HttpClient.newHttpClient();
837 HttpRequest request = HttpRequest.newBuilder().uri(URI.create(imageUrl)).build();
837 HttpRequest request = HttpRequest.newBuilder()
838 .uri(URI.create(imageUrl))
839 .build();
838840 HttpResponse<byte[]> response = httpClient.send(request, HttpResponse.BodyHandlers.ofByteArray());
839841 String imageData = Base64.getEncoder().encodeToString(response.body());
840842
from line 888
886888 ```php PHP
887889 $client = new Client();
888890
889 // Option 1: Base64-encoded image
891 // Option 1: base64-encoded image
890892 $image_url = 'https://platform.claude.com/docs/images/vision-example.jpg';
891 $image_media_type = "image/jpeg";
893 $image_media_type = 'image/jpeg';
892894 $image_data = base64_encode(file_get_contents($image_url));
893895
894896 $message = $client->messages->create(
from line 950
948950
949951 client = Anthropic::Client.new
950952
951 # Option 1: Base64-encoded image
953 # Option 1: base64-encoded image
952954 image_url = "https://platform.claude.com/docs/images/vision-example.jpg"
953955 image_media_type = "image/jpeg"
954956 image_data = Base64.strict_encode64(Net::HTTP.get(URI(image_url)))
No line in this hunk matches that.