Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

citations changedbuild-with-claude/citations

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+58added
Lines−72removed
From line 740 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits14to this page, all time

The whole hunk

from line 740, old and new numbered
/
lines
from line 740
740740 
741741 <Tab title="Files API">
742742 <Note>
743 These examples reference the uploaded file as a `document` source. They use the SDK `beta` client path and send the `anthropic-beta: files-api-2025-04-14` header, which the API accepts but does not require. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
743 These examples reference the uploaded file as a `document` source, and no beta header is required. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
744744 </Note>
745745 
746746 <CodeGroup>
from line 748
748748 curl -X POST https://api.anthropic.com/v1/messages \
749749 -H "x-api-key: $ANTHROPIC_API_KEY" \
750750 -H "anthropic-version: 2023-06-01" \
751 -H "anthropic-beta: files-api-2025-04-14" \
752751 -H "content-type: application/json" \
753752 -d @- <<EOF
754753 {
from line 776
777776 ```
778777 
779778 ```bash CLI
780 ant beta:messages create --beta files-api-2025-04-14 <<YAML
779 ant messages create <<YAML
781780 model: claude-opus-5
782781 max_tokens: 1024
783782 messages:
from line 796
797796 ```
798797 
799798 ```python Python
800 cited_response = client.beta.messages.create(
799 cited_response = client.messages.create(
801800 model="claude-opus-5",
802801 max_tokens=1024,
803802 messages=[
from line 814
815814 ],
816815 }
817816 ],
818 betas=["files-api-2025-04-14"],
819817 )
820818 print(cited_response)
821819 ```
822820 
823821 ```typescript TypeScript
824 const citedResponse = await client.beta.messages.create({
822 const citedResponse = await client.messages.create({
825823 model: "claude-opus-5",
826824 max_tokens: 1024,
827825 messages: [
from line 840
842840 ],
843841 },
844842 ],
845 betas: ["files-api-2025-04-14"],
846843 });
847844 console.log(citedResponse);
848845 ```
849846 
850847 ```csharp C#
851 var citedResponse = await client.Beta.Messages.Create(
848 var citedResponse = await client.Messages.Create(
852849 new MessageCreateParams
853850 {
854 Model = Messages::Model.ClaudeOpus5,
851 Model = Model.ClaudeOpus5,
855852 MaxTokens = 1024,
856 Betas = [AnthropicBeta.FilesApi2025_04_14],
857853 Messages =
858854 [
859 new BetaMessageParam
855 new MessageParam
860856 {
861857 Role = Role.User,
862 Content = new List<BetaContentBlockParam>
858 Content = new List<ContentBlockParam>
863859 {
864 new BetaRequestDocumentBlock
860 new DocumentBlockParam
865861 {
866 Source = new BetaFileDocumentSource { FileID = fileId },
862 Source = new FileDocumentSource { FileID = fileId },
867863 Title = "Document Title",
868864 Context = "Context about the document that will not be cited from",
869 Citations = new BetaCitationsConfigParam { Enabled = true },
865 Citations = new CitationsConfigParam { Enabled = true },
870866 },
871 new BetaTextBlockParam { Text = "Summarize this document." },
867 new TextBlockParam { Text = "Summarize this document." },
872868 }
873869 }
874870 ]
from line 874
878874 ```
879875 
880876 ```go Go
881 citedMsg, err := client.Beta.Messages.New(context.Background(),
882 anthropic.BetaMessageNewParams{
877 citedMsg, err := client.Messages.New(context.Background(),
878 anthropic.MessageNewParams{
883879 Model: anthropic.ModelClaudeOpus5,
884880 MaxTokens: 1024,
885 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
886 Messages: []anthropic.BetaMessageParam{
887 anthropic.NewBetaUserMessage(
888 anthropic.BetaContentBlockParamUnion{
889 OfDocument: &anthropic.BetaRequestDocumentBlockParam{
890 Source: anthropic.BetaRequestDocumentBlockSourceUnionParam{
891 OfFile: &anthropic.BetaFileDocumentSourceParam{FileID: fileID},
881 Messages: []anthropic.MessageParam{
882 anthropic.NewUserMessage(
883 anthropic.ContentBlockParamUnion{
884 OfDocument: &anthropic.DocumentBlockParam{
885 Source: anthropic.DocumentBlockParamSourceUnion{
886 OfFile: &anthropic.FileDocumentSourceParam{FileID: fileID},
892887 },
893888 Title: anthropic.String("Document Title"),
894889 Context: anthropic.String("Context about the document that will not be cited from"),
895 Citations: anthropic.BetaCitationsConfigParam{Enabled: anthropic.Bool(true)},
890 Citations: anthropic.CitationsConfigParam{Enabled: anthropic.Bool(true)},
896891 },
897892 },
898 anthropic.NewBetaTextBlock("Summarize this document."),
893 anthropic.NewTextBlock("Summarize this document."),
899894 ),
900895 },
901896 })
from line 903
908903 ```java Java
909904 MessageCreateParams citedParams = MessageCreateParams.builder()
910905 .model(Model.CLAUDE_OPUS_5)
911 .addBeta("files-api-2025-04-14")
912906 .maxTokens(1024)
913 .addUserMessageOfBetaContentBlockParams(List.of(
914 BetaContentBlockParam.ofDocument(BetaRequestDocumentBlock.builder()
915 .source(BetaFileDocumentSource.builder().fileId(fileId).build())
907 .addUserMessageOfBlockParams(List.of(
908 ContentBlockParam.ofDocument(DocumentBlockParam.builder()
909 .fileSource(fileId)
916910 .title("Document Title")
917911 .context("Context about the document that will not be cited from")
918 .citations(BetaCitationsConfigParam.builder().enabled(true).build())
912 .citations(CitationsConfigParam.builder().enabled(true).build())
919913 .build()),
920 BetaContentBlockParam.ofText(BetaTextBlockParam.builder()
914 ContentBlockParam.ofText(TextBlockParam.builder()
921915 .text("Summarize this document.")
922916 .build())
923917 ))
924918 .build();
925919 
926 BetaMessage citedMessage = client.beta().messages().create(citedParams);
920 Message citedMessage = client.messages().create(citedParams);
927921 System.out.println(citedMessage);
928922 ```
929923 
from line 947
953947 ```
954948 
955949 ```ruby Ruby
956 cited_response = client.beta.messages.create(
950 cited_response = client.messages.create(
957951 model: "claude-opus-5",
958952 max_tokens: 1024,
959 betas: ["files-api-2025-04-14"],
960953 messages: [
961954 {
962955 role: "user",
from line 1564
15711564 
15721565 <Tab title="Files API">
15731566 <Note>
1574 These examples reference the uploaded file as a `document` source. They use the SDK `beta` client path and send the `anthropic-beta: files-api-2025-04-14` header, which the API accepts but does not require. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
1567 These examples reference the uploaded file as a `document` source, and no beta header is required. See [Files API](https://platform.claude.com/docs/en/build-with-claude/files) for upload details.
15751568 </Note>
15761569 
15771570 <CodeGroup>
from line 1572
15791572 curl -X POST https://api.anthropic.com/v1/messages \
15801573 -H "x-api-key: $ANTHROPIC_API_KEY" \
15811574 -H "anthropic-version: 2023-06-01" \
1582 -H "anthropic-beta: files-api-2025-04-14" \
15831575 -H "content-type: application/json" \
15841576 -d @- <<EOF
15851577 {
from line 1600
16081600 ```
16091601 
16101602 ```bash CLI
1611 ant beta:messages create --beta files-api-2025-04-14 <<YAML
1603 ant messages create <<YAML
16121604 model: claude-opus-5
16131605 max_tokens: 1024
16141606 messages:
from line 1620
16281620 ```
16291621 
16301622 ```python Python
1631 cited_response = client.beta.messages.create(
1623 cited_response = client.messages.create(
16321624 model="claude-opus-5",
16331625 max_tokens=1024,
16341626 messages=[
from line 1638
16461638 ],
16471639 }
16481640 ],
1649 betas=["files-api-2025-04-14"],
16501641 )
16511642 print(cited_response)
16521643 ```
16531644 
16541645 ```typescript TypeScript
1655 const citedResponse = await client.beta.messages.create({
1646 const citedResponse = await client.messages.create({
16561647 model: "claude-opus-5",
16571648 max_tokens: 1024,
16581649 messages: [
from line 1664
16731664 ],
16741665 },
16751666 ],
1676 betas: ["files-api-2025-04-14"],
16771667 });
16781668 console.log(citedResponse);
16791669 ```
16801670 
16811671 ```csharp C#
1682 var citedResponse = await client.Beta.Messages.Create(
1672 var citedResponse = await client.Messages.Create(
16831673 new MessageCreateParams
16841674 {
1685 Model = Messages::Model.ClaudeOpus5,
1675 Model = Model.ClaudeOpus5,
16861676 MaxTokens = 1024,
1687 Betas = [AnthropicBeta.FilesApi2025_04_14],
16881677 Messages =
16891678 [
1690 new BetaMessageParam
1679 new MessageParam
16911680 {
16921681 Role = Role.User,
1693 Content = new List<BetaContentBlockParam>
1682 Content = new List<ContentBlockParam>
16941683 {
1695 new BetaRequestDocumentBlock
1684 new DocumentBlockParam
16961685 {
1697 Source = new BetaFileDocumentSource { FileID = fileId },
1686 Source = new FileDocumentSource { FileID = fileId },
16981687 Title = "Document Title",
16991688 Context = "Context about the document that will not be cited from",
1700 Citations = new BetaCitationsConfigParam { Enabled = true },
1689 Citations = new CitationsConfigParam { Enabled = true },
17011690 },
1702 new BetaTextBlockParam { Text = "Summarize this document." },
1691 new TextBlockParam { Text = "Summarize this document." },
17031692 }
17041693 }
17051694 ]
from line 1698
17091698 ```
17101699 
17111700 ```go Go
1712 citedMsg, err := client.Beta.Messages.New(context.Background(),
1713 anthropic.BetaMessageNewParams{
1701 citedMsg, err := client.Messages.New(context.Background(),
1702 anthropic.MessageNewParams{
17141703 Model: anthropic.ModelClaudeOpus5,
17151704 MaxTokens: 1024,
1716 Betas: []anthropic.AnthropicBeta{anthropic.AnthropicBetaFilesAPI2025_04_14},
1717 Messages: []anthropic.BetaMessageParam{
1718 anthropic.NewBetaUserMessage(
1719 anthropic.BetaContentBlockParamUnion{
1720 OfDocument: &anthropic.BetaRequestDocumentBlockParam{
1721 Source: anthropic.BetaRequestDocumentBlockSourceUnionParam{
1722 OfFile: &anthropic.BetaFileDocumentSourceParam{FileID: fileID},
1705 Messages: []anthropic.MessageParam{
1706 anthropic.NewUserMessage(
1707 anthropic.ContentBlockParamUnion{
1708 OfDocument: &anthropic.DocumentBlockParam{
1709 Source: anthropic.DocumentBlockParamSourceUnion{
1710 OfFile: &anthropic.FileDocumentSourceParam{FileID: fileID},
17231711 },
17241712 Title: anthropic.String("Document Title"),
17251713 Context: anthropic.String("Context about the document that will not be cited from"),
1726 Citations: anthropic.BetaCitationsConfigParam{Enabled: anthropic.Bool(true)},
1714 Citations: anthropic.CitationsConfigParam{Enabled: anthropic.Bool(true)},
17271715 },
17281716 },
1729 anthropic.NewBetaTextBlock("Summarize this document."),
1717 anthropic.NewTextBlock("Summarize this document."),
17301718 ),
17311719 },
17321720 })
from line 1727
17391727 ```java Java
17401728 MessageCreateParams citedParams = MessageCreateParams.builder()
17411729 .model(Model.CLAUDE_OPUS_5)
1742 .addBeta("files-api-2025-04-14")
17431730 .maxTokens(1024)
1744 .addUserMessageOfBetaContentBlockParams(List.of(
1745 BetaContentBlockParam.ofDocument(BetaRequestDocumentBlock.builder()
1746 .source(BetaFileDocumentSource.builder().fileId(fileId).build())
1731 .addUserMessageOfBlockParams(List.of(
1732 ContentBlockParam.ofDocument(DocumentBlockParam.builder()
1733 .fileSource(fileId)
17471734 .title("Document Title")
17481735 .context("Context about the document that will not be cited from")
1749 .citations(BetaCitationsConfigParam.builder().enabled(true).build())
1736 .citations(CitationsConfigParam.builder().enabled(true).build())
17501737 .build()),
1751 BetaContentBlockParam.ofText(BetaTextBlockParam.builder()
1738 ContentBlockParam.ofText(TextBlockParam.builder()
17521739 .text("Summarize this document.")
17531740 .build())
17541741 ))
17551742 .build();
17561743 
1757 BetaMessage citedMessage = client.beta().messages().create(citedParams);
1744 Message citedMessage = client.messages().create(citedParams);
17581745 System.out.println(citedMessage);
17591746 ```
17601747 
from line 1771
17841771 ```
17851772 
17861773 ```ruby Ruby
1787 cited_response = client.beta.messages.create(
1774 cited_response = client.messages.create(
17881775 model: "claude-opus-5",
17891776 max_tokens: 1024,
1790 betas: ["files-api-2025-04-14"],
17911777 messages: [
17921778 {
17931779 role: "user",
Feedback