java changedcli-sdks-libraries/sdks/java
Nearest release: v2.1.238, 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+18added
Lines−29removed
From line
15
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits23to this page, all time
The whole hunk
from line 15, old and new numbered
/
from line 15
1515<Tabs>
1616 <Tab title="Gradle">
1717 ```kotlin
18 implementation("com.anthropic:anthropic-java:2.53.0")
18 implementation("com.anthropic:anthropic-java:2.57.0")
1919 ```
2020 </Tab>
2121
from line 24
2424 <dependency>
2525 <groupId>com.anthropic</groupId>
2626 <artifactId>anthropic-java</artifactId>
27 <version>2.53.0</version>
27 <version>2.57.0</version>
2828 </dependency>
2929 ```
3030 </Tab>
from line 466
466466
467467```java
468468import com.anthropic.core.MultipartField;
469import com.anthropic.models.beta.files.FileMetadata;
470import com.anthropic.models.beta.files.FileUploadParams;
469import com.anthropic.models.files.FileMetadata;
470import com.anthropic.models.files.FileUploadParams;
471471
472472FileUploadParams params = FileUploadParams.builder()
473473 .file(
from line 478
478478 )
479479 .build();
480480
481FileMetadata fileMetadata = client.beta().files().upload(params);
481FileMetadata fileMetadata = client.files().upload(params);
482482```
483483
484484Or from an `InputStream`:
from line 485
485485
486486```java
487487import com.anthropic.core.MultipartField;
488import com.anthropic.models.beta.files.FileMetadata;
489import com.anthropic.models.beta.files.FileUploadParams;
488import com.anthropic.models.files.FileMetadata;
489import com.anthropic.models.files.FileUploadParams;
490490
491491FileUploadParams params = FileUploadParams.builder()
492492 .file(
from line 498
498498 )
499499 .build();
500500
501FileMetadata fileMetadata = client.beta().files().upload(params);
501FileMetadata fileMetadata = client.files().upload(params);
502502```
503503
504504Or from in-memory bytes:
from line 505
505505
506506```java
507507import com.anthropic.core.MultipartField;
508import com.anthropic.models.beta.files.FileMetadata;
509import com.anthropic.models.beta.files.FileUploadParams;
508import com.anthropic.models.files.FileMetadata;
509import com.anthropic.models.files.FileUploadParams;
510510
511511FileUploadParams params = FileUploadParams.builder()
512512 .file(
from line 518
518518 )
519519 .build();
520520
521FileMetadata fileMetadata = client.beta().files().upload(params);
521FileMetadata fileMetadata = client.files().upload(params);
522522```
523523
524524### Binary responses
from line 528
528528```java
529529import com.anthropic.core.http.HttpResponse;
530530
531HttpResponse response = client.beta().files().download("file_abc123");
531HttpResponse response = client.files().download("file_abc123");
532532```
533533
534534To save the response content to a file:
from line 536
536536```java
537537import com.anthropic.core.http.HttpResponse;
538538
539try (HttpResponse response = client.beta().files().download(params)) {
539try (HttpResponse response = client.files().download(params)) {
540540 Files.copy(
541541 response.body(),
542542 Paths.get(path),
from line 553
553553```java
554554import com.anthropic.core.http.HttpResponse;
555555
556try (HttpResponse response = client.beta().files().download(params)) {
556try (HttpResponse response = client.files().download(params)) {
557557 response.body().transferTo(Files.newOutputStream(Paths.get(path)));
558558} catch (Exception e) {
559559 IO.println("Something went wrong!");
from line 1137
11371137```
11381138
11391139<Accordion title="Jackson compatibility">
1140 The SDK depends on Jackson for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.
1140 The SDK depends on Jackson for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.19.4 by default.
11411141
11421142 The SDK throws an exception if it detects an incompatible Jackson version at runtime (for example, if the default version was overridden in your Maven or Gradle config).
11431143
from line 1200
12001200
12011201You can access most beta API features through the `beta()` method on the client. To enable a particular beta feature, add the appropriate [beta header](https://platform.claude.com/docs/en/api/beta-headers) with `.addBeta()` when building the message params.
12021202
1203For example, to use the [Files API](https://platform.claude.com/docs/en/build-with-claude/files):
1203For example, to enable [context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing):
12041204
12051205```java
12061206import com.anthropic.models.beta.AnthropicBeta;
1207import com.anthropic.models.beta.messages.BetaContentBlockParam;
12081207import com.anthropic.models.beta.messages.BetaMessage;
1209import com.anthropic.models.beta.messages.BetaRequestDocumentBlock;
1210import com.anthropic.models.beta.messages.BetaTextBlockParam;
12111208import com.anthropic.models.beta.messages.MessageCreateParams;
12121209// ...
12131210void main() {
from line 1214
12171214 MessageCreateParams.builder()
12181215 .model(Model.CLAUDE_OPUS_5)
12191216 .maxTokens(1024L)
1220 .addBeta(AnthropicBeta.FILES_API_2025_04_14)
1221 .addUserMessageOfBetaContentBlockParams(List.of(
1222 BetaContentBlockParam.ofText(
1223 BetaTextBlockParam.builder()
1224 .text("Please summarize this document for me.")
1225 .build()),
1226 BetaContentBlockParam.ofDocument(
1227 BetaRequestDocumentBlock.builder()
1228 .fileSource("file_abc123")
1229 .build())))
1217 .addBeta(AnthropicBeta.CONTEXT_MANAGEMENT_2025_06_27)
1218 .addUserMessage("Hello, Claude")
12301219 .build());
12311220}
12321221```
No line in this hunk matches that.