@anthropic-ai/sdk 0.36.3 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +30 -3
  3. package/core.d.ts +1 -0
  4. package/core.d.ts.map +1 -1
  5. package/core.js +33 -6
  6. package/core.js.map +1 -1
  7. package/core.mjs +33 -6
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +2 -2
  10. package/index.d.ts +2 -2
  11. package/index.d.ts.map +1 -1
  12. package/index.js.map +1 -1
  13. package/index.mjs.map +1 -1
  14. package/internal/decoders/line.d.ts +3 -2
  15. package/internal/decoders/line.d.ts.map +1 -1
  16. package/internal/decoders/line.js +97 -35
  17. package/internal/decoders/line.js.map +1 -1
  18. package/internal/decoders/line.mjs +95 -34
  19. package/internal/decoders/line.mjs.map +1 -1
  20. package/lib/BetaMessageStream.d.ts +2 -0
  21. package/lib/BetaMessageStream.d.ts.map +1 -1
  22. package/lib/BetaMessageStream.js +24 -0
  23. package/lib/BetaMessageStream.js.map +1 -1
  24. package/lib/BetaMessageStream.mjs +24 -0
  25. package/lib/BetaMessageStream.mjs.map +1 -1
  26. package/lib/MessageStream.d.ts +2 -0
  27. package/lib/MessageStream.d.ts.map +1 -1
  28. package/lib/MessageStream.js +24 -0
  29. package/lib/MessageStream.js.map +1 -1
  30. package/lib/MessageStream.mjs +24 -0
  31. package/lib/MessageStream.mjs.map +1 -1
  32. package/package.json +29 -8
  33. package/pagination.d.ts +1 -0
  34. package/pagination.d.ts.map +1 -1
  35. package/pagination.js +6 -0
  36. package/pagination.js.map +1 -1
  37. package/pagination.mjs +6 -0
  38. package/pagination.mjs.map +1 -1
  39. package/resources/beta/beta.d.ts +3 -3
  40. package/resources/beta/beta.d.ts.map +1 -1
  41. package/resources/beta/beta.js.map +1 -1
  42. package/resources/beta/beta.mjs.map +1 -1
  43. package/resources/beta/index.d.ts +1 -1
  44. package/resources/beta/index.d.ts.map +1 -1
  45. package/resources/beta/index.js.map +1 -1
  46. package/resources/beta/index.mjs.map +1 -1
  47. package/resources/beta/messages/batches.d.ts +18 -0
  48. package/resources/beta/messages/batches.d.ts.map +1 -1
  49. package/resources/beta/messages/batches.js +3 -0
  50. package/resources/beta/messages/batches.js.map +1 -1
  51. package/resources/beta/messages/batches.mjs +3 -0
  52. package/resources/beta/messages/batches.mjs.map +1 -1
  53. package/resources/beta/messages/index.d.ts +1 -1
  54. package/resources/beta/messages/index.d.ts.map +1 -1
  55. package/resources/beta/messages/index.js.map +1 -1
  56. package/resources/beta/messages/index.mjs.map +1 -1
  57. package/resources/beta/messages/messages.d.ts +148 -13
  58. package/resources/beta/messages/messages.d.ts.map +1 -1
  59. package/resources/beta/messages/messages.js +5 -1
  60. package/resources/beta/messages/messages.js.map +1 -1
  61. package/resources/beta/messages/messages.mjs +5 -1
  62. package/resources/beta/messages/messages.mjs.map +1 -1
  63. package/resources/index.d.ts +1 -1
  64. package/resources/index.d.ts.map +1 -1
  65. package/resources/index.js.map +1 -1
  66. package/resources/index.mjs.map +1 -1
  67. package/resources/messages/batches.d.ts +18 -0
  68. package/resources/messages/batches.d.ts.map +1 -1
  69. package/resources/messages/batches.js +15 -0
  70. package/resources/messages/batches.js.map +1 -1
  71. package/resources/messages/batches.mjs +15 -0
  72. package/resources/messages/batches.mjs.map +1 -1
  73. package/resources/messages/index.d.ts +1 -1
  74. package/resources/messages/index.d.ts.map +1 -1
  75. package/resources/messages/index.js.map +1 -1
  76. package/resources/messages/index.mjs.map +1 -1
  77. package/resources/messages/messages.d.ts +129 -14
  78. package/resources/messages/messages.d.ts.map +1 -1
  79. package/resources/messages/messages.js +5 -1
  80. package/resources/messages/messages.js.map +1 -1
  81. package/resources/messages/messages.mjs +5 -1
  82. package/resources/messages/messages.mjs.map +1 -1
  83. package/src/core.ts +39 -6
  84. package/src/index.ts +26 -0
  85. package/src/internal/decoders/line.ts +100 -38
  86. package/src/lib/BetaMessageStream.ts +26 -0
  87. package/src/lib/MessageStream.ts +26 -0
  88. package/src/pagination.ts +8 -0
  89. package/src/resources/beta/beta.ts +28 -1
  90. package/src/resources/beta/index.ts +12 -0
  91. package/src/resources/beta/messages/batches.ts +18 -0
  92. package/src/resources/beta/messages/index.ts +12 -0
  93. package/src/resources/beta/messages/messages.ts +212 -14
  94. package/src/resources/index.ts +13 -0
  95. package/src/resources/messages/batches.ts +18 -0
  96. package/src/resources/messages/index.ts +13 -0
  97. package/src/resources/messages/messages.ts +177 -15
  98. package/src/streaming.ts +1 -43
  99. package/src/version.ts +1 -1
  100. package/streaming.d.ts +0 -2
  101. package/streaming.d.ts.map +1 -1
  102. package/streaming.js +2 -38
  103. package/streaming.js.map +1 -1
  104. package/streaming.mjs +1 -36
  105. package/streaming.mjs.map +1 -1
  106. package/version.d.ts +1 -1
  107. package/version.js +1 -1
  108. package/version.mjs +1 -1
@@ -51,7 +51,8 @@ class Messages extends resource_1.APIResource {
51
51
  }
52
52
  return this._client.post('/v1/messages?beta=true', {
53
53
  body,
54
- timeout: this._client._options.timeout ?? 600000,
54
+ timeout: this._client._options.timeout ??
55
+ (body.stream ? 600000 : this._client._calculateNonstreamingTimeout(body.max_tokens)),
55
56
  ...options,
56
57
  headers: {
57
58
  ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
@@ -71,6 +72,9 @@ class Messages extends resource_1.APIResource {
71
72
  *
72
73
  * The Token Count API can be used to count the number of tokens in a Message,
73
74
  * including tools, images, and documents, without creating it.
75
+ *
76
+ * Learn more about token counting in our
77
+ * [user guide](/en/docs/build-with-claude/token-counting)
74
78
  */
75
79
  countTokens(params, options) {
76
80
  const { betas, ...body } = params;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/resources/beta/messages/messages.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,mDAAgD;AAMhD,yDAAwC;AACxC,0CA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AI,EAAE,CAAC,EAAE,2BAA2B,CAAC,CAAC,QAAQ,EAAE;gBAC5E,GAAG,OAAO,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA/ED,4BA+EC;AAuxCD,QAAQ,CAAC,OAAO,GAAG,iBAAO,CAAC;AAC3B,QAAQ,CAAC,sBAAsB,GAAG,gCAAsB,CAAC"}
@@ -25,7 +25,8 @@ export class Messages extends APIResource {
25
25
  }
26
26
  return this._client.post('/v1/messages?beta=true', {
27
27
  body,
28
- timeout: this._client._options.timeout ?? 600000,
28
+ timeout: this._client._options.timeout ??
29
+ (body.stream ? 600000 : this._client._calculateNonstreamingTimeout(body.max_tokens)),
29
30
  ...options,
30
31
  headers: {
31
32
  ...(betas?.toString() != null ? { 'anthropic-beta': betas?.toString() } : undefined),
@@ -45,6 +46,9 @@ export class Messages extends APIResource {
45
46
  *
46
47
  * The Token Count API can be used to count the number of tokens in a Message,
47
48
  * including tools, images, and documents, without creating it.
49
+ *
50
+ * Learn more about token counting in our
51
+ * [user guide](/en/docs/build-with-claude/token-counting)
48
52
  */
49
53
  countTokens(params, options) {
50
54
  const { betas, ...body } = params;
@@ -1 +1 @@
1
- {"version":3,"file":"messages.mjs","sourceRoot":"","sources":["../../../src/resources/beta/messages/messages.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAMf,KAAK,UAAU;OACf,EAOL,OAAO,EAUP,sBAAsB,GACvB;OAEM,EAAE,iBAAiB,EAAE;AAG5B,MAAM,iBAAiB,GAEnB;IACF,YAAY,EAAE,oBAAoB;IAClC,iBAAiB,EAAE,oBAAoB;IACvC,oBAAoB,EAAE,oBAAoB;IAC1C,yBAAyB,EAAE,oBAAoB;IAC/C,oBAAoB,EAAE,oBAAoB;IAC1C,0BAA0B,EAAE,iBAAiB;IAC7C,YAAY,EAAE,iBAAiB;IAC/B,YAAY,EAAE,iBAAiB;CAChC,CAAC;AAEF,MAAM,OAAO,QAAS,S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thenticationError, type BetaBillingError, type BetaError, type BetaErrorResponse, type BetaGatewayTimeoutError, type BetaInvalidRequestError, type BetaNotFoundError, type BetaOverloadedError, type BetaPermissionError, type BetaRateLimitError, } from "./beta/beta.js";
3
3
  export { Completions, type Completion, type CompletionCreateParams, type CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming, } from "./completions.js";
4
- export { Messages, type Base64PDFSource, type CacheControlEphemeral, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationsConfigParam, type CitationsDelta, type ContentBlock, type ContentBlockDeltaEvent, type ContentBlockParam, type ContentBlockSource, type ContentBlockSourceContent, type ContentBlockStartEvent, type ContentBlockStopEvent, type DocumentBlockParam, type ImageBlockParam, type InputJsonDelta, type InputJSONDelta, type Message, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageStartEvent, type MessageStopEvent, type MessageStreamEvent, type MessageStreamParams, type MessageTokensCount, type Metadata, type Model, type PlainTextSource, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type Tool, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceTool, type ToolResultBlockParam, type ToolUseBlock, type ToolUseBlockParam, type Usage, type MessageCreateParams, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages/messages.js";
4
+ export { Messages, type Base64PDFSource, type CacheControlEphemeral, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationsConfigParam, type CitationsDelta, type ContentBlock, type ContentBlockDeltaEvent, type ContentBlockParam, type ContentBlockSource, type ContentBlockSourceContent, type ContentBlockStartEvent, type ContentBlockStopEvent, type DocumentBlockParam, type ImageBlockParam, type InputJsonDelta, type InputJSONDelta, type Message, type MessageCountTokensTool, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageStartEvent, type MessageStopEvent, type MessageStreamEvent, type MessageStreamParams, type MessageTokensCount, type Metadata, type Model, type PlainTextSource, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type RedactedThinkingBlock, type RedactedThinkingBlockParam, type SignatureDelta, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type ThinkingBlock, type ThinkingBlockParam, type ThinkingConfigDisabled, type ThinkingConfigEnabled, type ThinkingConfigParam, type ThinkingDelta, type Tool, type ToolBash20250124, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceTool, type ToolResultBlockParam, type ToolTextEditor20250124, type ToolUnion, type ToolUseBlock, type ToolUseBlockParam, type Usage, type MessageCreateParams, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages/messages.js";
5
5
  export { ModelInfosPage, Models, type ModelInfo, type ModelListParams } from "./models.js";
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,IAAI,EACJ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,KAAK,UAAU,EACf,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AAA/E,wGAAA,cAAc,OAAA;AAAE,gGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;AAEtF,8CAAyB;AACzB,uCAcqB;AAbnB,4FAAA,IAAI,OAAA;AAcN,gDAMuB;AALrB,0GAAA,WAAW,OAAA;AAMb,mDAyE6B;AAxE3B,oGAAA,QAAQ,OAAA;AAyEV,sCAAwF;AAA/E,wGAAA,cAAc,OAAA;AAAE,gGAAA,MAAM,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,IAAI,GAaL;OACM,EACL,WAAW,GAKZ;OACM,EACL,QAAQ,GA2DT;OACM,EAAE,cAAc,EAAE,MAAM,EAAwC"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EACL,IAAI,GAaL;OACM,EACL,WAAW,GAKZ;OACM,EACL,QAAQ,GAwET;OACM,EAAE,cAAc,EAAE,MAAM,EAAwC"}
@@ -11,17 +11,26 @@ export declare class Batches extends APIResource {
11
11
  * The Message Batches API can be used to process multiple Messages API requests at
12
12
  * once. Once a Message Batch is created, it begins processing immediately. Batches
13
13
  * can take up to 24 hours to complete.
14
+ *
15
+ * Learn more about the Message Batches API in our
16
+ * [user guide](/en/docs/build-with-claude/batch-processing)
14
17
  */
15
18
  create(body: BatchCreateParams, options?: Core.RequestOptions): Core.APIPromise<MessageBatch>;
16
19
  /**
17
20
  * This endpoint is idempotent and can be used to poll for Message Batch
18
21
  * completion. To access the results of a Message Batch, make a request to the
19
22
  * `results_url` field in the response.
23
+ *
24
+ * Learn more about the Message Batches API in our
25
+ * [user guide](/en/docs/build-with-claude/batch-processing)
20
26
  */
21
27
  retrieve(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<MessageBatch>;
22
28
  /**
23
29
  * List all Message Batches within a Workspace. Most recently created batches are
24
30
  * returned first.
31
+ *
32
+ * Learn more about the Message Batches API in our
33
+ * [user guide](/en/docs/build-with-claude/batch-processing)
25
34
  */
26
35
  list(query?: BatchListParams, options?: Core.RequestOptions): Core.PagePromise<MessageBatchesPage, MessageBatch>;
27
36
  list(options?: Core.RequestOptions): Core.PagePromise<MessageBatchesPage, MessageBatch>;
@@ -30,6 +39,9 @@ export declare class Batches extends APIResource {
30
39
  *
31
40
  * Message Batches can only be deleted once they've finished processing. If you'd
32
41
  * like to delete an in-progress batch, you must first cancel it.
42
+ *
43
+ * Learn more about the Message Batches API in our
44
+ * [user guide](/en/docs/build-with-claude/batch-processing)
33
45
  */
34
46
  delete(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<DeletedMessageBatch>;
35
47
  /**
@@ -42,6 +54,9 @@ export declare class Batches extends APIResource {
42
54
  * which requests were canceled, check the individual results within the batch.
43
55
  * Note that cancellation may not result in any canceled requests if they were
44
56
  * non-interruptible.
57
+ *
58
+ * Learn more about the Message Batches API in our
59
+ * [user guide](/en/docs/build-with-claude/batch-processing)
45
60
  */
46
61
  cancel(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<MessageBatch>;
47
62
  /**
@@ -50,6 +65,9 @@ export declare class Batches extends APIResource {
50
65
  * Each line in the file is a JSON object containing the result of a single request
51
66
  * in the Message Batch. Results are not guaranteed to be in the same order as
52
67
  * requests. Use the `custom_id` field to match results to requests.
68
+ *
69
+ * Learn more about the Message Batches API in our
70
+ * [user guide](/en/docs/build-with-claude/batch-processing)
53
71
  */
54
72
  results(messageBatchId: string, options?: Core.RequestOptions): Promise<JSONLDecoder<MessageBatchIndividualResponse>>;
55
73
  }
@@ -1 +1 @@
1
- {"version":3,"file":"batches.d.ts","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,M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xC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;CACH"}
@@ -14,6 +14,9 @@ class Batches extends resource_1.APIResource {
14
14
  * The Message Batches API can be used to process multiple Messages API requests at
15
15
  * once. Once a Message Batch is created, it begins processing immediately. Batches
16
16
  * can take up to 24 hours to complete.
17
+ *
18
+ * Learn more about the Message Batches API in our
19
+ * [user guide](/en/docs/build-with-claude/batch-processing)
17
20
  */
18
21
  create(body, options) {
19
22
  return this._client.post('/v1/messages/batches', { body, ...options });
@@ -22,6 +25,9 @@ class Batches extends resource_1.APIResource {
22
25
  * This endpoint is idempotent and can be used to poll for Message Batch
23
26
  * completion. To access the results of a Message Batch, make a request to the
24
27
  * `results_url` field in the response.
28
+ *
29
+ * Learn more about the Message Batches API in our
30
+ * [user guide](/en/docs/build-with-claude/batch-processing)
25
31
  */
26
32
  retrieve(messageBatchId, options) {
27
33
  return this._client.get(`/v1/messages/batches/${messageBatchId}`, options);
@@ -37,6 +43,9 @@ class Batches extends resource_1.APIResource {
37
43
  *
38
44
  * Message Batches can only be deleted once they've finished processing. If you'd
39
45
  * like to delete an in-progress batch, you must first cancel it.
46
+ *
47
+ * Learn more about the Message Batches API in our
48
+ * [user guide](/en/docs/build-with-claude/batch-processing)
40
49
  */
41
50
  delete(messageBatchId, options) {
42
51
  return this._client.delete(`/v1/messages/batches/${messageBatchId}`, options);
@@ -51,6 +60,9 @@ class Batches extends resource_1.APIResource {
51
60
  * which requests were canceled, check the individual results within the batch.
52
61
  * Note that cancellation may not result in any canceled requests if they were
53
62
  * non-interruptible.
63
+ *
64
+ * Learn more about the Message Batches API in our
65
+ * [user guide](/en/docs/build-with-claude/batch-processing)
54
66
  */
55
67
  cancel(messageBatchId, options) {
56
68
  return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel`, options);
@@ -61,6 +73,9 @@ class Batches extends resource_1.APIResource {
61
73
  * Each line in the file is a JSON object containing the result of a single request
62
74
  * in the Message Batch. Results are not guaranteed to be in the same order as
63
75
  * requests. Use the `custom_id` field to match results to requests.
76
+ *
77
+ * Learn more about the Message Batches API in our
78
+ * [user guide](/en/docs/build-with-claude/batch-processing)
64
79
  */
65
80
  async results(messageBatchId, options) {
66
81
  const batch = await this.retrieve(messageBatchId);
@@ -1 +1 @@
1
- {"version":3,"file":"batches.js","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAI9C,oDAAyD;AACzD,4DAA6D;AAC7D,0CAA6C;AAE7C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAWD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAsB,EAAE,OAA6B;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;OAUG;IACH,M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E;YACtB,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,MAAM,EAAE,oBAAoB;gBAC5B,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF;AAhHD,0BAgHC;AAED,MAAa,kBAAmB,SAAQ,iBAAkB;CAAG;AAA7D,gDAA6D;AAiN7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}
@@ -11,6 +11,9 @@ export class Batches extends APIResource {
11
11
  * The Message Batches API can be used to process multiple Messages API requests at
12
12
  * once. Once a Message Batch is created, it begins processing immediately. Batches
13
13
  * can take up to 24 hours to complete.
14
+ *
15
+ * Learn more about the Message Batches API in our
16
+ * [user guide](/en/docs/build-with-claude/batch-processing)
14
17
  */
15
18
  create(body, options) {
16
19
  return this._client.post('/v1/messages/batches', { body, ...options });
@@ -19,6 +22,9 @@ export class Batches extends APIResource {
19
22
  * This endpoint is idempotent and can be used to poll for Message Batch
20
23
  * completion. To access the results of a Message Batch, make a request to the
21
24
  * `results_url` field in the response.
25
+ *
26
+ * Learn more about the Message Batches API in our
27
+ * [user guide](/en/docs/build-with-claude/batch-processing)
22
28
  */
23
29
  retrieve(messageBatchId, options) {
24
30
  return this._client.get(`/v1/messages/batches/${messageBatchId}`, options);
@@ -34,6 +40,9 @@ export class Batches extends APIResource {
34
40
  *
35
41
  * Message Batches can only be deleted once they've finished processing. If you'd
36
42
  * like to delete an in-progress batch, you must first cancel it.
43
+ *
44
+ * Learn more about the Message Batches API in our
45
+ * [user guide](/en/docs/build-with-claude/batch-processing)
37
46
  */
38
47
  delete(messageBatchId, options) {
39
48
  return this._client.delete(`/v1/messages/batches/${messageBatchId}`, options);
@@ -48,6 +57,9 @@ export class Batches extends APIResource {
48
57
  * which requests were canceled, check the individual results within the batch.
49
58
  * Note that cancellation may not result in any canceled requests if they were
50
59
  * non-interruptible.
60
+ *
61
+ * Learn more about the Message Batches API in our
62
+ * [user guide](/en/docs/build-with-claude/batch-processing)
51
63
  */
52
64
  cancel(messageBatchId, options) {
53
65
  return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel`, options);
@@ -58,6 +70,9 @@ export class Batches extends APIResource {
58
70
  * Each line in the file is a JSON object containing the result of a single request
59
71
  * in the Message Batch. Results are not guaranteed to be in the same order as
60
72
  * requests. Use the `custom_id` field to match results to requests.
73
+ *
74
+ * Learn more about the Message Batches API in our
75
+ * [user guide](/en/docs/build-with-claude/batch-processing)
61
76
  */
62
77
  async results(messageBatchId, options) {
63
78
  const batch = await this.retrieve(messageBatchId);
@@ -1 +1 @@
1
- {"version":3,"file":"batches.mjs","sourceRoot":"","sources":["../../src/resources/messages/batches.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,EAAE,gBAAgB,EAAE;OAIpB,EAAE,IAAI,EAAmB;OACzB,EAAE,YAAY,EAAE;OAChB,EAAE,cAAc,EAAE;AAEzB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;OAMG;IACH,MAAM,CAAC,IAAuB,EAAE,OAA6B;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,cAAsB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAWD,IAAI,CACF,QAA+C,EAAE,EACjD,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI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,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,OAAO,CACX,cAAsB,EACtB,OAA6B;QAE7B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,MAAM,IAAI,cAAc,CACtB,yDAAyD,KAAK,CAAC,iBAAiB,MAAM,KAAK,CAAC,EAAE,EAAE,CACjG,CAAC;SACH;QAED,OAAO,IAAI,CAAC,OAAO;aAChB,GAAG,CAAC,KAAK,CAAC,WAAW,EAAE;YACtB,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,MAAM,EAAE,oBAAoB;gBAC5B,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,gBAAgB,EAAE,IAAI;SACvB,CAAC;aACD,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5F,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,IAAkB;CAAG;AAiN7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { MessageBatchesPage, Batches, type DeletedMessageBatch, type MessageBatch, type MessageBatchCanceledResult, type MessageBatchErroredResult, type MessageBatchExpiredResult, type MessageBatchIndividualResponse, type MessageBatchRequestCounts, type MessageBatchResult, type MessageBatchSucceededResult, type BatchCreateParams, type BatchListParams, } from "./batches.js";
2
- export { Messages, type Base64PDFSource, type CacheControlEphemeral, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationsConfigParam, type CitationsDelta, type ContentBlock, type ContentBlockDeltaEvent, type ContentBlockParam, type ContentBlockSource, type ContentBlockSourceContent, type ContentBlockStartEvent, type ContentBlockStopEvent, type DocumentBlockParam, type ImageBlockParam, type InputJSONDelta, type Message, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageStartEvent, type MessageStopEvent, type MessageStreamEvent, type MessageTokensCount, type Metadata, type Model, type PlainTextSource, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type Tool, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceTool, type ToolResultBlockParam, type ToolUseBlock, type ToolUseBlockParam, type Usage, type MessageCreateParams, type MessageCreateParamsBase, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages.js";
2
+ export { Messages, type Base64PDFSource, type CacheControlEphemeral, type CitationCharLocation, type CitationCharLocationParam, type CitationContentBlockLocation, type CitationContentBlockLocationParam, type CitationPageLocation, type CitationPageLocationParam, type CitationsConfigParam, type CitationsDelta, type ContentBlock, type ContentBlockDeltaEvent, type ContentBlockParam, type ContentBlockSource, type ContentBlockSourceContent, type ContentBlockStartEvent, type ContentBlockStopEvent, type DocumentBlockParam, type ImageBlockParam, type InputJSONDelta, type Message, type MessageCountTokensTool, type MessageDeltaEvent, type MessageDeltaUsage, type MessageParam, type MessageStartEvent, type MessageStopEvent, type MessageStreamEvent, type MessageTokensCount, type Metadata, type Model, type PlainTextSource, type RawContentBlockDeltaEvent, type RawContentBlockStartEvent, type RawContentBlockStopEvent, type RawMessageDeltaEvent, type RawMessageStartEvent, type RawMessageStopEvent, type RawMessageStreamEvent, type RedactedThinkingBlock, type RedactedThinkingBlockParam, type SignatureDelta, type TextBlock, type TextBlockParam, type TextCitation, type TextCitationParam, type TextDelta, type ThinkingBlock, type ThinkingBlockParam, type ThinkingConfigDisabled, type ThinkingConfigEnabled, type ThinkingConfigParam, type ThinkingDelta, type Tool, type ToolBash20250124, type ToolChoice, type ToolChoiceAny, type ToolChoiceAuto, type ToolChoiceTool, type ToolResultBlockParam, type ToolTextEditor20250124, type ToolUnion, type ToolUseBlock, type ToolUseBlockParam, type Usage, type MessageCreateParams, type MessageCreateParamsBase, type MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming, type MessageCountTokensParams, } from "./messages.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAClB,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,iCAAiC,EACtC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,IAAI,EACT,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,GAC9B,MAAM,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAcmB;AAbjB,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AAaT,0CA2DoB;AA1DlB,oGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wCAcmB;AAbjB,6GAAA,kBAAkB,OAAA;AAClB,kGAAA,OAAO,OAAA;AAaT,0CAwEoB;AAvElB,oGAAA,QAAQ,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,kBAAkB,EAClB,OAAO,GAYR;OACM,EACL,QAAQ,GA0DT"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/messages/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,kBAAkB,EAClB,OAAO,GAYR;OACM,EACL,QAAQ,GAuET"}
@@ -15,6 +15,8 @@ export declare class Messages extends APIResource {
15
15
  *
16
16
  * The Messages API can be used for either single queries or stateless multi-turn
17
17
  * conversations.
18
+ *
19
+ * Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
18
20
  */
19
21
  create(body: MessageCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Message>;
20
22
  create(body: MessageCreateParamsStreaming, options?: Core.RequestOptions): APIPromise<Stream<RawMessageStreamEvent>>;
@@ -28,6 +30,9 @@ export declare class Messages extends APIResource {
28
30
  *
29
31
  * The Token Count API can be used to count the number of tokens in a Message,
30
32
  * including tools, images, and documents, without creating it.
33
+ *
34
+ * Learn more about token counting in our
35
+ * [user guide](/en/docs/build-with-claude/token-counting)
31
36
  */
32
37
  countTokens(body: MessageCountTokensParams, options?: Core.RequestOptions): Core.APIPromise<MessageTokensCount>;
33
38
  }
@@ -94,9 +99,9 @@ export interface CitationsDelta {
94
99
  citation: CitationCharLocation | CitationPageLocation | CitationContentBlockLocation;
95
100
  type: 'citations_delta';
96
101
  }
97
- export type ContentBlock = TextBlock | ToolUseBlock;
102
+ export type ContentBlock = TextBlock | ToolUseBlock | ThinkingBlock | RedactedThinkingBlock;
98
103
  export type ContentBlockDeltaEvent = RawContentBlockDeltaEvent;
99
- export type ContentBlockParam = TextBlockParam | ImageBlockParam | ToolUseBlockParam | ToolResultBlockParam | DocumentBlockParam;
104
+ export type ContentBlockParam = TextBlockParam | ImageBlockParam | ToolUseBlockParam | ToolResultBlockParam | DocumentBlockParam | ThinkingBlockParam | RedactedThinkingBlockParam;
100
105
  export interface ContentBlockSource {
101
106
  content: string | Array<ContentBlockSourceContent>;
102
107
  type: 'content';
@@ -223,9 +228,13 @@ export interface Message {
223
228
  *
224
229
  * For example, `output_tokens` will be non-zero, even for an empty string response
225
230
  * from Claude.
231
+ *
232
+ * Total input tokens in a request is the summation of `input_tokens`,
233
+ * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
226
234
  */
227
235
  usage: Usage;
228
236
  }
237
+ export type MessageCountTokensTool = ToolBash20250124 | ToolTextEditor20250124 | Tool;
229
238
  export type MessageDeltaEvent = RawMessageDeltaEvent;
230
239
  export interface MessageDeltaUsage {
231
240
  /**
@@ -262,19 +271,19 @@ export interface Metadata {
262
271
  * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
263
272
  * details and options.
264
273
  */
265
- export type Model = (string & {}) | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-2.1' | 'claude-2.0';
274
+ export type Model = 'claude-3-7-sonnet-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | 'claude-2.1' | 'claude-2.0' | (string & {});
266
275
  export interface PlainTextSource {
267
276
  data: string;
268
277
  media_type: 'text/plain';
269
278
  type: 'text';
270
279
  }
271
280
  export interface RawContentBlockDeltaEvent {
272
- delta: TextDelta | InputJSONDelta | CitationsDelta;
281
+ delta: TextDelta | InputJSONDelta | CitationsDelta | ThinkingDelta | SignatureDelta;
273
282
  index: number;
274
283
  type: 'content_block_delta';
275
284
  }
276
285
  export interface RawContentBlockStartEvent {
277
- content_block: TextBlock | ToolUseBlock;
286
+ content_block: TextBlock | ToolUseBlock | ThinkingBlock | RedactedThinkingBlock;
278
287
  index: number;
279
288
  type: 'content_block_start';
280
289
  }
@@ -298,6 +307,9 @@ export interface RawMessageDeltaEvent {
298
307
  *
299
308
  * For example, `output_tokens` will be non-zero, even for an empty string response
300
309
  * from Claude.
310
+ *
311
+ * Total input tokens in a request is the summation of `input_tokens`,
312
+ * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
301
313
  */
302
314
  usage: MessageDeltaUsage;
303
315
  }
@@ -315,6 +327,18 @@ export interface RawMessageStopEvent {
315
327
  type: 'message_stop';
316
328
  }
317
329
  export type RawMessageStreamEvent = RawMessageStartEvent | RawMessageDeltaEvent | RawMessageStopEvent | RawContentBlockStartEvent | RawContentBlockDeltaEvent | RawContentBlockStopEvent;
330
+ export interface RedactedThinkingBlock {
331
+ data: string;
332
+ type: 'redacted_thinking';
333
+ }
334
+ export interface RedactedThinkingBlockParam {
335
+ data: string;
336
+ type: 'redacted_thinking';
337
+ }
338
+ export interface SignatureDelta {
339
+ signature: string;
340
+ type: 'signature_delta';
341
+ }
318
342
  export interface TextBlock {
319
343
  /**
320
344
  * Citations supporting the text block.
@@ -339,9 +363,53 @@ export interface TextDelta {
339
363
  text: string;
340
364
  type: 'text_delta';
341
365
  }
366
+ export interface ThinkingBlock {
367
+ signature: string;
368
+ thinking: string;
369
+ type: 'thinking';
370
+ }
371
+ export interface ThinkingBlockParam {
372
+ signature: string;
373
+ thinking: string;
374
+ type: 'thinking';
375
+ }
376
+ export interface ThinkingConfigDisabled {
377
+ type: 'disabled';
378
+ }
379
+ export interface ThinkingConfigEnabled {
380
+ /**
381
+ * Determines how many tokens Claude can use for its internal reasoning process.
382
+ * Larger budgets can enable more thorough analysis for complex problems, improving
383
+ * response quality.
384
+ *
385
+ * Must be ≥1024 and less than `max_tokens`.
386
+ *
387
+ * See
388
+ * [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
389
+ * for details.
390
+ */
391
+ budget_tokens: number;
392
+ type: 'enabled';
393
+ }
394
+ /**
395
+ * Configuration for enabling Claude's extended thinking.
396
+ *
397
+ * When enabled, responses include `thinking` content blocks showing Claude's
398
+ * thinking process before the final answer. Requires a minimum budget of 1,024
399
+ * tokens and counts towards your `max_tokens` limit.
400
+ *
401
+ * See
402
+ * [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
403
+ * for details.
404
+ */
405
+ export type ThinkingConfigParam = ThinkingConfigEnabled | ThinkingConfigDisabled;
406
+ export interface ThinkingDelta {
407
+ thinking: string;
408
+ type: 'thinking_delta';
409
+ }
342
410
  export interface Tool {
343
411
  /**
344
- * [JSON schema](https://json-schema.org/) for this tool's input.
412
+ * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
345
413
  *
346
414
  * This defines the shape of the `input` that your tool accepts and that the model
347
415
  * will produce.
@@ -366,7 +434,7 @@ export interface Tool {
366
434
  }
367
435
  export declare namespace Tool {
368
436
  /**
369
- * [JSON schema](https://json-schema.org/) for this tool's input.
437
+ * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
370
438
  *
371
439
  * This defines the shape of the `input` that your tool accepts and that the model
372
440
  * will produce.
@@ -377,6 +445,16 @@ export declare namespace Tool {
377
445
  [k: string]: unknown;
378
446
  }
379
447
  }
448
+ export interface ToolBash20250124 {
449
+ /**
450
+ * Name of the tool.
451
+ *
452
+ * This is how the tool will be called by the model and in tool_use blocks.
453
+ */
454
+ name: 'bash';
455
+ type: 'bash_20250124';
456
+ cache_control?: CacheControlEphemeral | null;
457
+ }
380
458
  /**
381
459
  * How the model should use the provided tools. The model can use a specific tool,
382
460
  * any available tool, or decide by itself.
@@ -432,6 +510,17 @@ export interface ToolResultBlockParam {
432
510
  content?: string | Array<TextBlockParam | ImageBlockParam>;
433
511
  is_error?: boolean;
434
512
  }
513
+ export interface ToolTextEditor20250124 {
514
+ /**
515
+ * Name of the tool.
516
+ *
517
+ * This is how the tool will be called by the model and in tool_use blocks.
518
+ */
519
+ name: 'str_replace_editor';
520
+ type: 'text_editor_20250124';
521
+ cache_control?: CacheControlEphemeral | null;
522
+ }
523
+ export type ToolUnion = ToolBash20250124 | ToolTextEditor20250124 | Tool;
435
524
  export interface ToolUseBlock {
436
525
  id: string;
437
526
  input: unknown;
@@ -612,6 +701,18 @@ export interface MessageCreateParamsBase {
612
701
  * deterministic.
613
702
  */
614
703
  temperature?: number;
704
+ /**
705
+ * Configuration for enabling Claude's extended thinking.
706
+ *
707
+ * When enabled, responses include `thinking` content blocks showing Claude's
708
+ * thinking process before the final answer. Requires a minimum budget of 1,024
709
+ * tokens and counts towards your `max_tokens` limit.
710
+ *
711
+ * See
712
+ * [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
713
+ * for details.
714
+ */
715
+ thinking?: ThinkingConfigParam;
615
716
  /**
616
717
  * How the model should use the provided tools. The model can use a specific tool,
617
718
  * any available tool, or decide by itself.
@@ -629,8 +730,9 @@ export interface MessageCreateParamsBase {
629
730
  *
630
731
  * - `name`: Name of the tool.
631
732
  * - `description`: Optional, but strongly-recommended description of the tool.
632
- * - `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input`
633
- * shape that the model will produce in `tool_use` output content blocks.
733
+ * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
734
+ * tool `input` shape that the model will produce in `tool_use` output content
735
+ * blocks.
634
736
  *
635
737
  * For example, if you defined `tools` as:
636
738
  *
@@ -687,7 +789,7 @@ export interface MessageCreateParamsBase {
687
789
  *
688
790
  * See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
689
791
  */
690
- tools?: Array<Tool>;
792
+ tools?: Array<ToolUnion>;
691
793
  /**
692
794
  * Only sample from the top K options for each subsequent token.
693
795
  *
@@ -854,6 +956,18 @@ export interface MessageCountTokensParams {
854
956
  * [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
855
957
  */
856
958
  system?: string | Array<TextBlockParam>;
959
+ /**
960
+ * Configuration for enabling Claude's extended thinking.
961
+ *
962
+ * When enabled, responses include `thinking` content blocks showing Claude's
963
+ * thinking process before the final answer. Requires a minimum budget of 1,024
964
+ * tokens and counts towards your `max_tokens` limit.
965
+ *
966
+ * See
967
+ * [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
968
+ * for details.
969
+ */
970
+ thinking?: ThinkingConfigParam;
857
971
  /**
858
972
  * How the model should use the provided tools. The model can use a specific tool,
859
973
  * any available tool, or decide by itself.
@@ -871,8 +985,9 @@ export interface MessageCountTokensParams {
871
985
  *
872
986
  * - `name`: Name of the tool.
873
987
  * - `description`: Optional, but strongly-recommended description of the tool.
874
- * - `input_schema`: [JSON schema](https://json-schema.org/) for the tool `input`
875
- * shape that the model will produce in `tool_use` output content blocks.
988
+ * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
989
+ * tool `input` shape that the model will produce in `tool_use` output content
990
+ * blocks.
876
991
  *
877
992
  * For example, if you defined `tools` as:
878
993
  *
@@ -929,10 +1044,10 @@ export interface MessageCountTokensParams {
929
1044
  *
930
1045
  * See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
931
1046
  */
932
- tools?: Array<Tool>;
1047
+ tools?: Array<MessageCountTokensTool>;
933
1048
  }
934
1049
  export declare namespace Messages {
935
- export { type Base64PDFSource as Base64PDFSource, type CacheControlEphemeral as CacheControlEphemeral, type CitationCharLocation as CitationCharLocation, type CitationCharLocationParam as CitationCharLocationParam, type CitationContentBlockLocation as CitationContentBlockLocation, type CitationContentBlockLocationParam as CitationContentBlockLocationParam, type CitationPageLocation as CitationPageLocation, type CitationPageLocationParam as CitationPageLocationParam, type CitationsConfigParam as CitationsConfigParam, type CitationsDelta as CitationsDelta, type ContentBlock as ContentBlock, type ContentBlockDeltaEvent as ContentBlockDeltaEvent, type ContentBlockParam as ContentBlockParam, type ContentBlockSource as ContentBlockSource, type ContentBlockSourceContent as ContentBlockSourceContent, type ContentBlockStartEvent as ContentBlockStartEvent, type ContentBlockStopEvent as ContentBlockStopEvent, type DocumentBlockParam as DocumentBlockParam, type ImageBlockParam as ImageBlockParam, type InputJsonDelta as InputJsonDelta, type InputJSONDelta as InputJSONDelta, type Message as Message, type MessageDeltaEvent as MessageDeltaEvent, type MessageDeltaUsage as MessageDeltaUsage, type MessageParam as MessageParam, type MessageStartEvent as MessageStartEvent, type MessageStopEvent as MessageStopEvent, type MessageStreamEvent as MessageStreamEvent, type MessageTokensCount as MessageTokensCount, type Metadata as Metadata, type Model as Model, type PlainTextSource as PlainTextSource, type RawContentBlockDeltaEvent as RawContentBlockDeltaEvent, type RawContentBlockStartEvent as RawContentBlockStartEvent, type RawContentBlockStopEvent as RawContentBlockStopEvent, type RawMessageDeltaEvent as RawMessageDeltaEvent, type RawMessageStartEvent as RawMessageStartEvent, type RawMessageStopEvent as RawMessageStopEvent, type RawMessageStreamEvent as RawMessageStreamEvent, type TextBlock as TextBlock, type TextBlockParam as TextBlockParam, type TextCitation as TextCitation, type TextCitationParam as TextCitationParam, type TextDelta as TextDelta, type Tool as Tool, type ToolChoice as ToolChoice, type ToolChoiceAny as ToolChoiceAny, type ToolChoiceAuto as ToolChoiceAuto, type ToolChoiceTool as ToolChoiceTool, type ToolResultBlockParam as ToolResultBlockParam, type ToolUseBlock as ToolUseBlock, type ToolUseBlockParam as ToolUseBlockParam, type Usage as Usage, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageStreamParams as MessageStreamParams, type MessageCountTokensParams as MessageCountTokensParams, };
1050
+ export { type Base64PDFSource as Base64PDFSource, type CacheControlEphemeral as CacheControlEphemeral, type CitationCharLocation as CitationCharLocation, type CitationCharLocationParam as CitationCharLocationParam, type CitationContentBlockLocation as CitationContentBlockLocation, type CitationContentBlockLocationParam as CitationContentBlockLocationParam, type CitationPageLocation as CitationPageLocation, type CitationPageLocationParam as CitationPageLocationParam, type CitationsConfigParam as CitationsConfigParam, type CitationsDelta as CitationsDelta, type ContentBlock as ContentBlock, type ContentBlockDeltaEvent as ContentBlockDeltaEvent, type ContentBlockParam as ContentBlockParam, type ContentBlockSource as ContentBlockSource, type ContentBlockSourceContent as ContentBlockSourceContent, type ContentBlockStartEvent as ContentBlockStartEvent, type ContentBlockStopEvent as ContentBlockStopEvent, type DocumentBlockParam as DocumentBlockParam, type ImageBlockParam as ImageBlockParam, type InputJsonDelta as InputJsonDelta, type InputJSONDelta as InputJSONDelta, type Message as Message, type MessageCountTokensTool as MessageCountTokensTool, type MessageDeltaEvent as MessageDeltaEvent, type MessageDeltaUsage as MessageDeltaUsage, type MessageParam as MessageParam, type MessageStartEvent as MessageStartEvent, type MessageStopEvent as MessageStopEvent, type MessageStreamEvent as MessageStreamEvent, type MessageTokensCount as MessageTokensCount, type Metadata as Metadata, type Model as Model, type PlainTextSource as PlainTextSource, type RawContentBlockDeltaEvent as RawContentBlockDeltaEvent, type RawContentBlockStartEvent as RawContentBlockStartEvent, type RawContentBlockStopEvent as RawContentBlockStopEvent, type RawMessageDeltaEvent as RawMessageDeltaEvent, type RawMessageStartEvent as RawMessageStartEvent, type RawMessageStopEvent as RawMessageStopEvent, type RawMessageStreamEvent as RawMessageStreamEvent, type RedactedThinkingBlock as RedactedThinkingBlock, type RedactedThinkingBlockParam as RedactedThinkingBlockParam, type SignatureDelta as SignatureDelta, type TextBlock as TextBlock, type TextBlockParam as TextBlockParam, type TextCitation as TextCitation, type TextCitationParam as TextCitationParam, type TextDelta as TextDelta, type ThinkingBlock as ThinkingBlock, type ThinkingBlockParam as ThinkingBlockParam, type ThinkingConfigDisabled as ThinkingConfigDisabled, type ThinkingConfigEnabled as ThinkingConfigEnabled, type ThinkingConfigParam as ThinkingConfigParam, type ThinkingDelta as ThinkingDelta, type Tool as Tool, type ToolBash20250124 as ToolBash20250124, type ToolChoice as ToolChoice, type ToolChoiceAny as ToolChoiceAny, type ToolChoiceAuto as ToolChoiceAuto, type ToolChoiceTool as ToolChoiceTool, type ToolResultBlockParam as ToolResultBlockParam, type ToolTextEditor20250124 as ToolTextEditor20250124, type ToolUnion as ToolUnion, type ToolUseBlock as ToolUseBlock, type ToolUseBlockParam as ToolUseBlockParam, type Usage as Usage, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageStreamParams as MessageStreamParams, type MessageCountTokensParams as MessageCountTokensParams, };
936
1051
  export { Batches as Batches, type DeletedMessageBatch as DeletedMessageBatch, type MessageBatch as MessageBatch, type MessageBatchCanceledResult as MessageBatchCanceledResult, type MessageBatchErroredResult as MessageBatchErroredResult, type MessageBatchExpiredResult as MessageBatchExpiredResult, type MessageBatchIndividualResponse as MessageBatchIndividualResponse, type MessageBatchRequestCounts as MessageBatchRequestCounts, type MessageBatchResult as MessageBatchResult, type MessageBatchSucceededResult as MessageBatchSucceededResult, MessageBatchesPage as MessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchListParams as BatchListParams, };
937
1052
  }
938
1053
  //# sourceMappingURL=messages.d.ts.map