@puku-ai/sdk 1.0.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 (336) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +251 -0
  3. package/dist/index.cjs +7 -0
  4. package/dist/index.d.ts +23 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +26 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts +3 -0
  9. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts.map +1 -0
  10. package/dist/vendor/_vendor/partial-json-parser/parser.js +223 -0
  11. package/dist/vendor/_vendor/partial-json-parser/parser.js.map +1 -0
  12. package/dist/vendor/api-promise.d.ts +3 -0
  13. package/dist/vendor/api-promise.d.ts.map +1 -0
  14. package/dist/vendor/api-promise.js +3 -0
  15. package/dist/vendor/api-promise.js.map +1 -0
  16. package/dist/vendor/client.d.ts +248 -0
  17. package/dist/vendor/client.d.ts.map +1 -0
  18. package/dist/vendor/client.js +567 -0
  19. package/dist/vendor/client.js.map +1 -0
  20. package/dist/vendor/core/api-promise.d.ts +49 -0
  21. package/dist/vendor/core/api-promise.d.ts.map +1 -0
  22. package/dist/vendor/core/api-promise.js +72 -0
  23. package/dist/vendor/core/api-promise.js.map +1 -0
  24. package/dist/vendor/core/error.d.ts +50 -0
  25. package/dist/vendor/core/error.d.ts.map +1 -0
  26. package/dist/vendor/core/error.js +109 -0
  27. package/dist/vendor/core/error.js.map +1 -0
  28. package/dist/vendor/core/pagination.d.ts +105 -0
  29. package/dist/vendor/core/pagination.d.ts.map +1 -0
  30. package/dist/vendor/core/pagination.js +188 -0
  31. package/dist/vendor/core/pagination.js.map +1 -0
  32. package/dist/vendor/core/resource.d.ts +6 -0
  33. package/dist/vendor/core/resource.d.ts.map +1 -0
  34. package/dist/vendor/core/resource.js +8 -0
  35. package/dist/vendor/core/resource.js.map +1 -0
  36. package/dist/vendor/core/streaming.d.ts +33 -0
  37. package/dist/vendor/core/streaming.d.ts.map +1 -0
  38. package/dist/vendor/core/streaming.js +288 -0
  39. package/dist/vendor/core/streaming.js.map +1 -0
  40. package/dist/vendor/core/uploads.d.ts +3 -0
  41. package/dist/vendor/core/uploads.d.ts.map +1 -0
  42. package/dist/vendor/core/uploads.js +2 -0
  43. package/dist/vendor/core/uploads.js.map +1 -0
  44. package/dist/vendor/error.d.ts +3 -0
  45. package/dist/vendor/error.d.ts.map +1 -0
  46. package/dist/vendor/error.js +3 -0
  47. package/dist/vendor/error.js.map +1 -0
  48. package/dist/vendor/helpers/beta/json-schema.d.ts +31 -0
  49. package/dist/vendor/helpers/beta/json-schema.d.ts.map +1 -0
  50. package/dist/vendor/helpers/beta/json-schema.js +52 -0
  51. package/dist/vendor/helpers/beta/json-schema.js.map +1 -0
  52. package/dist/vendor/helpers/beta/mcp.d.ts +303 -0
  53. package/dist/vendor/helpers/beta/mcp.d.ts.map +1 -0
  54. package/dist/vendor/helpers/beta/mcp.js +406 -0
  55. package/dist/vendor/helpers/beta/mcp.js.map +1 -0
  56. package/dist/vendor/helpers/beta/memory.d.ts +11 -0
  57. package/dist/vendor/helpers/beta/memory.d.ts.map +1 -0
  58. package/dist/vendor/helpers/beta/memory.js +15 -0
  59. package/dist/vendor/helpers/beta/memory.js.map +1 -0
  60. package/dist/vendor/helpers/beta/zod.d.ts +7 -0
  61. package/dist/vendor/helpers/beta/zod.d.ts.map +1 -0
  62. package/dist/vendor/helpers/beta/zod.js +15 -0
  63. package/dist/vendor/helpers/beta/zod.js.map +1 -0
  64. package/dist/vendor/helpers/index.d.ts +3 -0
  65. package/dist/vendor/helpers/index.d.ts.map +1 -0
  66. package/dist/vendor/helpers/index.js +3 -0
  67. package/dist/vendor/helpers/index.js.map +1 -0
  68. package/dist/vendor/helpers/json-schema.d.ts +18 -0
  69. package/dist/vendor/helpers/json-schema.d.ts.map +1 -0
  70. package/dist/vendor/helpers/json-schema.js +34 -0
  71. package/dist/vendor/helpers/json-schema.js.map +1 -0
  72. package/dist/vendor/helpers/zod.d.ts +13 -0
  73. package/dist/vendor/helpers/zod.d.ts.map +1 -0
  74. package/dist/vendor/helpers/zod.js +21 -0
  75. package/dist/vendor/helpers/zod.js.map +1 -0
  76. package/dist/vendor/index.d.ts +8 -0
  77. package/dist/vendor/index.d.ts.map +1 -0
  78. package/dist/vendor/index.js +8 -0
  79. package/dist/vendor/index.js.map +1 -0
  80. package/dist/vendor/internal/builtin-types.d.ts +73 -0
  81. package/dist/vendor/internal/builtin-types.d.ts.map +1 -0
  82. package/dist/vendor/internal/builtin-types.js +3 -0
  83. package/dist/vendor/internal/builtin-types.js.map +1 -0
  84. package/dist/vendor/internal/constants.d.ts +5 -0
  85. package/dist/vendor/internal/constants.d.ts.map +1 -0
  86. package/dist/vendor/internal/constants.js +15 -0
  87. package/dist/vendor/internal/constants.js.map +1 -0
  88. package/dist/vendor/internal/decoders/jsonl.d.ts +10 -0
  89. package/dist/vendor/internal/decoders/jsonl.d.ts.map +1 -0
  90. package/dist/vendor/internal/decoders/jsonl.js +37 -0
  91. package/dist/vendor/internal/decoders/jsonl.js.map +1 -0
  92. package/dist/vendor/internal/decoders/line.d.ts +17 -0
  93. package/dist/vendor/internal/decoders/line.d.ts.map +1 -0
  94. package/dist/vendor/internal/decoders/line.js +105 -0
  95. package/dist/vendor/internal/decoders/line.js.map +1 -0
  96. package/dist/vendor/internal/detect-platform.d.ts +15 -0
  97. package/dist/vendor/internal/detect-platform.d.ts.map +1 -0
  98. package/dist/vendor/internal/detect-platform.js +157 -0
  99. package/dist/vendor/internal/detect-platform.js.map +1 -0
  100. package/dist/vendor/internal/errors.d.ts +3 -0
  101. package/dist/vendor/internal/errors.d.ts.map +1 -0
  102. package/dist/vendor/internal/errors.js +36 -0
  103. package/dist/vendor/internal/errors.js.map +1 -0
  104. package/dist/vendor/internal/headers.d.ts +22 -0
  105. package/dist/vendor/internal/headers.d.ts.map +1 -0
  106. package/dist/vendor/internal/headers.js +74 -0
  107. package/dist/vendor/internal/headers.js.map +1 -0
  108. package/dist/vendor/internal/parse.d.ts +17 -0
  109. package/dist/vendor/internal/parse.d.ts.map +1 -0
  110. package/dist/vendor/internal/parse.js +56 -0
  111. package/dist/vendor/internal/parse.js.map +1 -0
  112. package/dist/vendor/internal/request-options.d.ts +77 -0
  113. package/dist/vendor/internal/request-options.d.ts.map +1 -0
  114. package/dist/vendor/internal/request-options.js +10 -0
  115. package/dist/vendor/internal/request-options.js.map +1 -0
  116. package/dist/vendor/internal/shim-types.d.ts +17 -0
  117. package/dist/vendor/internal/shim-types.d.ts.map +1 -0
  118. package/dist/vendor/internal/shim-types.js +3 -0
  119. package/dist/vendor/internal/shim-types.js.map +1 -0
  120. package/dist/vendor/internal/shims.d.ts +26 -0
  121. package/dist/vendor/internal/shims.d.ts.map +1 -0
  122. package/dist/vendor/internal/shims.js +85 -0
  123. package/dist/vendor/internal/shims.js.map +1 -0
  124. package/dist/vendor/internal/stream-utils.d.ts +8 -0
  125. package/dist/vendor/internal/stream-utils.d.ts.map +1 -0
  126. package/dist/vendor/internal/stream-utils.js +35 -0
  127. package/dist/vendor/internal/stream-utils.js.map +1 -0
  128. package/dist/vendor/internal/to-file.d.ts +45 -0
  129. package/dist/vendor/internal/to-file.d.ts.map +1 -0
  130. package/dist/vendor/internal/to-file.js +93 -0
  131. package/dist/vendor/internal/to-file.js.map +1 -0
  132. package/dist/vendor/internal/types.d.ts +69 -0
  133. package/dist/vendor/internal/types.d.ts.map +1 -0
  134. package/dist/vendor/internal/types.js +3 -0
  135. package/dist/vendor/internal/types.js.map +1 -0
  136. package/dist/vendor/internal/uploads.d.ts +42 -0
  137. package/dist/vendor/internal/uploads.d.ts.map +1 -0
  138. package/dist/vendor/internal/uploads.js +135 -0
  139. package/dist/vendor/internal/uploads.js.map +1 -0
  140. package/dist/vendor/internal/utils/base64.d.ts +3 -0
  141. package/dist/vendor/internal/utils/base64.d.ts.map +1 -0
  142. package/dist/vendor/internal/utils/base64.js +33 -0
  143. package/dist/vendor/internal/utils/base64.js.map +1 -0
  144. package/dist/vendor/internal/utils/bytes.d.ts +4 -0
  145. package/dist/vendor/internal/utils/bytes.d.ts.map +1 -0
  146. package/dist/vendor/internal/utils/bytes.js +26 -0
  147. package/dist/vendor/internal/utils/bytes.js.map +1 -0
  148. package/dist/vendor/internal/utils/env.d.ts +9 -0
  149. package/dist/vendor/internal/utils/env.d.ts.map +1 -0
  150. package/dist/vendor/internal/utils/env.js +18 -0
  151. package/dist/vendor/internal/utils/env.js.map +1 -0
  152. package/dist/vendor/internal/utils/log.d.ts +37 -0
  153. package/dist/vendor/internal/utils/log.d.ts.map +1 -0
  154. package/dist/vendor/internal/utils/log.js +80 -0
  155. package/dist/vendor/internal/utils/log.js.map +1 -0
  156. package/dist/vendor/internal/utils/path.d.ts +15 -0
  157. package/dist/vendor/internal/utils/path.d.ts.map +1 -0
  158. package/dist/vendor/internal/utils/path.js +74 -0
  159. package/dist/vendor/internal/utils/path.js.map +1 -0
  160. package/dist/vendor/internal/utils/query.d.ts +5 -0
  161. package/dist/vendor/internal/utils/query.d.ts.map +1 -0
  162. package/dist/vendor/internal/utils/query.js +20 -0
  163. package/dist/vendor/internal/utils/query.js.map +1 -0
  164. package/dist/vendor/internal/utils/sleep.d.ts +2 -0
  165. package/dist/vendor/internal/utils/sleep.d.ts.map +1 -0
  166. package/dist/vendor/internal/utils/sleep.js +3 -0
  167. package/dist/vendor/internal/utils/sleep.js.map +1 -0
  168. package/dist/vendor/internal/utils/uuid.d.ts +5 -0
  169. package/dist/vendor/internal/utils/uuid.d.ts.map +1 -0
  170. package/dist/vendor/internal/utils/uuid.js +15 -0
  171. package/dist/vendor/internal/utils/uuid.js.map +1 -0
  172. package/dist/vendor/internal/utils/values.d.ts +19 -0
  173. package/dist/vendor/internal/utils/values.d.ts.map +1 -0
  174. package/dist/vendor/internal/utils/values.js +100 -0
  175. package/dist/vendor/internal/utils/values.js.map +1 -0
  176. package/dist/vendor/internal/utils.d.ts +8 -0
  177. package/dist/vendor/internal/utils.d.ts.map +1 -0
  178. package/dist/vendor/internal/utils.js +9 -0
  179. package/dist/vendor/internal/utils.js.map +1 -0
  180. package/dist/vendor/lib/BetaMessageStream.d.ts +122 -0
  181. package/dist/vendor/lib/BetaMessageStream.d.ts.map +1 -0
  182. package/dist/vendor/lib/BetaMessageStream.js +624 -0
  183. package/dist/vendor/lib/BetaMessageStream.js.map +1 -0
  184. package/dist/vendor/lib/MessageStream.d.ts +121 -0
  185. package/dist/vendor/lib/MessageStream.d.ts.map +1 -0
  186. package/dist/vendor/lib/MessageStream.js +599 -0
  187. package/dist/vendor/lib/MessageStream.js.map +1 -0
  188. package/dist/vendor/lib/beta-parser.d.ts +37 -0
  189. package/dist/vendor/lib/beta-parser.d.ts.map +1 -0
  190. package/dist/vendor/lib/beta-parser.js +75 -0
  191. package/dist/vendor/lib/beta-parser.js.map +1 -0
  192. package/dist/vendor/lib/parser.d.ts +32 -0
  193. package/dist/vendor/lib/parser.d.ts.map +1 -0
  194. package/dist/vendor/lib/parser.js +62 -0
  195. package/dist/vendor/lib/parser.js.map +1 -0
  196. package/dist/vendor/lib/stainless-helper-header.d.ts +34 -0
  197. package/dist/vendor/lib/stainless-helper-header.d.ts.map +1 -0
  198. package/dist/vendor/lib/stainless-helper-header.js +63 -0
  199. package/dist/vendor/lib/stainless-helper-header.js.map +1 -0
  200. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts +12 -0
  201. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts.map +1 -0
  202. package/dist/vendor/lib/tools/BetaRunnableTool.js +2 -0
  203. package/dist/vendor/lib/tools/BetaRunnableTool.js.map +1 -0
  204. package/dist/vendor/lib/tools/BetaToolRunner.d.ts +136 -0
  205. package/dist/vendor/lib/tools/BetaToolRunner.d.ts.map +1 -0
  206. package/dist/vendor/lib/tools/BetaToolRunner.js +370 -0
  207. package/dist/vendor/lib/tools/BetaToolRunner.js.map +1 -0
  208. package/dist/vendor/lib/tools/CompactionControl.d.ts +25 -0
  209. package/dist/vendor/lib/tools/CompactionControl.d.ts.map +1 -0
  210. package/dist/vendor/lib/tools/CompactionControl.js +25 -0
  211. package/dist/vendor/lib/tools/CompactionControl.js.map +1 -0
  212. package/dist/vendor/lib/tools/ToolError.d.ts +33 -0
  213. package/dist/vendor/lib/tools/ToolError.d.ts.map +1 -0
  214. package/dist/vendor/lib/tools/ToolError.js +43 -0
  215. package/dist/vendor/lib/tools/ToolError.js.map +1 -0
  216. package/dist/vendor/lib/tools/ToolRunner.d.ts +132 -0
  217. package/dist/vendor/lib/tools/ToolRunner.d.ts.map +1 -0
  218. package/dist/vendor/lib/tools/ToolRunner.js +287 -0
  219. package/dist/vendor/lib/tools/ToolRunner.js.map +1 -0
  220. package/dist/vendor/lib/transform-json-schema.d.ts +3 -0
  221. package/dist/vendor/lib/transform-json-schema.d.ts.map +1 -0
  222. package/dist/vendor/lib/transform-json-schema.js +111 -0
  223. package/dist/vendor/lib/transform-json-schema.js.map +1 -0
  224. package/dist/vendor/pagination.d.ts +3 -0
  225. package/dist/vendor/pagination.d.ts.map +1 -0
  226. package/dist/vendor/pagination.js +3 -0
  227. package/dist/vendor/pagination.js.map +1 -0
  228. package/dist/vendor/resource.d.ts +3 -0
  229. package/dist/vendor/resource.d.ts.map +1 -0
  230. package/dist/vendor/resource.js +3 -0
  231. package/dist/vendor/resource.js.map +1 -0
  232. package/dist/vendor/resources/beta/beta.d.ts +66 -0
  233. package/dist/vendor/resources/beta/beta.d.ts.map +1 -0
  234. package/dist/vendor/resources/beta/beta.js +21 -0
  235. package/dist/vendor/resources/beta/beta.js.map +1 -0
  236. package/dist/vendor/resources/beta/files.d.ts +151 -0
  237. package/dist/vendor/resources/beta/files.d.ts.map +1 -0
  238. package/dist/vendor/resources/beta/files.js +120 -0
  239. package/dist/vendor/resources/beta/files.js.map +1 -0
  240. package/dist/vendor/resources/beta/index.d.ts +6 -0
  241. package/dist/vendor/resources/beta/index.d.ts.map +1 -0
  242. package/dist/vendor/resources/beta/index.js +7 -0
  243. package/dist/vendor/resources/beta/index.js.map +1 -0
  244. package/dist/vendor/resources/beta/messages/batches.d.ts +646 -0
  245. package/dist/vendor/resources/beta/messages/batches.d.ts.map +1 -0
  246. package/dist/vendor/resources/beta/messages/batches.js +200 -0
  247. package/dist/vendor/resources/beta/messages/batches.js.map +1 -0
  248. package/dist/vendor/resources/beta/messages/index.d.ts +4 -0
  249. package/dist/vendor/resources/beta/messages/index.d.ts.map +1 -0
  250. package/dist/vendor/resources/beta/messages/index.js +5 -0
  251. package/dist/vendor/resources/beta/messages/index.js.map +1 -0
  252. package/dist/vendor/resources/beta/messages/messages.d.ts +2966 -0
  253. package/dist/vendor/resources/beta/messages/messages.d.ts.map +1 -0
  254. package/dist/vendor/resources/beta/messages/messages.js +153 -0
  255. package/dist/vendor/resources/beta/messages/messages.js.map +1 -0
  256. package/dist/vendor/resources/beta/messages.d.ts +2 -0
  257. package/dist/vendor/resources/beta/messages.d.ts.map +1 -0
  258. package/dist/vendor/resources/beta/messages.js +3 -0
  259. package/dist/vendor/resources/beta/messages.js.map +1 -0
  260. package/dist/vendor/resources/beta/models.d.ts +208 -0
  261. package/dist/vendor/resources/beta/models.d.ts.map +1 -0
  262. package/dist/vendor/resources/beta/models.js +56 -0
  263. package/dist/vendor/resources/beta/models.js.map +1 -0
  264. package/dist/vendor/resources/beta/skills/index.d.ts +3 -0
  265. package/dist/vendor/resources/beta/skills/index.d.ts.map +1 -0
  266. package/dist/vendor/resources/beta/skills/index.js +4 -0
  267. package/dist/vendor/resources/beta/skills/index.js.map +1 -0
  268. package/dist/vendor/resources/beta/skills/skills.d.ts +249 -0
  269. package/dist/vendor/resources/beta/skills/skills.d.ts.map +1 -0
  270. package/dist/vendor/resources/beta/skills/skills.js +90 -0
  271. package/dist/vendor/resources/beta/skills/skills.js.map +1 -0
  272. package/dist/vendor/resources/beta/skills/versions.d.ts +257 -0
  273. package/dist/vendor/resources/beta/skills/versions.d.ts.map +1 -0
  274. package/dist/vendor/resources/beta/skills/versions.js +96 -0
  275. package/dist/vendor/resources/beta/skills/versions.js.map +1 -0
  276. package/dist/vendor/resources/beta/skills.d.ts +2 -0
  277. package/dist/vendor/resources/beta/skills.d.ts.map +1 -0
  278. package/dist/vendor/resources/beta/skills.js +3 -0
  279. package/dist/vendor/resources/beta/skills.js.map +1 -0
  280. package/dist/vendor/resources/beta.d.ts +2 -0
  281. package/dist/vendor/resources/beta.d.ts.map +1 -0
  282. package/dist/vendor/resources/beta.js +3 -0
  283. package/dist/vendor/resources/beta.js.map +1 -0
  284. package/dist/vendor/resources/completions.d.ts +182 -0
  285. package/dist/vendor/resources/completions.d.ts.map +1 -0
  286. package/dist/vendor/resources/completions.js +19 -0
  287. package/dist/vendor/resources/completions.js.map +1 -0
  288. package/dist/vendor/resources/index.d.ts +6 -0
  289. package/dist/vendor/resources/index.d.ts.map +1 -0
  290. package/dist/vendor/resources/index.js +7 -0
  291. package/dist/vendor/resources/index.js.map +1 -0
  292. package/dist/vendor/resources/messages/batches.d.ts +304 -0
  293. package/dist/vendor/resources/messages/batches.d.ts.map +1 -0
  294. package/dist/vendor/resources/messages/batches.js +149 -0
  295. package/dist/vendor/resources/messages/batches.js.map +1 -0
  296. package/dist/vendor/resources/messages/index.d.ts +3 -0
  297. package/dist/vendor/resources/messages/index.d.ts.map +1 -0
  298. package/dist/vendor/resources/messages/index.js +4 -0
  299. package/dist/vendor/resources/messages/index.js.map +1 -0
  300. package/dist/vendor/resources/messages/messages.d.ts +2258 -0
  301. package/dist/vendor/resources/messages/messages.d.ts.map +1 -0
  302. package/dist/vendor/resources/messages/messages.js +120 -0
  303. package/dist/vendor/resources/messages/messages.js.map +1 -0
  304. package/dist/vendor/resources/messages.d.ts +2 -0
  305. package/dist/vendor/resources/messages.d.ts.map +1 -0
  306. package/dist/vendor/resources/messages.js +3 -0
  307. package/dist/vendor/resources/messages.js.map +1 -0
  308. package/dist/vendor/resources/models.d.ts +193 -0
  309. package/dist/vendor/resources/models.d.ts.map +1 -0
  310. package/dist/vendor/resources/models.js +41 -0
  311. package/dist/vendor/resources/models.js.map +1 -0
  312. package/dist/vendor/resources/shared.d.ts +44 -0
  313. package/dist/vendor/resources/shared.d.ts.map +1 -0
  314. package/dist/vendor/resources/shared.js +3 -0
  315. package/dist/vendor/resources/shared.js.map +1 -0
  316. package/dist/vendor/resources/top-level.d.ts +2 -0
  317. package/dist/vendor/resources/top-level.d.ts.map +1 -0
  318. package/dist/vendor/resources/top-level.js +3 -0
  319. package/dist/vendor/resources/top-level.js.map +1 -0
  320. package/dist/vendor/streaming.d.ts +3 -0
  321. package/dist/vendor/streaming.d.ts.map +1 -0
  322. package/dist/vendor/streaming.js +3 -0
  323. package/dist/vendor/streaming.js.map +1 -0
  324. package/dist/vendor/tools/memory/node.d.ts +18 -0
  325. package/dist/vendor/tools/memory/node.d.ts.map +1 -0
  326. package/dist/vendor/tools/memory/node.js +320 -0
  327. package/dist/vendor/tools/memory/node.js.map +1 -0
  328. package/dist/vendor/uploads.d.ts +3 -0
  329. package/dist/vendor/uploads.d.ts.map +1 -0
  330. package/dist/vendor/uploads.js +3 -0
  331. package/dist/vendor/uploads.js.map +1 -0
  332. package/dist/vendor/version.d.ts +2 -0
  333. package/dist/vendor/version.d.ts.map +1 -0
  334. package/dist/vendor/version.js +2 -0
  335. package/dist/vendor/version.js.map +1 -0
  336. package/package.json +66 -0
@@ -0,0 +1,2258 @@
1
+ import { APIPromise } from '../../core/api-promise.js';
2
+ import { APIResource } from '../../core/resource.js';
3
+ import { Stream } from '../../core/streaming.js';
4
+ import { RequestOptions } from '../../internal/request-options.js';
5
+ import { MessageStream } from '../../lib/MessageStream.js';
6
+ import { type ExtractParsedContentFromParams, type ParseableMessageCreateParams, type ParsedMessage } from '../../lib/parser.js';
7
+ import * as BatchesAPI from './batches.js';
8
+ import { BatchCreateParams, BatchListParams, Batches, DeletedMessageBatch, MessageBatch, MessageBatchCanceledResult, MessageBatchErroredResult, MessageBatchExpiredResult, MessageBatchIndividualResponse, MessageBatchRequestCounts, MessageBatchResult, MessageBatchSucceededResult, MessageBatchesPage } from './batches.js';
9
+ import * as MessagesAPI from './messages.js';
10
+ export declare class Messages extends APIResource {
11
+ batches: BatchesAPI.Batches;
12
+ /**
13
+ * Send a structured list of input messages with text and/or image content, and the
14
+ * model will generate the next message in the conversation.
15
+ *
16
+ * The Messages API can be used for either single queries or stateless multi-turn
17
+ * conversations.
18
+ *
19
+ * Learn more about the Messages API in our
20
+ * [user guide](https://docs.claude.com/en/docs/initial-setup)
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const message = await client.messages.create({
25
+ * max_tokens: 1024,
26
+ * messages: [{ content: 'Hello, world', role: 'user' }],
27
+ * model: 'claude-opus-4-6',
28
+ * });
29
+ * ```
30
+ */
31
+ create(body: MessageCreateParamsNonStreaming, options?: RequestOptions): APIPromise<Message>;
32
+ create(body: MessageCreateParamsStreaming, options?: RequestOptions): APIPromise<Stream<RawMessageStreamEvent>>;
33
+ create(body: MessageCreateParamsBase, options?: RequestOptions): APIPromise<Stream<RawMessageStreamEvent> | Message>;
34
+ /**
35
+ * Send a structured list of input messages with text and/or image content, along with an expected `output_config.format` and
36
+ * the response will be automatically parsed and available in the `parsed_output` property of the message.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * const message = await client.messages.parse({
41
+ * model: 'claude-sonnet-4-5-20250929',
42
+ * max_tokens: 1024,
43
+ * messages: [{ role: 'user', content: 'What is 2+2?' }],
44
+ * output_config: {
45
+ * format: zodOutputFormat(z.object({ answer: z.number() })),
46
+ * },
47
+ * });
48
+ *
49
+ * console.log(message.parsed_output?.answer); // 4
50
+ * ```
51
+ */
52
+ parse<Params extends MessageCreateParamsNonStreaming>(params: Params, options?: RequestOptions): APIPromise<ParsedMessage<ExtractParsedContentFromParams<Params>>>;
53
+ /**
54
+ * Create a Message stream.
55
+ *
56
+ * If `output_config.format` is provided with a parseable format (like `zodOutputFormat()`),
57
+ * the final message will include a `parsed_output` property with the parsed content.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * const stream = client.messages.stream({
62
+ * model: 'claude-sonnet-4-5-20250929',
63
+ * max_tokens: 1024,
64
+ * messages: [{ role: 'user', content: 'What is 2+2?' }],
65
+ * output_config: {
66
+ * format: zodOutputFormat(z.object({ answer: z.number() })),
67
+ * },
68
+ * });
69
+ *
70
+ * const message = await stream.finalMessage();
71
+ * console.log(message.parsed_output?.answer); // 4
72
+ * ```
73
+ */
74
+ stream<Params extends MessageStreamParams>(body: Params, options?: RequestOptions): MessageStream<ExtractParsedContentFromParams<Params>>;
75
+ /**
76
+ * Count the number of tokens in a Message.
77
+ *
78
+ * The Token Count API can be used to count the number of tokens in a Message,
79
+ * including tools, images, and documents, without creating it.
80
+ *
81
+ * Learn more about token counting in our
82
+ * [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting)
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const messageTokensCount =
87
+ * await client.messages.countTokens({
88
+ * messages: [{ content: 'string', role: 'user' }],
89
+ * model: 'claude-opus-4-6',
90
+ * });
91
+ * ```
92
+ */
93
+ countTokens(body: MessageCountTokensParams, options?: RequestOptions): APIPromise<MessageTokensCount>;
94
+ }
95
+ export interface Base64ImageSource {
96
+ data: string;
97
+ media_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
98
+ type: 'base64';
99
+ }
100
+ export interface Base64PDFSource {
101
+ data: string;
102
+ media_type: 'application/pdf';
103
+ type: 'base64';
104
+ }
105
+ export interface BashCodeExecutionOutputBlock {
106
+ file_id: string;
107
+ type: 'bash_code_execution_output';
108
+ }
109
+ export interface BashCodeExecutionOutputBlockParam {
110
+ file_id: string;
111
+ type: 'bash_code_execution_output';
112
+ }
113
+ export interface BashCodeExecutionResultBlock {
114
+ content: Array<BashCodeExecutionOutputBlock>;
115
+ return_code: number;
116
+ stderr: string;
117
+ stdout: string;
118
+ type: 'bash_code_execution_result';
119
+ }
120
+ export interface BashCodeExecutionResultBlockParam {
121
+ content: Array<BashCodeExecutionOutputBlockParam>;
122
+ return_code: number;
123
+ stderr: string;
124
+ stdout: string;
125
+ type: 'bash_code_execution_result';
126
+ }
127
+ export interface BashCodeExecutionToolResultBlock {
128
+ content: BashCodeExecutionToolResultError | BashCodeExecutionResultBlock;
129
+ tool_use_id: string;
130
+ type: 'bash_code_execution_tool_result';
131
+ }
132
+ export interface BashCodeExecutionToolResultBlockParam {
133
+ content: BashCodeExecutionToolResultErrorParam | BashCodeExecutionResultBlockParam;
134
+ tool_use_id: string;
135
+ type: 'bash_code_execution_tool_result';
136
+ /**
137
+ * Create a cache control breakpoint at this content block.
138
+ */
139
+ cache_control?: CacheControlEphemeral | null;
140
+ }
141
+ export interface BashCodeExecutionToolResultError {
142
+ error_code: BashCodeExecutionToolResultErrorCode;
143
+ type: 'bash_code_execution_tool_result_error';
144
+ }
145
+ export type BashCodeExecutionToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded' | 'output_file_too_large';
146
+ export interface BashCodeExecutionToolResultErrorParam {
147
+ error_code: BashCodeExecutionToolResultErrorCode;
148
+ type: 'bash_code_execution_tool_result_error';
149
+ }
150
+ export interface CacheControlEphemeral {
151
+ type: 'ephemeral';
152
+ /**
153
+ * The time-to-live for the cache control breakpoint.
154
+ *
155
+ * This may be one the following values:
156
+ *
157
+ * - `5m`: 5 minutes
158
+ * - `1h`: 1 hour
159
+ *
160
+ * Defaults to `5m`.
161
+ */
162
+ ttl?: '5m' | '1h';
163
+ }
164
+ export interface CacheCreation {
165
+ /**
166
+ * The number of input tokens used to create the 1 hour cache entry.
167
+ */
168
+ ephemeral_1h_input_tokens: number;
169
+ /**
170
+ * The number of input tokens used to create the 5 minute cache entry.
171
+ */
172
+ ephemeral_5m_input_tokens: number;
173
+ }
174
+ export interface CitationCharLocation {
175
+ cited_text: string;
176
+ document_index: number;
177
+ document_title: string | null;
178
+ end_char_index: number;
179
+ file_id: string | null;
180
+ start_char_index: number;
181
+ type: 'char_location';
182
+ }
183
+ export interface CitationCharLocationParam {
184
+ cited_text: string;
185
+ document_index: number;
186
+ document_title: string | null;
187
+ end_char_index: number;
188
+ start_char_index: number;
189
+ type: 'char_location';
190
+ }
191
+ export interface CitationContentBlockLocation {
192
+ cited_text: string;
193
+ document_index: number;
194
+ document_title: string | null;
195
+ end_block_index: number;
196
+ file_id: string | null;
197
+ start_block_index: number;
198
+ type: 'content_block_location';
199
+ }
200
+ export interface CitationContentBlockLocationParam {
201
+ cited_text: string;
202
+ document_index: number;
203
+ document_title: string | null;
204
+ end_block_index: number;
205
+ start_block_index: number;
206
+ type: 'content_block_location';
207
+ }
208
+ export interface CitationPageLocation {
209
+ cited_text: string;
210
+ document_index: number;
211
+ document_title: string | null;
212
+ end_page_number: number;
213
+ file_id: string | null;
214
+ start_page_number: number;
215
+ type: 'page_location';
216
+ }
217
+ export interface CitationPageLocationParam {
218
+ cited_text: string;
219
+ document_index: number;
220
+ document_title: string | null;
221
+ end_page_number: number;
222
+ start_page_number: number;
223
+ type: 'page_location';
224
+ }
225
+ export interface CitationSearchResultLocationParam {
226
+ cited_text: string;
227
+ end_block_index: number;
228
+ search_result_index: number;
229
+ source: string;
230
+ start_block_index: number;
231
+ title: string | null;
232
+ type: 'search_result_location';
233
+ }
234
+ export interface CitationWebSearchResultLocationParam {
235
+ cited_text: string;
236
+ encrypted_index: string;
237
+ title: string | null;
238
+ type: 'web_search_result_location';
239
+ url: string;
240
+ }
241
+ export interface CitationsConfig {
242
+ enabled: boolean;
243
+ }
244
+ export interface CitationsConfigParam {
245
+ enabled?: boolean;
246
+ }
247
+ export interface CitationsDelta {
248
+ citation: CitationCharLocation | CitationPageLocation | CitationContentBlockLocation | CitationsWebSearchResultLocation | CitationsSearchResultLocation;
249
+ type: 'citations_delta';
250
+ }
251
+ export interface CitationsSearchResultLocation {
252
+ cited_text: string;
253
+ end_block_index: number;
254
+ search_result_index: number;
255
+ source: string;
256
+ start_block_index: number;
257
+ title: string | null;
258
+ type: 'search_result_location';
259
+ }
260
+ export interface CitationsWebSearchResultLocation {
261
+ cited_text: string;
262
+ encrypted_index: string;
263
+ title: string | null;
264
+ type: 'web_search_result_location';
265
+ url: string;
266
+ }
267
+ export interface CodeExecutionOutputBlock {
268
+ file_id: string;
269
+ type: 'code_execution_output';
270
+ }
271
+ export interface CodeExecutionOutputBlockParam {
272
+ file_id: string;
273
+ type: 'code_execution_output';
274
+ }
275
+ export interface CodeExecutionResultBlock {
276
+ content: Array<CodeExecutionOutputBlock>;
277
+ return_code: number;
278
+ stderr: string;
279
+ stdout: string;
280
+ type: 'code_execution_result';
281
+ }
282
+ export interface CodeExecutionResultBlockParam {
283
+ content: Array<CodeExecutionOutputBlockParam>;
284
+ return_code: number;
285
+ stderr: string;
286
+ stdout: string;
287
+ type: 'code_execution_result';
288
+ }
289
+ export interface CodeExecutionTool20250522 {
290
+ /**
291
+ * Name of the tool.
292
+ *
293
+ * This is how the tool will be called by the model and in `tool_use` blocks.
294
+ */
295
+ name: 'code_execution';
296
+ type: 'code_execution_20250522';
297
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
298
+ /**
299
+ * Create a cache control breakpoint at this content block.
300
+ */
301
+ cache_control?: CacheControlEphemeral | null;
302
+ /**
303
+ * If true, tool will not be included in initial system prompt. Only loaded when
304
+ * returned via tool_reference from tool search.
305
+ */
306
+ defer_loading?: boolean;
307
+ /**
308
+ * When true, guarantees schema validation on tool names and inputs
309
+ */
310
+ strict?: boolean;
311
+ }
312
+ export interface CodeExecutionTool20250825 {
313
+ /**
314
+ * Name of the tool.
315
+ *
316
+ * This is how the tool will be called by the model and in `tool_use` blocks.
317
+ */
318
+ name: 'code_execution';
319
+ type: 'code_execution_20250825';
320
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
321
+ /**
322
+ * Create a cache control breakpoint at this content block.
323
+ */
324
+ cache_control?: CacheControlEphemeral | null;
325
+ /**
326
+ * If true, tool will not be included in initial system prompt. Only loaded when
327
+ * returned via tool_reference from tool search.
328
+ */
329
+ defer_loading?: boolean;
330
+ /**
331
+ * When true, guarantees schema validation on tool names and inputs
332
+ */
333
+ strict?: boolean;
334
+ }
335
+ /**
336
+ * Code execution tool with REPL state persistence (daemon mode + gVisor
337
+ * checkpoint).
338
+ */
339
+ export interface CodeExecutionTool20260120 {
340
+ /**
341
+ * Name of the tool.
342
+ *
343
+ * This is how the tool will be called by the model and in `tool_use` blocks.
344
+ */
345
+ name: 'code_execution';
346
+ type: 'code_execution_20260120';
347
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
348
+ /**
349
+ * Create a cache control breakpoint at this content block.
350
+ */
351
+ cache_control?: CacheControlEphemeral | null;
352
+ /**
353
+ * If true, tool will not be included in initial system prompt. Only loaded when
354
+ * returned via tool_reference from tool search.
355
+ */
356
+ defer_loading?: boolean;
357
+ /**
358
+ * When true, guarantees schema validation on tool names and inputs
359
+ */
360
+ strict?: boolean;
361
+ }
362
+ export interface CodeExecutionToolResultBlock {
363
+ /**
364
+ * Code execution result with encrypted stdout for PFC + web_search results.
365
+ */
366
+ content: CodeExecutionToolResultBlockContent;
367
+ tool_use_id: string;
368
+ type: 'code_execution_tool_result';
369
+ }
370
+ /**
371
+ * Code execution result with encrypted stdout for PFC + web_search results.
372
+ */
373
+ export type CodeExecutionToolResultBlockContent = CodeExecutionToolResultError | CodeExecutionResultBlock | EncryptedCodeExecutionResultBlock;
374
+ export interface CodeExecutionToolResultBlockParam {
375
+ /**
376
+ * Code execution result with encrypted stdout for PFC + web_search results.
377
+ */
378
+ content: CodeExecutionToolResultBlockParamContent;
379
+ tool_use_id: string;
380
+ type: 'code_execution_tool_result';
381
+ /**
382
+ * Create a cache control breakpoint at this content block.
383
+ */
384
+ cache_control?: CacheControlEphemeral | null;
385
+ }
386
+ /**
387
+ * Code execution result with encrypted stdout for PFC + web_search results.
388
+ */
389
+ export type CodeExecutionToolResultBlockParamContent = CodeExecutionToolResultErrorParam | CodeExecutionResultBlockParam | EncryptedCodeExecutionResultBlockParam;
390
+ export interface CodeExecutionToolResultError {
391
+ error_code: CodeExecutionToolResultErrorCode;
392
+ type: 'code_execution_tool_result_error';
393
+ }
394
+ export type CodeExecutionToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded';
395
+ export interface CodeExecutionToolResultErrorParam {
396
+ error_code: CodeExecutionToolResultErrorCode;
397
+ type: 'code_execution_tool_result_error';
398
+ }
399
+ /**
400
+ * Information about the container used in the request (for the code execution
401
+ * tool)
402
+ */
403
+ export interface Container {
404
+ /**
405
+ * Identifier for the container used in this request
406
+ */
407
+ id: string;
408
+ /**
409
+ * The time at which the container will expire.
410
+ */
411
+ expires_at: string;
412
+ }
413
+ /**
414
+ * Response model for a file uploaded to the container.
415
+ */
416
+ export interface ContainerUploadBlock {
417
+ file_id: string;
418
+ type: 'container_upload';
419
+ }
420
+ /**
421
+ * A content block that represents a file to be uploaded to the container Files
422
+ * uploaded via this block will be available in the container's input directory.
423
+ */
424
+ export interface ContainerUploadBlockParam {
425
+ file_id: string;
426
+ type: 'container_upload';
427
+ /**
428
+ * Create a cache control breakpoint at this content block.
429
+ */
430
+ cache_control?: CacheControlEphemeral | null;
431
+ }
432
+ /**
433
+ * Response model for a file uploaded to the container.
434
+ */
435
+ export type ContentBlock = TextBlock | ThinkingBlock | RedactedThinkingBlock | ToolUseBlock | ServerToolUseBlock | WebSearchToolResultBlock | WebFetchToolResultBlock | CodeExecutionToolResultBlock | BashCodeExecutionToolResultBlock | TextEditorCodeExecutionToolResultBlock | ToolSearchToolResultBlock | ContainerUploadBlock;
436
+ /**
437
+ * Regular text content.
438
+ */
439
+ export type ContentBlockParam = TextBlockParam | ImageBlockParam | DocumentBlockParam | SearchResultBlockParam | ThinkingBlockParam | RedactedThinkingBlockParam | ToolUseBlockParam | ToolResultBlockParam | ServerToolUseBlockParam | WebSearchToolResultBlockParam | WebFetchToolResultBlockParam | CodeExecutionToolResultBlockParam | BashCodeExecutionToolResultBlockParam | TextEditorCodeExecutionToolResultBlockParam | ToolSearchToolResultBlockParam | ContainerUploadBlockParam;
440
+ export interface ContentBlockSource {
441
+ content: string | Array<ContentBlockSourceContent>;
442
+ type: 'content';
443
+ }
444
+ export type ContentBlockSourceContent = TextBlockParam | ImageBlockParam;
445
+ /**
446
+ * Tool invocation directly from the model.
447
+ */
448
+ export interface DirectCaller {
449
+ type: 'direct';
450
+ }
451
+ export interface DocumentBlock {
452
+ /**
453
+ * Citation configuration for the document
454
+ */
455
+ citations: CitationsConfig | null;
456
+ source: Base64PDFSource | PlainTextSource;
457
+ /**
458
+ * The title of the document
459
+ */
460
+ title: string | null;
461
+ type: 'document';
462
+ }
463
+ export interface DocumentBlockParam {
464
+ source: Base64PDFSource | PlainTextSource | ContentBlockSource | URLPDFSource;
465
+ type: 'document';
466
+ /**
467
+ * Create a cache control breakpoint at this content block.
468
+ */
469
+ cache_control?: CacheControlEphemeral | null;
470
+ citations?: CitationsConfigParam | null;
471
+ context?: string | null;
472
+ title?: string | null;
473
+ }
474
+ /**
475
+ * Code execution result with encrypted stdout for PFC + web_search results.
476
+ */
477
+ export interface EncryptedCodeExecutionResultBlock {
478
+ content: Array<CodeExecutionOutputBlock>;
479
+ encrypted_stdout: string;
480
+ return_code: number;
481
+ stderr: string;
482
+ type: 'encrypted_code_execution_result';
483
+ }
484
+ /**
485
+ * Code execution result with encrypted stdout for PFC + web_search results.
486
+ */
487
+ export interface EncryptedCodeExecutionResultBlockParam {
488
+ content: Array<CodeExecutionOutputBlockParam>;
489
+ encrypted_stdout: string;
490
+ return_code: number;
491
+ stderr: string;
492
+ type: 'encrypted_code_execution_result';
493
+ }
494
+ export interface ImageBlockParam {
495
+ source: Base64ImageSource | URLImageSource;
496
+ type: 'image';
497
+ /**
498
+ * Create a cache control breakpoint at this content block.
499
+ */
500
+ cache_control?: CacheControlEphemeral | null;
501
+ }
502
+ export interface InputJSONDelta {
503
+ partial_json: string;
504
+ type: 'input_json_delta';
505
+ }
506
+ export interface JSONOutputFormat {
507
+ /**
508
+ * The JSON schema of the format
509
+ */
510
+ schema: {
511
+ [key: string]: unknown;
512
+ };
513
+ type: 'json_schema';
514
+ }
515
+ export interface MemoryTool20250818 {
516
+ /**
517
+ * Name of the tool.
518
+ *
519
+ * This is how the tool will be called by the model and in `tool_use` blocks.
520
+ */
521
+ name: 'memory';
522
+ type: 'memory_20250818';
523
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
524
+ /**
525
+ * Create a cache control breakpoint at this content block.
526
+ */
527
+ cache_control?: CacheControlEphemeral | null;
528
+ /**
529
+ * If true, tool will not be included in initial system prompt. Only loaded when
530
+ * returned via tool_reference from tool search.
531
+ */
532
+ defer_loading?: boolean;
533
+ input_examples?: Array<{
534
+ [key: string]: unknown;
535
+ }>;
536
+ /**
537
+ * When true, guarantees schema validation on tool names and inputs
538
+ */
539
+ strict?: boolean;
540
+ }
541
+ export interface Message {
542
+ /**
543
+ * Unique object identifier.
544
+ *
545
+ * The format and length of IDs may change over time.
546
+ */
547
+ id: string;
548
+ /**
549
+ * Information about the container used in the request (for the code execution
550
+ * tool)
551
+ */
552
+ container: Container | null;
553
+ /**
554
+ * Content generated by the model.
555
+ *
556
+ * This is an array of content blocks, each of which has a `type` that determines
557
+ * its shape.
558
+ *
559
+ * Example:
560
+ *
561
+ * ```json
562
+ * [{ "type": "text", "text": "Hi, I'm Claude." }]
563
+ * ```
564
+ *
565
+ * If the request input `messages` ended with an `assistant` turn, then the
566
+ * response `content` will continue directly from that last turn. You can use this
567
+ * to constrain the model's output.
568
+ *
569
+ * For example, if the input `messages` were:
570
+ *
571
+ * ```json
572
+ * [
573
+ * {
574
+ * "role": "user",
575
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
576
+ * },
577
+ * { "role": "assistant", "content": "The best answer is (" }
578
+ * ]
579
+ * ```
580
+ *
581
+ * Then the response `content` might be:
582
+ *
583
+ * ```json
584
+ * [{ "type": "text", "text": "B)" }]
585
+ * ```
586
+ */
587
+ content: Array<ContentBlock>;
588
+ /**
589
+ * The model that will complete your prompt.\n\nSee
590
+ * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
591
+ * details and options.
592
+ */
593
+ model: Model;
594
+ /**
595
+ * Conversational role of the generated message.
596
+ *
597
+ * This will always be `"assistant"`.
598
+ */
599
+ role: 'assistant';
600
+ /**
601
+ * The reason that we stopped.
602
+ *
603
+ * This may be one the following values:
604
+ *
605
+ * - `"end_turn"`: the model reached a natural stopping point
606
+ * - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
607
+ * - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
608
+ * - `"tool_use"`: the model invoked one or more tools
609
+ * - `"pause_turn"`: we paused a long-running turn. You may provide the response
610
+ * back as-is in a subsequent request to let the model continue.
611
+ * - `"refusal"`: when streaming classifiers intervene to handle potential policy
612
+ * violations
613
+ *
614
+ * In non-streaming mode this value is always non-null. In streaming mode, it is
615
+ * null in the `message_start` event and non-null otherwise.
616
+ */
617
+ stop_reason: StopReason | null;
618
+ /**
619
+ * Which custom stop sequence was generated, if any.
620
+ *
621
+ * This value will be a non-null string if one of your custom stop sequences was
622
+ * generated.
623
+ */
624
+ stop_sequence: string | null;
625
+ /**
626
+ * Object type.
627
+ *
628
+ * For Messages, this is always `"message"`.
629
+ */
630
+ type: 'message';
631
+ /**
632
+ * Billing and rate-limit usage.
633
+ *
634
+ * Anthropic's API bills and rate-limits by token counts, as tokens represent the
635
+ * underlying cost to our systems.
636
+ *
637
+ * Under the hood, the API transforms requests into a format suitable for the
638
+ * model. The model's output then goes through a parsing stage before becoming an
639
+ * API response. As a result, the token counts in `usage` will not match one-to-one
640
+ * with the exact visible content of an API request or response.
641
+ *
642
+ * For example, `output_tokens` will be non-zero, even for an empty string response
643
+ * from Claude.
644
+ *
645
+ * Total input tokens in a request is the summation of `input_tokens`,
646
+ * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
647
+ */
648
+ usage: Usage;
649
+ }
650
+ /**
651
+ * Code execution tool with REPL state persistence (daemon mode + gVisor
652
+ * checkpoint).
653
+ */
654
+ export type MessageCountTokensTool = Tool | ToolBash20250124 | CodeExecutionTool20250522 | CodeExecutionTool20250825 | CodeExecutionTool20260120 | MemoryTool20250818 | ToolTextEditor20250124 | ToolTextEditor20250429 | ToolTextEditor20250728 | WebSearchTool20250305 | WebFetchTool20250910 | WebSearchTool20260209 | WebFetchTool20260209 | WebFetchTool20260309 | ToolSearchToolBm25_20251119 | ToolSearchToolRegex20251119;
655
+ export interface MessageDeltaUsage {
656
+ /**
657
+ * The cumulative number of input tokens used to create the cache entry.
658
+ */
659
+ cache_creation_input_tokens: number | null;
660
+ /**
661
+ * The cumulative number of input tokens read from the cache.
662
+ */
663
+ cache_read_input_tokens: number | null;
664
+ /**
665
+ * The cumulative number of input tokens which were used.
666
+ */
667
+ input_tokens: number | null;
668
+ /**
669
+ * The cumulative number of output tokens which were used.
670
+ */
671
+ output_tokens: number;
672
+ /**
673
+ * The number of server tool requests.
674
+ */
675
+ server_tool_use: ServerToolUsage | null;
676
+ }
677
+ export interface MessageParam {
678
+ content: string | Array<ContentBlockParam>;
679
+ role: 'user' | 'assistant';
680
+ }
681
+ export interface MessageTokensCount {
682
+ /**
683
+ * The total number of tokens across the provided list of messages, system prompt,
684
+ * and tools.
685
+ */
686
+ input_tokens: number;
687
+ }
688
+ export interface Metadata {
689
+ /**
690
+ * An external identifier for the user who is associated with the request.
691
+ *
692
+ * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
693
+ * this id to help detect abuse. Do not include any identifying information such as
694
+ * name, email address, or phone number.
695
+ */
696
+ user_id?: string | null;
697
+ }
698
+ /**
699
+ * The model that will complete your prompt.\n\nSee
700
+ * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
701
+ * details and options.
702
+ */
703
+ export type Model = 'claude-opus-4-6' | 'claude-sonnet-4-6' | 'claude-haiku-4-5' | 'claude-haiku-4-5-20251001' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-5' | 'claude-sonnet-4-5-20250929' | 'claude-opus-4-1' | 'claude-opus-4-1-20250805' | 'claude-opus-4-0' | 'claude-opus-4-20250514' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-3-haiku-20240307' | (string & {});
704
+ export interface OutputConfig {
705
+ /**
706
+ * All possible effort levels.
707
+ */
708
+ effort?: 'low' | 'medium' | 'high' | 'max' | null;
709
+ /**
710
+ * A schema to specify Claude's output format in responses. See
711
+ * [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
712
+ */
713
+ format?: JSONOutputFormat | null;
714
+ }
715
+ export interface PlainTextSource {
716
+ data: string;
717
+ media_type: 'text/plain';
718
+ type: 'text';
719
+ }
720
+ export type RawContentBlockDelta = TextDelta | InputJSONDelta | CitationsDelta | ThinkingDelta | SignatureDelta;
721
+ export interface RawContentBlockDeltaEvent {
722
+ delta: RawContentBlockDelta;
723
+ index: number;
724
+ type: 'content_block_delta';
725
+ }
726
+ export interface RawContentBlockStartEvent {
727
+ /**
728
+ * Response model for a file uploaded to the container.
729
+ */
730
+ content_block: TextBlock | ThinkingBlock | RedactedThinkingBlock | ToolUseBlock | ServerToolUseBlock | WebSearchToolResultBlock | WebFetchToolResultBlock | CodeExecutionToolResultBlock | BashCodeExecutionToolResultBlock | TextEditorCodeExecutionToolResultBlock | ToolSearchToolResultBlock | ContainerUploadBlock;
731
+ index: number;
732
+ type: 'content_block_start';
733
+ }
734
+ export interface RawContentBlockStopEvent {
735
+ index: number;
736
+ type: 'content_block_stop';
737
+ }
738
+ export interface RawMessageDeltaEvent {
739
+ delta: RawMessageDeltaEvent.Delta;
740
+ type: 'message_delta';
741
+ /**
742
+ * Billing and rate-limit usage.
743
+ *
744
+ * Anthropic's API bills and rate-limits by token counts, as tokens represent the
745
+ * underlying cost to our systems.
746
+ *
747
+ * Under the hood, the API transforms requests into a format suitable for the
748
+ * model. The model's output then goes through a parsing stage before becoming an
749
+ * API response. As a result, the token counts in `usage` will not match one-to-one
750
+ * with the exact visible content of an API request or response.
751
+ *
752
+ * For example, `output_tokens` will be non-zero, even for an empty string response
753
+ * from Claude.
754
+ *
755
+ * Total input tokens in a request is the summation of `input_tokens`,
756
+ * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
757
+ */
758
+ usage: MessageDeltaUsage;
759
+ }
760
+ export declare namespace RawMessageDeltaEvent {
761
+ interface Delta {
762
+ /**
763
+ * Information about the container used in the request (for the code execution
764
+ * tool)
765
+ */
766
+ container: MessagesAPI.Container | null;
767
+ stop_reason: MessagesAPI.StopReason | null;
768
+ stop_sequence: string | null;
769
+ }
770
+ }
771
+ export interface RawMessageStartEvent {
772
+ message: Message;
773
+ type: 'message_start';
774
+ }
775
+ export interface RawMessageStopEvent {
776
+ type: 'message_stop';
777
+ }
778
+ export type RawMessageStreamEvent = RawMessageStartEvent | RawMessageDeltaEvent | RawMessageStopEvent | RawContentBlockStartEvent | RawContentBlockDeltaEvent | RawContentBlockStopEvent;
779
+ export interface RedactedThinkingBlock {
780
+ data: string;
781
+ type: 'redacted_thinking';
782
+ }
783
+ export interface RedactedThinkingBlockParam {
784
+ data: string;
785
+ type: 'redacted_thinking';
786
+ }
787
+ export interface SearchResultBlockParam {
788
+ content: Array<TextBlockParam>;
789
+ source: string;
790
+ title: string;
791
+ type: 'search_result';
792
+ /**
793
+ * Create a cache control breakpoint at this content block.
794
+ */
795
+ cache_control?: CacheControlEphemeral | null;
796
+ citations?: CitationsConfigParam;
797
+ }
798
+ /**
799
+ * Tool invocation generated by a server-side tool.
800
+ */
801
+ export interface ServerToolCaller {
802
+ tool_id: string;
803
+ type: 'code_execution_20250825';
804
+ }
805
+ export interface ServerToolCaller20260120 {
806
+ tool_id: string;
807
+ type: 'code_execution_20260120';
808
+ }
809
+ export interface ServerToolUsage {
810
+ /**
811
+ * The number of web fetch tool requests.
812
+ */
813
+ web_fetch_requests: number;
814
+ /**
815
+ * The number of web search tool requests.
816
+ */
817
+ web_search_requests: number;
818
+ }
819
+ export interface ServerToolUseBlock {
820
+ id: string;
821
+ /**
822
+ * Tool invocation directly from the model.
823
+ */
824
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
825
+ input: unknown;
826
+ name: 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25';
827
+ type: 'server_tool_use';
828
+ }
829
+ export interface ServerToolUseBlockParam {
830
+ id: string;
831
+ input: unknown;
832
+ name: 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25';
833
+ type: 'server_tool_use';
834
+ /**
835
+ * Create a cache control breakpoint at this content block.
836
+ */
837
+ cache_control?: CacheControlEphemeral | null;
838
+ /**
839
+ * Tool invocation directly from the model.
840
+ */
841
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
842
+ }
843
+ export interface SignatureDelta {
844
+ signature: string;
845
+ type: 'signature_delta';
846
+ }
847
+ export type StopReason = 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | 'pause_turn' | 'refusal';
848
+ export interface TextBlock {
849
+ /**
850
+ * Citations supporting the text block.
851
+ *
852
+ * The type of citation returned will depend on the type of document being cited.
853
+ * Citing a PDF results in `page_location`, plain text results in `char_location`,
854
+ * and content document results in `content_block_location`.
855
+ */
856
+ citations: Array<TextCitation> | null;
857
+ text: string;
858
+ type: 'text';
859
+ }
860
+ export interface TextBlockParam {
861
+ text: string;
862
+ type: 'text';
863
+ /**
864
+ * Create a cache control breakpoint at this content block.
865
+ */
866
+ cache_control?: CacheControlEphemeral | null;
867
+ citations?: Array<TextCitationParam> | null;
868
+ }
869
+ export type TextCitation = CitationCharLocation | CitationPageLocation | CitationContentBlockLocation | CitationsWebSearchResultLocation | CitationsSearchResultLocation;
870
+ export type TextCitationParam = CitationCharLocationParam | CitationPageLocationParam | CitationContentBlockLocationParam | CitationWebSearchResultLocationParam | CitationSearchResultLocationParam;
871
+ export interface TextDelta {
872
+ text: string;
873
+ type: 'text_delta';
874
+ }
875
+ export interface TextEditorCodeExecutionCreateResultBlock {
876
+ is_file_update: boolean;
877
+ type: 'text_editor_code_execution_create_result';
878
+ }
879
+ export interface TextEditorCodeExecutionCreateResultBlockParam {
880
+ is_file_update: boolean;
881
+ type: 'text_editor_code_execution_create_result';
882
+ }
883
+ export interface TextEditorCodeExecutionStrReplaceResultBlock {
884
+ lines: Array<string> | null;
885
+ new_lines: number | null;
886
+ new_start: number | null;
887
+ old_lines: number | null;
888
+ old_start: number | null;
889
+ type: 'text_editor_code_execution_str_replace_result';
890
+ }
891
+ export interface TextEditorCodeExecutionStrReplaceResultBlockParam {
892
+ type: 'text_editor_code_execution_str_replace_result';
893
+ lines?: Array<string> | null;
894
+ new_lines?: number | null;
895
+ new_start?: number | null;
896
+ old_lines?: number | null;
897
+ old_start?: number | null;
898
+ }
899
+ export interface TextEditorCodeExecutionToolResultBlock {
900
+ content: TextEditorCodeExecutionToolResultError | TextEditorCodeExecutionViewResultBlock | TextEditorCodeExecutionCreateResultBlock | TextEditorCodeExecutionStrReplaceResultBlock;
901
+ tool_use_id: string;
902
+ type: 'text_editor_code_execution_tool_result';
903
+ }
904
+ export interface TextEditorCodeExecutionToolResultBlockParam {
905
+ content: TextEditorCodeExecutionToolResultErrorParam | TextEditorCodeExecutionViewResultBlockParam | TextEditorCodeExecutionCreateResultBlockParam | TextEditorCodeExecutionStrReplaceResultBlockParam;
906
+ tool_use_id: string;
907
+ type: 'text_editor_code_execution_tool_result';
908
+ /**
909
+ * Create a cache control breakpoint at this content block.
910
+ */
911
+ cache_control?: CacheControlEphemeral | null;
912
+ }
913
+ export interface TextEditorCodeExecutionToolResultError {
914
+ error_code: TextEditorCodeExecutionToolResultErrorCode;
915
+ error_message: string | null;
916
+ type: 'text_editor_code_execution_tool_result_error';
917
+ }
918
+ export type TextEditorCodeExecutionToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded' | 'file_not_found';
919
+ export interface TextEditorCodeExecutionToolResultErrorParam {
920
+ error_code: TextEditorCodeExecutionToolResultErrorCode;
921
+ type: 'text_editor_code_execution_tool_result_error';
922
+ error_message?: string | null;
923
+ }
924
+ export interface TextEditorCodeExecutionViewResultBlock {
925
+ content: string;
926
+ file_type: 'text' | 'image' | 'pdf';
927
+ num_lines: number | null;
928
+ start_line: number | null;
929
+ total_lines: number | null;
930
+ type: 'text_editor_code_execution_view_result';
931
+ }
932
+ export interface TextEditorCodeExecutionViewResultBlockParam {
933
+ content: string;
934
+ file_type: 'text' | 'image' | 'pdf';
935
+ type: 'text_editor_code_execution_view_result';
936
+ num_lines?: number | null;
937
+ start_line?: number | null;
938
+ total_lines?: number | null;
939
+ }
940
+ export interface ThinkingBlock {
941
+ signature: string;
942
+ thinking: string;
943
+ type: 'thinking';
944
+ }
945
+ export interface ThinkingBlockParam {
946
+ signature: string;
947
+ thinking: string;
948
+ type: 'thinking';
949
+ }
950
+ export interface ThinkingConfigAdaptive {
951
+ type: 'adaptive';
952
+ /**
953
+ * Controls how thinking content appears in the response. When set to `summarized`,
954
+ * thinking is returned normally. When set to `omitted`, thinking content is
955
+ * redacted but a signature is returned for multi-turn continuity. Defaults to
956
+ * `summarized`.
957
+ */
958
+ display?: 'summarized' | 'omitted' | null;
959
+ }
960
+ export interface ThinkingConfigDisabled {
961
+ type: 'disabled';
962
+ }
963
+ export interface ThinkingConfigEnabled {
964
+ /**
965
+ * Determines how many tokens Claude can use for its internal reasoning process.
966
+ * Larger budgets can enable more thorough analysis for complex problems, improving
967
+ * response quality.
968
+ *
969
+ * Must be ≥1024 and less than `max_tokens`.
970
+ *
971
+ * See
972
+ * [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
973
+ * for details.
974
+ */
975
+ budget_tokens: number;
976
+ type: 'enabled';
977
+ /**
978
+ * Controls how thinking content appears in the response. When set to `summarized`,
979
+ * thinking is returned normally. When set to `omitted`, thinking content is
980
+ * redacted but a signature is returned for multi-turn continuity. Defaults to
981
+ * `summarized`.
982
+ */
983
+ display?: 'summarized' | 'omitted' | null;
984
+ }
985
+ /**
986
+ * Configuration for enabling Claude's extended thinking.
987
+ *
988
+ * When enabled, responses include `thinking` content blocks showing Claude's
989
+ * thinking process before the final answer. Requires a minimum budget of 1,024
990
+ * tokens and counts towards your `max_tokens` limit.
991
+ *
992
+ * See
993
+ * [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
994
+ * for details.
995
+ */
996
+ export type ThinkingConfigParam = ThinkingConfigEnabled | ThinkingConfigDisabled | ThinkingConfigAdaptive;
997
+ export interface ThinkingDelta {
998
+ thinking: string;
999
+ type: 'thinking_delta';
1000
+ }
1001
+ export interface Tool {
1002
+ /**
1003
+ * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
1004
+ *
1005
+ * This defines the shape of the `input` that your tool accepts and that the model
1006
+ * will produce.
1007
+ */
1008
+ input_schema: Tool.InputSchema;
1009
+ /**
1010
+ * Name of the tool.
1011
+ *
1012
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1013
+ */
1014
+ name: string;
1015
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1016
+ /**
1017
+ * Create a cache control breakpoint at this content block.
1018
+ */
1019
+ cache_control?: CacheControlEphemeral | null;
1020
+ /**
1021
+ * If true, tool will not be included in initial system prompt. Only loaded when
1022
+ * returned via tool_reference from tool search.
1023
+ */
1024
+ defer_loading?: boolean;
1025
+ /**
1026
+ * Description of what this tool does.
1027
+ *
1028
+ * Tool descriptions should be as detailed as possible. The more information that
1029
+ * the model has about what the tool is and how to use it, the better it will
1030
+ * perform. You can use natural language descriptions to reinforce important
1031
+ * aspects of the tool input JSON schema.
1032
+ */
1033
+ description?: string;
1034
+ /**
1035
+ * Enable eager input streaming for this tool. When true, tool input parameters
1036
+ * will be streamed incrementally as they are generated, and types will be inferred
1037
+ * on-the-fly rather than buffering the full JSON output. When false, streaming is
1038
+ * disabled for this tool even if the fine-grained-tool-streaming beta is active.
1039
+ * When null (default), uses the default behavior based on beta headers.
1040
+ */
1041
+ eager_input_streaming?: boolean | null;
1042
+ input_examples?: Array<{
1043
+ [key: string]: unknown;
1044
+ }>;
1045
+ /**
1046
+ * When true, guarantees schema validation on tool names and inputs
1047
+ */
1048
+ strict?: boolean;
1049
+ type?: 'custom' | null;
1050
+ }
1051
+ export declare namespace Tool {
1052
+ /**
1053
+ * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
1054
+ *
1055
+ * This defines the shape of the `input` that your tool accepts and that the model
1056
+ * will produce.
1057
+ */
1058
+ interface InputSchema {
1059
+ type: 'object';
1060
+ properties?: unknown | null;
1061
+ required?: Array<string> | null;
1062
+ [k: string]: unknown;
1063
+ }
1064
+ }
1065
+ export interface ToolBash20250124 {
1066
+ /**
1067
+ * Name of the tool.
1068
+ *
1069
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1070
+ */
1071
+ name: 'bash';
1072
+ type: 'bash_20250124';
1073
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1074
+ /**
1075
+ * Create a cache control breakpoint at this content block.
1076
+ */
1077
+ cache_control?: CacheControlEphemeral | null;
1078
+ /**
1079
+ * If true, tool will not be included in initial system prompt. Only loaded when
1080
+ * returned via tool_reference from tool search.
1081
+ */
1082
+ defer_loading?: boolean;
1083
+ input_examples?: Array<{
1084
+ [key: string]: unknown;
1085
+ }>;
1086
+ /**
1087
+ * When true, guarantees schema validation on tool names and inputs
1088
+ */
1089
+ strict?: boolean;
1090
+ }
1091
+ /**
1092
+ * How the model should use the provided tools. The model can use a specific tool,
1093
+ * any available tool, decide by itself, or not use tools at all.
1094
+ */
1095
+ export type ToolChoice = ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceNone;
1096
+ /**
1097
+ * The model will use any available tools.
1098
+ */
1099
+ export interface ToolChoiceAny {
1100
+ type: 'any';
1101
+ /**
1102
+ * Whether to disable parallel tool use.
1103
+ *
1104
+ * Defaults to `false`. If set to `true`, the model will output exactly one tool
1105
+ * use.
1106
+ */
1107
+ disable_parallel_tool_use?: boolean;
1108
+ }
1109
+ /**
1110
+ * The model will automatically decide whether to use tools.
1111
+ */
1112
+ export interface ToolChoiceAuto {
1113
+ type: 'auto';
1114
+ /**
1115
+ * Whether to disable parallel tool use.
1116
+ *
1117
+ * Defaults to `false`. If set to `true`, the model will output at most one tool
1118
+ * use.
1119
+ */
1120
+ disable_parallel_tool_use?: boolean;
1121
+ }
1122
+ /**
1123
+ * The model will not be allowed to use tools.
1124
+ */
1125
+ export interface ToolChoiceNone {
1126
+ type: 'none';
1127
+ }
1128
+ /**
1129
+ * The model will use the specified tool with `tool_choice.name`.
1130
+ */
1131
+ export interface ToolChoiceTool {
1132
+ /**
1133
+ * The name of the tool to use.
1134
+ */
1135
+ name: string;
1136
+ type: 'tool';
1137
+ /**
1138
+ * Whether to disable parallel tool use.
1139
+ *
1140
+ * Defaults to `false`. If set to `true`, the model will output exactly one tool
1141
+ * use.
1142
+ */
1143
+ disable_parallel_tool_use?: boolean;
1144
+ }
1145
+ export interface ToolReferenceBlock {
1146
+ tool_name: string;
1147
+ type: 'tool_reference';
1148
+ }
1149
+ /**
1150
+ * Tool reference block that can be included in tool_result content.
1151
+ */
1152
+ export interface ToolReferenceBlockParam {
1153
+ tool_name: string;
1154
+ type: 'tool_reference';
1155
+ /**
1156
+ * Create a cache control breakpoint at this content block.
1157
+ */
1158
+ cache_control?: CacheControlEphemeral | null;
1159
+ }
1160
+ export interface ToolResultBlockParam {
1161
+ tool_use_id: string;
1162
+ type: 'tool_result';
1163
+ /**
1164
+ * Create a cache control breakpoint at this content block.
1165
+ */
1166
+ cache_control?: CacheControlEphemeral | null;
1167
+ content?: string | Array<TextBlockParam | ImageBlockParam | SearchResultBlockParam | DocumentBlockParam | ToolReferenceBlockParam>;
1168
+ is_error?: boolean;
1169
+ }
1170
+ export interface ToolSearchToolBm25_20251119 {
1171
+ /**
1172
+ * Name of the tool.
1173
+ *
1174
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1175
+ */
1176
+ name: 'tool_search_tool_bm25';
1177
+ type: 'tool_search_tool_bm25_20251119' | 'tool_search_tool_bm25';
1178
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1179
+ /**
1180
+ * Create a cache control breakpoint at this content block.
1181
+ */
1182
+ cache_control?: CacheControlEphemeral | null;
1183
+ /**
1184
+ * If true, tool will not be included in initial system prompt. Only loaded when
1185
+ * returned via tool_reference from tool search.
1186
+ */
1187
+ defer_loading?: boolean;
1188
+ /**
1189
+ * When true, guarantees schema validation on tool names and inputs
1190
+ */
1191
+ strict?: boolean;
1192
+ }
1193
+ export interface ToolSearchToolRegex20251119 {
1194
+ /**
1195
+ * Name of the tool.
1196
+ *
1197
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1198
+ */
1199
+ name: 'tool_search_tool_regex';
1200
+ type: 'tool_search_tool_regex_20251119' | 'tool_search_tool_regex';
1201
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1202
+ /**
1203
+ * Create a cache control breakpoint at this content block.
1204
+ */
1205
+ cache_control?: CacheControlEphemeral | null;
1206
+ /**
1207
+ * If true, tool will not be included in initial system prompt. Only loaded when
1208
+ * returned via tool_reference from tool search.
1209
+ */
1210
+ defer_loading?: boolean;
1211
+ /**
1212
+ * When true, guarantees schema validation on tool names and inputs
1213
+ */
1214
+ strict?: boolean;
1215
+ }
1216
+ export interface ToolSearchToolResultBlock {
1217
+ content: ToolSearchToolResultError | ToolSearchToolSearchResultBlock;
1218
+ tool_use_id: string;
1219
+ type: 'tool_search_tool_result';
1220
+ }
1221
+ export interface ToolSearchToolResultBlockParam {
1222
+ content: ToolSearchToolResultErrorParam | ToolSearchToolSearchResultBlockParam;
1223
+ tool_use_id: string;
1224
+ type: 'tool_search_tool_result';
1225
+ /**
1226
+ * Create a cache control breakpoint at this content block.
1227
+ */
1228
+ cache_control?: CacheControlEphemeral | null;
1229
+ }
1230
+ export interface ToolSearchToolResultError {
1231
+ error_code: ToolSearchToolResultErrorCode;
1232
+ error_message: string | null;
1233
+ type: 'tool_search_tool_result_error';
1234
+ }
1235
+ export type ToolSearchToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded';
1236
+ export interface ToolSearchToolResultErrorParam {
1237
+ error_code: ToolSearchToolResultErrorCode;
1238
+ type: 'tool_search_tool_result_error';
1239
+ }
1240
+ export interface ToolSearchToolSearchResultBlock {
1241
+ tool_references: Array<ToolReferenceBlock>;
1242
+ type: 'tool_search_tool_search_result';
1243
+ }
1244
+ export interface ToolSearchToolSearchResultBlockParam {
1245
+ tool_references: Array<ToolReferenceBlockParam>;
1246
+ type: 'tool_search_tool_search_result';
1247
+ }
1248
+ export interface ToolTextEditor20250124 {
1249
+ /**
1250
+ * Name of the tool.
1251
+ *
1252
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1253
+ */
1254
+ name: 'str_replace_editor';
1255
+ type: 'text_editor_20250124';
1256
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1257
+ /**
1258
+ * Create a cache control breakpoint at this content block.
1259
+ */
1260
+ cache_control?: CacheControlEphemeral | null;
1261
+ /**
1262
+ * If true, tool will not be included in initial system prompt. Only loaded when
1263
+ * returned via tool_reference from tool search.
1264
+ */
1265
+ defer_loading?: boolean;
1266
+ input_examples?: Array<{
1267
+ [key: string]: unknown;
1268
+ }>;
1269
+ /**
1270
+ * When true, guarantees schema validation on tool names and inputs
1271
+ */
1272
+ strict?: boolean;
1273
+ }
1274
+ export interface ToolTextEditor20250429 {
1275
+ /**
1276
+ * Name of the tool.
1277
+ *
1278
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1279
+ */
1280
+ name: 'str_replace_based_edit_tool';
1281
+ type: 'text_editor_20250429';
1282
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1283
+ /**
1284
+ * Create a cache control breakpoint at this content block.
1285
+ */
1286
+ cache_control?: CacheControlEphemeral | null;
1287
+ /**
1288
+ * If true, tool will not be included in initial system prompt. Only loaded when
1289
+ * returned via tool_reference from tool search.
1290
+ */
1291
+ defer_loading?: boolean;
1292
+ input_examples?: Array<{
1293
+ [key: string]: unknown;
1294
+ }>;
1295
+ /**
1296
+ * When true, guarantees schema validation on tool names and inputs
1297
+ */
1298
+ strict?: boolean;
1299
+ }
1300
+ export interface ToolTextEditor20250728 {
1301
+ /**
1302
+ * Name of the tool.
1303
+ *
1304
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1305
+ */
1306
+ name: 'str_replace_based_edit_tool';
1307
+ type: 'text_editor_20250728';
1308
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1309
+ /**
1310
+ * Create a cache control breakpoint at this content block.
1311
+ */
1312
+ cache_control?: CacheControlEphemeral | null;
1313
+ /**
1314
+ * If true, tool will not be included in initial system prompt. Only loaded when
1315
+ * returned via tool_reference from tool search.
1316
+ */
1317
+ defer_loading?: boolean;
1318
+ input_examples?: Array<{
1319
+ [key: string]: unknown;
1320
+ }>;
1321
+ /**
1322
+ * Maximum number of characters to display when viewing a file. If not specified,
1323
+ * defaults to displaying the full file.
1324
+ */
1325
+ max_characters?: number | null;
1326
+ /**
1327
+ * When true, guarantees schema validation on tool names and inputs
1328
+ */
1329
+ strict?: boolean;
1330
+ }
1331
+ /**
1332
+ * Code execution tool with REPL state persistence (daemon mode + gVisor
1333
+ * checkpoint).
1334
+ */
1335
+ export type ToolUnion = Tool | ToolBash20250124 | CodeExecutionTool20250522 | CodeExecutionTool20250825 | CodeExecutionTool20260120 | MemoryTool20250818 | ToolTextEditor20250124 | ToolTextEditor20250429 | ToolTextEditor20250728 | WebSearchTool20250305 | WebFetchTool20250910 | WebSearchTool20260209 | WebFetchTool20260209 | WebFetchTool20260309 | ToolSearchToolBm25_20251119 | ToolSearchToolRegex20251119;
1336
+ export interface ToolUseBlock {
1337
+ id: string;
1338
+ /**
1339
+ * Tool invocation directly from the model.
1340
+ */
1341
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
1342
+ input: unknown;
1343
+ name: string;
1344
+ type: 'tool_use';
1345
+ }
1346
+ export interface ToolUseBlockParam {
1347
+ id: string;
1348
+ input: unknown;
1349
+ name: string;
1350
+ type: 'tool_use';
1351
+ /**
1352
+ * Create a cache control breakpoint at this content block.
1353
+ */
1354
+ cache_control?: CacheControlEphemeral | null;
1355
+ /**
1356
+ * Tool invocation directly from the model.
1357
+ */
1358
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
1359
+ }
1360
+ export interface URLImageSource {
1361
+ type: 'url';
1362
+ url: string;
1363
+ }
1364
+ export interface URLPDFSource {
1365
+ type: 'url';
1366
+ url: string;
1367
+ }
1368
+ export interface Usage {
1369
+ /**
1370
+ * Breakdown of cached tokens by TTL
1371
+ */
1372
+ cache_creation: CacheCreation | null;
1373
+ /**
1374
+ * The number of input tokens used to create the cache entry.
1375
+ */
1376
+ cache_creation_input_tokens: number | null;
1377
+ /**
1378
+ * The number of input tokens read from the cache.
1379
+ */
1380
+ cache_read_input_tokens: number | null;
1381
+ /**
1382
+ * The geographic region where inference was performed for this request.
1383
+ */
1384
+ inference_geo: string | null;
1385
+ /**
1386
+ * The number of input tokens which were used.
1387
+ */
1388
+ input_tokens: number;
1389
+ /**
1390
+ * The number of output tokens which were used.
1391
+ */
1392
+ output_tokens: number;
1393
+ /**
1394
+ * The number of server tool requests.
1395
+ */
1396
+ server_tool_use: ServerToolUsage | null;
1397
+ /**
1398
+ * If the request used the priority, standard, or batch tier.
1399
+ */
1400
+ service_tier: 'standard' | 'priority' | 'batch' | null;
1401
+ }
1402
+ export interface UserLocation {
1403
+ type: 'approximate';
1404
+ /**
1405
+ * The city of the user.
1406
+ */
1407
+ city?: string | null;
1408
+ /**
1409
+ * The two letter
1410
+ * [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
1411
+ * user.
1412
+ */
1413
+ country?: string | null;
1414
+ /**
1415
+ * The region of the user.
1416
+ */
1417
+ region?: string | null;
1418
+ /**
1419
+ * The [IANA timezone](https://nodatime.org/TimeZones) of the user.
1420
+ */
1421
+ timezone?: string | null;
1422
+ }
1423
+ export interface WebFetchBlock {
1424
+ content: DocumentBlock;
1425
+ /**
1426
+ * ISO 8601 timestamp when the content was retrieved
1427
+ */
1428
+ retrieved_at: string | null;
1429
+ type: 'web_fetch_result';
1430
+ /**
1431
+ * Fetched content URL
1432
+ */
1433
+ url: string;
1434
+ }
1435
+ export interface WebFetchBlockParam {
1436
+ content: DocumentBlockParam;
1437
+ type: 'web_fetch_result';
1438
+ /**
1439
+ * Fetched content URL
1440
+ */
1441
+ url: string;
1442
+ /**
1443
+ * ISO 8601 timestamp when the content was retrieved
1444
+ */
1445
+ retrieved_at?: string | null;
1446
+ }
1447
+ export interface WebFetchTool20250910 {
1448
+ /**
1449
+ * Name of the tool.
1450
+ *
1451
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1452
+ */
1453
+ name: 'web_fetch';
1454
+ type: 'web_fetch_20250910';
1455
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1456
+ /**
1457
+ * List of domains to allow fetching from
1458
+ */
1459
+ allowed_domains?: Array<string> | null;
1460
+ /**
1461
+ * List of domains to block fetching from
1462
+ */
1463
+ blocked_domains?: Array<string> | null;
1464
+ /**
1465
+ * Create a cache control breakpoint at this content block.
1466
+ */
1467
+ cache_control?: CacheControlEphemeral | null;
1468
+ /**
1469
+ * Citations configuration for fetched documents. Citations are disabled by
1470
+ * default.
1471
+ */
1472
+ citations?: CitationsConfigParam | null;
1473
+ /**
1474
+ * If true, tool will not be included in initial system prompt. Only loaded when
1475
+ * returned via tool_reference from tool search.
1476
+ */
1477
+ defer_loading?: boolean;
1478
+ /**
1479
+ * Maximum number of tokens used by including web page text content in the context.
1480
+ * The limit is approximate and does not apply to binary content such as PDFs.
1481
+ */
1482
+ max_content_tokens?: number | null;
1483
+ /**
1484
+ * Maximum number of times the tool can be used in the API request.
1485
+ */
1486
+ max_uses?: number | null;
1487
+ /**
1488
+ * When true, guarantees schema validation on tool names and inputs
1489
+ */
1490
+ strict?: boolean;
1491
+ }
1492
+ export interface WebFetchTool20260209 {
1493
+ /**
1494
+ * Name of the tool.
1495
+ *
1496
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1497
+ */
1498
+ name: 'web_fetch';
1499
+ type: 'web_fetch_20260209';
1500
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1501
+ /**
1502
+ * List of domains to allow fetching from
1503
+ */
1504
+ allowed_domains?: Array<string> | null;
1505
+ /**
1506
+ * List of domains to block fetching from
1507
+ */
1508
+ blocked_domains?: Array<string> | null;
1509
+ /**
1510
+ * Create a cache control breakpoint at this content block.
1511
+ */
1512
+ cache_control?: CacheControlEphemeral | null;
1513
+ /**
1514
+ * Citations configuration for fetched documents. Citations are disabled by
1515
+ * default.
1516
+ */
1517
+ citations?: CitationsConfigParam | null;
1518
+ /**
1519
+ * If true, tool will not be included in initial system prompt. Only loaded when
1520
+ * returned via tool_reference from tool search.
1521
+ */
1522
+ defer_loading?: boolean;
1523
+ /**
1524
+ * Maximum number of tokens used by including web page text content in the context.
1525
+ * The limit is approximate and does not apply to binary content such as PDFs.
1526
+ */
1527
+ max_content_tokens?: number | null;
1528
+ /**
1529
+ * Maximum number of times the tool can be used in the API request.
1530
+ */
1531
+ max_uses?: number | null;
1532
+ /**
1533
+ * When true, guarantees schema validation on tool names and inputs
1534
+ */
1535
+ strict?: boolean;
1536
+ }
1537
+ /**
1538
+ * Web fetch tool with use_cache parameter for bypassing cached content.
1539
+ */
1540
+ export interface WebFetchTool20260309 {
1541
+ /**
1542
+ * Name of the tool.
1543
+ *
1544
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1545
+ */
1546
+ name: 'web_fetch';
1547
+ type: 'web_fetch_20260309';
1548
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1549
+ /**
1550
+ * List of domains to allow fetching from
1551
+ */
1552
+ allowed_domains?: Array<string> | null;
1553
+ /**
1554
+ * List of domains to block fetching from
1555
+ */
1556
+ blocked_domains?: Array<string> | null;
1557
+ /**
1558
+ * Create a cache control breakpoint at this content block.
1559
+ */
1560
+ cache_control?: CacheControlEphemeral | null;
1561
+ /**
1562
+ * Citations configuration for fetched documents. Citations are disabled by
1563
+ * default.
1564
+ */
1565
+ citations?: CitationsConfigParam | null;
1566
+ /**
1567
+ * If true, tool will not be included in initial system prompt. Only loaded when
1568
+ * returned via tool_reference from tool search.
1569
+ */
1570
+ defer_loading?: boolean;
1571
+ /**
1572
+ * Maximum number of tokens used by including web page text content in the context.
1573
+ * The limit is approximate and does not apply to binary content such as PDFs.
1574
+ */
1575
+ max_content_tokens?: number | null;
1576
+ /**
1577
+ * Maximum number of times the tool can be used in the API request.
1578
+ */
1579
+ max_uses?: number | null;
1580
+ /**
1581
+ * When true, guarantees schema validation on tool names and inputs
1582
+ */
1583
+ strict?: boolean;
1584
+ /**
1585
+ * Whether to use cached content. Set to false to bypass the cache and fetch fresh
1586
+ * content. Only set to false when the user explicitly requests fresh content or
1587
+ * when fetching rapidly-changing sources.
1588
+ */
1589
+ use_cache?: boolean;
1590
+ }
1591
+ export interface WebFetchToolResultBlock {
1592
+ /**
1593
+ * Tool invocation directly from the model.
1594
+ */
1595
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
1596
+ content: WebFetchToolResultErrorBlock | WebFetchBlock;
1597
+ tool_use_id: string;
1598
+ type: 'web_fetch_tool_result';
1599
+ }
1600
+ export interface WebFetchToolResultBlockParam {
1601
+ content: WebFetchToolResultErrorBlockParam | WebFetchBlockParam;
1602
+ tool_use_id: string;
1603
+ type: 'web_fetch_tool_result';
1604
+ /**
1605
+ * Create a cache control breakpoint at this content block.
1606
+ */
1607
+ cache_control?: CacheControlEphemeral | null;
1608
+ /**
1609
+ * Tool invocation directly from the model.
1610
+ */
1611
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
1612
+ }
1613
+ export interface WebFetchToolResultErrorBlock {
1614
+ error_code: WebFetchToolResultErrorCode;
1615
+ type: 'web_fetch_tool_result_error';
1616
+ }
1617
+ export interface WebFetchToolResultErrorBlockParam {
1618
+ error_code: WebFetchToolResultErrorCode;
1619
+ type: 'web_fetch_tool_result_error';
1620
+ }
1621
+ export type WebFetchToolResultErrorCode = 'invalid_tool_input' | 'url_too_long' | 'url_not_allowed' | 'url_not_accessible' | 'unsupported_content_type' | 'too_many_requests' | 'max_uses_exceeded' | 'unavailable';
1622
+ export interface WebSearchResultBlock {
1623
+ encrypted_content: string;
1624
+ page_age: string | null;
1625
+ title: string;
1626
+ type: 'web_search_result';
1627
+ url: string;
1628
+ }
1629
+ export interface WebSearchResultBlockParam {
1630
+ encrypted_content: string;
1631
+ title: string;
1632
+ type: 'web_search_result';
1633
+ url: string;
1634
+ page_age?: string | null;
1635
+ }
1636
+ export interface WebSearchTool20250305 {
1637
+ /**
1638
+ * Name of the tool.
1639
+ *
1640
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1641
+ */
1642
+ name: 'web_search';
1643
+ type: 'web_search_20250305';
1644
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1645
+ /**
1646
+ * If provided, only these domains will be included in results. Cannot be used
1647
+ * alongside `blocked_domains`.
1648
+ */
1649
+ allowed_domains?: Array<string> | null;
1650
+ /**
1651
+ * If provided, these domains will never appear in results. Cannot be used
1652
+ * alongside `allowed_domains`.
1653
+ */
1654
+ blocked_domains?: Array<string> | null;
1655
+ /**
1656
+ * Create a cache control breakpoint at this content block.
1657
+ */
1658
+ cache_control?: CacheControlEphemeral | null;
1659
+ /**
1660
+ * If true, tool will not be included in initial system prompt. Only loaded when
1661
+ * returned via tool_reference from tool search.
1662
+ */
1663
+ defer_loading?: boolean;
1664
+ /**
1665
+ * Maximum number of times the tool can be used in the API request.
1666
+ */
1667
+ max_uses?: number | null;
1668
+ /**
1669
+ * When true, guarantees schema validation on tool names and inputs
1670
+ */
1671
+ strict?: boolean;
1672
+ /**
1673
+ * Parameters for the user's location. Used to provide more relevant search
1674
+ * results.
1675
+ */
1676
+ user_location?: UserLocation | null;
1677
+ }
1678
+ export declare namespace WebSearchTool20250305 {
1679
+ /**
1680
+ * @deprecated Import `UserLocation` from `anthropic` directly instead of using
1681
+ * `WebSearchTool20250305.UserLocation`.
1682
+ */
1683
+ type UserLocation = Messages.UserLocation;
1684
+ }
1685
+ export interface WebSearchTool20260209 {
1686
+ /**
1687
+ * Name of the tool.
1688
+ *
1689
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1690
+ */
1691
+ name: 'web_search';
1692
+ type: 'web_search_20260209';
1693
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120'>;
1694
+ /**
1695
+ * If provided, only these domains will be included in results. Cannot be used
1696
+ * alongside `blocked_domains`.
1697
+ */
1698
+ allowed_domains?: Array<string> | null;
1699
+ /**
1700
+ * If provided, these domains will never appear in results. Cannot be used
1701
+ * alongside `allowed_domains`.
1702
+ */
1703
+ blocked_domains?: Array<string> | null;
1704
+ /**
1705
+ * Create a cache control breakpoint at this content block.
1706
+ */
1707
+ cache_control?: CacheControlEphemeral | null;
1708
+ /**
1709
+ * If true, tool will not be included in initial system prompt. Only loaded when
1710
+ * returned via tool_reference from tool search.
1711
+ */
1712
+ defer_loading?: boolean;
1713
+ /**
1714
+ * Maximum number of times the tool can be used in the API request.
1715
+ */
1716
+ max_uses?: number | null;
1717
+ /**
1718
+ * When true, guarantees schema validation on tool names and inputs
1719
+ */
1720
+ strict?: boolean;
1721
+ /**
1722
+ * Parameters for the user's location. Used to provide more relevant search
1723
+ * results.
1724
+ */
1725
+ user_location?: UserLocation | null;
1726
+ }
1727
+ export declare namespace WebSearchTool20260209 {
1728
+ /**
1729
+ * @deprecated Import `UserLocation` from `anthropic` directly instead of using
1730
+ * `WebSearchTool20260209.UserLocation`.
1731
+ */
1732
+ type UserLocation = Messages.UserLocation;
1733
+ }
1734
+ export interface WebSearchToolRequestError {
1735
+ error_code: WebSearchToolResultErrorCode;
1736
+ type: 'web_search_tool_result_error';
1737
+ }
1738
+ export interface WebSearchToolResultBlock {
1739
+ /**
1740
+ * Tool invocation directly from the model.
1741
+ */
1742
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
1743
+ content: WebSearchToolResultBlockContent;
1744
+ tool_use_id: string;
1745
+ type: 'web_search_tool_result';
1746
+ }
1747
+ export type WebSearchToolResultBlockContent = WebSearchToolResultError | Array<WebSearchResultBlock>;
1748
+ export interface WebSearchToolResultBlockParam {
1749
+ content: WebSearchToolResultBlockParamContent;
1750
+ tool_use_id: string;
1751
+ type: 'web_search_tool_result';
1752
+ /**
1753
+ * Create a cache control breakpoint at this content block.
1754
+ */
1755
+ cache_control?: CacheControlEphemeral | null;
1756
+ /**
1757
+ * Tool invocation directly from the model.
1758
+ */
1759
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
1760
+ }
1761
+ export type WebSearchToolResultBlockParamContent = Array<WebSearchResultBlockParam> | WebSearchToolRequestError;
1762
+ export interface WebSearchToolResultError {
1763
+ error_code: WebSearchToolResultErrorCode;
1764
+ type: 'web_search_tool_result_error';
1765
+ }
1766
+ export type WebSearchToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'max_uses_exceeded' | 'too_many_requests' | 'query_too_long' | 'request_too_large';
1767
+ export type MessageStreamEvent = RawMessageStreamEvent;
1768
+ export type MessageStartEvent = RawMessageStartEvent;
1769
+ export type MessageDeltaEvent = RawMessageDeltaEvent;
1770
+ export type MessageStopEvent = RawMessageStopEvent;
1771
+ export type ContentBlockStartEvent = RawContentBlockStartEvent;
1772
+ export type ContentBlockDeltaEvent = RawContentBlockDeltaEvent;
1773
+ export type ContentBlockStopEvent = RawContentBlockStopEvent;
1774
+ export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
1775
+ export interface MessageCreateParamsBase {
1776
+ /**
1777
+ * The maximum number of tokens to generate before stopping.
1778
+ *
1779
+ * Note that our models may stop _before_ reaching this maximum. This parameter
1780
+ * only specifies the absolute maximum number of tokens to generate.
1781
+ *
1782
+ * Different models have different maximum values for this parameter. See
1783
+ * [models](https://docs.claude.com/en/docs/models-overview) for details.
1784
+ */
1785
+ max_tokens: number;
1786
+ /**
1787
+ * Input messages.
1788
+ *
1789
+ * Our models are trained to operate on alternating `user` and `assistant`
1790
+ * conversational turns. When creating a new `Message`, you specify the prior
1791
+ * conversational turns with the `messages` parameter, and the model then generates
1792
+ * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
1793
+ * in your request will be combined into a single turn.
1794
+ *
1795
+ * Each input message must be an object with a `role` and `content`. You can
1796
+ * specify a single `user`-role message, or you can include multiple `user` and
1797
+ * `assistant` messages.
1798
+ *
1799
+ * If the final message uses the `assistant` role, the response content will
1800
+ * continue immediately from the content in that message. This can be used to
1801
+ * constrain part of the model's response.
1802
+ *
1803
+ * Example with a single `user` message:
1804
+ *
1805
+ * ```json
1806
+ * [{ "role": "user", "content": "Hello, Claude" }]
1807
+ * ```
1808
+ *
1809
+ * Example with multiple conversational turns:
1810
+ *
1811
+ * ```json
1812
+ * [
1813
+ * { "role": "user", "content": "Hello there." },
1814
+ * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
1815
+ * { "role": "user", "content": "Can you explain LLMs in plain English?" }
1816
+ * ]
1817
+ * ```
1818
+ *
1819
+ * Example with a partially-filled response from Claude:
1820
+ *
1821
+ * ```json
1822
+ * [
1823
+ * {
1824
+ * "role": "user",
1825
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
1826
+ * },
1827
+ * { "role": "assistant", "content": "The best answer is (" }
1828
+ * ]
1829
+ * ```
1830
+ *
1831
+ * Each input message `content` may be either a single `string` or an array of
1832
+ * content blocks, where each block has a specific `type`. Using a `string` for
1833
+ * `content` is shorthand for an array of one content block of type `"text"`. The
1834
+ * following input messages are equivalent:
1835
+ *
1836
+ * ```json
1837
+ * { "role": "user", "content": "Hello, Claude" }
1838
+ * ```
1839
+ *
1840
+ * ```json
1841
+ * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
1842
+ * ```
1843
+ *
1844
+ * See [input examples](https://docs.claude.com/en/api/messages-examples).
1845
+ *
1846
+ * Note that if you want to include a
1847
+ * [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
1848
+ * top-level `system` parameter — there is no `"system"` role for input messages in
1849
+ * the Messages API.
1850
+ *
1851
+ * There is a limit of 100,000 messages in a single request.
1852
+ */
1853
+ messages: Array<MessageParam>;
1854
+ /**
1855
+ * The model that will complete your prompt.\n\nSee
1856
+ * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
1857
+ * details and options.
1858
+ */
1859
+ model: Model;
1860
+ /**
1861
+ * Top-level cache control automatically applies a cache_control marker to the last
1862
+ * cacheable block in the request.
1863
+ */
1864
+ cache_control?: CacheControlEphemeral | null;
1865
+ /**
1866
+ * Container identifier for reuse across requests.
1867
+ */
1868
+ container?: string | null;
1869
+ /**
1870
+ * Specifies the geographic region for inference processing. If not specified, the
1871
+ * workspace's `default_inference_geo` is used.
1872
+ */
1873
+ inference_geo?: string | null;
1874
+ /**
1875
+ * An object describing metadata about the request.
1876
+ */
1877
+ metadata?: Metadata;
1878
+ /**
1879
+ * Configuration options for the model's output, such as the output format.
1880
+ */
1881
+ output_config?: OutputConfig;
1882
+ /**
1883
+ * Determines whether to use priority capacity (if available) or standard capacity
1884
+ * for this request.
1885
+ *
1886
+ * Anthropic offers different levels of service for your API requests. See
1887
+ * [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
1888
+ */
1889
+ service_tier?: 'auto' | 'standard_only';
1890
+ /**
1891
+ * Custom text sequences that will cause the model to stop generating.
1892
+ *
1893
+ * Our models will normally stop when they have naturally completed their turn,
1894
+ * which will result in a response `stop_reason` of `"end_turn"`.
1895
+ *
1896
+ * If you want the model to stop generating when it encounters custom strings of
1897
+ * text, you can use the `stop_sequences` parameter. If the model encounters one of
1898
+ * the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
1899
+ * and the response `stop_sequence` value will contain the matched stop sequence.
1900
+ */
1901
+ stop_sequences?: Array<string>;
1902
+ /**
1903
+ * Whether to incrementally stream the response using server-sent events.
1904
+ *
1905
+ * See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
1906
+ */
1907
+ stream?: boolean;
1908
+ /**
1909
+ * System prompt.
1910
+ *
1911
+ * A system prompt is a way of providing context and instructions to Claude, such
1912
+ * as specifying a particular goal or role. See our
1913
+ * [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
1914
+ */
1915
+ system?: string | Array<TextBlockParam>;
1916
+ /**
1917
+ * Amount of randomness injected into the response.
1918
+ *
1919
+ * Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
1920
+ * for analytical / multiple choice, and closer to `1.0` for creative and
1921
+ * generative tasks.
1922
+ *
1923
+ * Note that even with `temperature` of `0.0`, the results will not be fully
1924
+ * deterministic.
1925
+ */
1926
+ temperature?: number;
1927
+ /**
1928
+ * Configuration for enabling Claude's extended thinking.
1929
+ *
1930
+ * When enabled, responses include `thinking` content blocks showing Claude's
1931
+ * thinking process before the final answer. Requires a minimum budget of 1,024
1932
+ * tokens and counts towards your `max_tokens` limit.
1933
+ *
1934
+ * See
1935
+ * [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
1936
+ * for details.
1937
+ */
1938
+ thinking?: ThinkingConfigParam;
1939
+ /**
1940
+ * How the model should use the provided tools. The model can use a specific tool,
1941
+ * any available tool, decide by itself, or not use tools at all.
1942
+ */
1943
+ tool_choice?: ToolChoice;
1944
+ /**
1945
+ * Definitions of tools that the model may use.
1946
+ *
1947
+ * If you include `tools` in your API request, the model may return `tool_use`
1948
+ * content blocks that represent the model's use of those tools. You can then run
1949
+ * those tools using the tool input generated by the model and then optionally
1950
+ * return results back to the model using `tool_result` content blocks.
1951
+ *
1952
+ * There are two types of tools: **client tools** and **server tools**. The
1953
+ * behavior described below applies to client tools. For
1954
+ * [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
1955
+ * see their individual documentation as each has its own behavior (e.g., the
1956
+ * [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
1957
+ *
1958
+ * Each tool definition includes:
1959
+ *
1960
+ * - `name`: Name of the tool.
1961
+ * - `description`: Optional, but strongly-recommended description of the tool.
1962
+ * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
1963
+ * tool `input` shape that the model will produce in `tool_use` output content
1964
+ * blocks.
1965
+ *
1966
+ * For example, if you defined `tools` as:
1967
+ *
1968
+ * ```json
1969
+ * [
1970
+ * {
1971
+ * "name": "get_stock_price",
1972
+ * "description": "Get the current stock price for a given ticker symbol.",
1973
+ * "input_schema": {
1974
+ * "type": "object",
1975
+ * "properties": {
1976
+ * "ticker": {
1977
+ * "type": "string",
1978
+ * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
1979
+ * }
1980
+ * },
1981
+ * "required": ["ticker"]
1982
+ * }
1983
+ * }
1984
+ * ]
1985
+ * ```
1986
+ *
1987
+ * And then asked the model "What's the S&P 500 at today?", the model might produce
1988
+ * `tool_use` content blocks in the response like this:
1989
+ *
1990
+ * ```json
1991
+ * [
1992
+ * {
1993
+ * "type": "tool_use",
1994
+ * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
1995
+ * "name": "get_stock_price",
1996
+ * "input": { "ticker": "^GSPC" }
1997
+ * }
1998
+ * ]
1999
+ * ```
2000
+ *
2001
+ * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
2002
+ * input, and return the following back to the model in a subsequent `user`
2003
+ * message:
2004
+ *
2005
+ * ```json
2006
+ * [
2007
+ * {
2008
+ * "type": "tool_result",
2009
+ * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
2010
+ * "content": "259.75 USD"
2011
+ * }
2012
+ * ]
2013
+ * ```
2014
+ *
2015
+ * Tools can be used for workflows that include running client-side tools and
2016
+ * functions, or more generally whenever you want the model to produce a particular
2017
+ * JSON structure of output.
2018
+ *
2019
+ * See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
2020
+ */
2021
+ tools?: Array<ToolUnion>;
2022
+ /**
2023
+ * Only sample from the top K options for each subsequent token.
2024
+ *
2025
+ * Used to remove "long tail" low probability responses.
2026
+ * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
2027
+ *
2028
+ * Recommended for advanced use cases only. You usually only need to use
2029
+ * `temperature`.
2030
+ */
2031
+ top_k?: number;
2032
+ /**
2033
+ * Use nucleus sampling.
2034
+ *
2035
+ * In nucleus sampling, we compute the cumulative distribution over all the options
2036
+ * for each subsequent token in decreasing probability order and cut it off once it
2037
+ * reaches a particular probability specified by `top_p`. You should either alter
2038
+ * `temperature` or `top_p`, but not both.
2039
+ *
2040
+ * Recommended for advanced use cases only. You usually only need to use
2041
+ * `temperature`.
2042
+ */
2043
+ top_p?: number;
2044
+ }
2045
+ export declare namespace MessageCreateParams {
2046
+ type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
2047
+ type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
2048
+ }
2049
+ export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
2050
+ /**
2051
+ * Whether to incrementally stream the response using server-sent events.
2052
+ *
2053
+ * See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
2054
+ */
2055
+ stream?: false;
2056
+ }
2057
+ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
2058
+ /**
2059
+ * Whether to incrementally stream the response using server-sent events.
2060
+ *
2061
+ * See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
2062
+ */
2063
+ stream: true;
2064
+ }
2065
+ export type MessageStreamParams = ParseableMessageCreateParams;
2066
+ export interface MessageCountTokensParams {
2067
+ /**
2068
+ * Input messages.
2069
+ *
2070
+ * Our models are trained to operate on alternating `user` and `assistant`
2071
+ * conversational turns. When creating a new `Message`, you specify the prior
2072
+ * conversational turns with the `messages` parameter, and the model then generates
2073
+ * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
2074
+ * in your request will be combined into a single turn.
2075
+ *
2076
+ * Each input message must be an object with a `role` and `content`. You can
2077
+ * specify a single `user`-role message, or you can include multiple `user` and
2078
+ * `assistant` messages.
2079
+ *
2080
+ * If the final message uses the `assistant` role, the response content will
2081
+ * continue immediately from the content in that message. This can be used to
2082
+ * constrain part of the model's response.
2083
+ *
2084
+ * Example with a single `user` message:
2085
+ *
2086
+ * ```json
2087
+ * [{ "role": "user", "content": "Hello, Claude" }]
2088
+ * ```
2089
+ *
2090
+ * Example with multiple conversational turns:
2091
+ *
2092
+ * ```json
2093
+ * [
2094
+ * { "role": "user", "content": "Hello there." },
2095
+ * { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
2096
+ * { "role": "user", "content": "Can you explain LLMs in plain English?" }
2097
+ * ]
2098
+ * ```
2099
+ *
2100
+ * Example with a partially-filled response from Claude:
2101
+ *
2102
+ * ```json
2103
+ * [
2104
+ * {
2105
+ * "role": "user",
2106
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
2107
+ * },
2108
+ * { "role": "assistant", "content": "The best answer is (" }
2109
+ * ]
2110
+ * ```
2111
+ *
2112
+ * Each input message `content` may be either a single `string` or an array of
2113
+ * content blocks, where each block has a specific `type`. Using a `string` for
2114
+ * `content` is shorthand for an array of one content block of type `"text"`. The
2115
+ * following input messages are equivalent:
2116
+ *
2117
+ * ```json
2118
+ * { "role": "user", "content": "Hello, Claude" }
2119
+ * ```
2120
+ *
2121
+ * ```json
2122
+ * { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
2123
+ * ```
2124
+ *
2125
+ * See [input examples](https://docs.claude.com/en/api/messages-examples).
2126
+ *
2127
+ * Note that if you want to include a
2128
+ * [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
2129
+ * top-level `system` parameter — there is no `"system"` role for input messages in
2130
+ * the Messages API.
2131
+ *
2132
+ * There is a limit of 100,000 messages in a single request.
2133
+ */
2134
+ messages: Array<MessageParam>;
2135
+ /**
2136
+ * The model that will complete your prompt.\n\nSee
2137
+ * [models](https://docs.anthropic.com/en/docs/models-overview) for additional
2138
+ * details and options.
2139
+ */
2140
+ model: Model;
2141
+ /**
2142
+ * Top-level cache control automatically applies a cache_control marker to the last
2143
+ * cacheable block in the request.
2144
+ */
2145
+ cache_control?: CacheControlEphemeral | null;
2146
+ /**
2147
+ * Configuration options for the model's output, such as the output format.
2148
+ */
2149
+ output_config?: OutputConfig;
2150
+ /**
2151
+ * System prompt.
2152
+ *
2153
+ * A system prompt is a way of providing context and instructions to Claude, such
2154
+ * as specifying a particular goal or role. See our
2155
+ * [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
2156
+ */
2157
+ system?: string | Array<TextBlockParam>;
2158
+ /**
2159
+ * Configuration for enabling Claude's extended thinking.
2160
+ *
2161
+ * When enabled, responses include `thinking` content blocks showing Claude's
2162
+ * thinking process before the final answer. Requires a minimum budget of 1,024
2163
+ * tokens and counts towards your `max_tokens` limit.
2164
+ *
2165
+ * See
2166
+ * [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
2167
+ * for details.
2168
+ */
2169
+ thinking?: ThinkingConfigParam;
2170
+ /**
2171
+ * How the model should use the provided tools. The model can use a specific tool,
2172
+ * any available tool, decide by itself, or not use tools at all.
2173
+ */
2174
+ tool_choice?: ToolChoice;
2175
+ /**
2176
+ * Definitions of tools that the model may use.
2177
+ *
2178
+ * If you include `tools` in your API request, the model may return `tool_use`
2179
+ * content blocks that represent the model's use of those tools. You can then run
2180
+ * those tools using the tool input generated by the model and then optionally
2181
+ * return results back to the model using `tool_result` content blocks.
2182
+ *
2183
+ * There are two types of tools: **client tools** and **server tools**. The
2184
+ * behavior described below applies to client tools. For
2185
+ * [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
2186
+ * see their individual documentation as each has its own behavior (e.g., the
2187
+ * [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
2188
+ *
2189
+ * Each tool definition includes:
2190
+ *
2191
+ * - `name`: Name of the tool.
2192
+ * - `description`: Optional, but strongly-recommended description of the tool.
2193
+ * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
2194
+ * tool `input` shape that the model will produce in `tool_use` output content
2195
+ * blocks.
2196
+ *
2197
+ * For example, if you defined `tools` as:
2198
+ *
2199
+ * ```json
2200
+ * [
2201
+ * {
2202
+ * "name": "get_stock_price",
2203
+ * "description": "Get the current stock price for a given ticker symbol.",
2204
+ * "input_schema": {
2205
+ * "type": "object",
2206
+ * "properties": {
2207
+ * "ticker": {
2208
+ * "type": "string",
2209
+ * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
2210
+ * }
2211
+ * },
2212
+ * "required": ["ticker"]
2213
+ * }
2214
+ * }
2215
+ * ]
2216
+ * ```
2217
+ *
2218
+ * And then asked the model "What's the S&P 500 at today?", the model might produce
2219
+ * `tool_use` content blocks in the response like this:
2220
+ *
2221
+ * ```json
2222
+ * [
2223
+ * {
2224
+ * "type": "tool_use",
2225
+ * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
2226
+ * "name": "get_stock_price",
2227
+ * "input": { "ticker": "^GSPC" }
2228
+ * }
2229
+ * ]
2230
+ * ```
2231
+ *
2232
+ * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
2233
+ * input, and return the following back to the model in a subsequent `user`
2234
+ * message:
2235
+ *
2236
+ * ```json
2237
+ * [
2238
+ * {
2239
+ * "type": "tool_result",
2240
+ * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
2241
+ * "content": "259.75 USD"
2242
+ * }
2243
+ * ]
2244
+ * ```
2245
+ *
2246
+ * Tools can be used for workflows that include running client-side tools and
2247
+ * functions, or more generally whenever you want the model to produce a particular
2248
+ * JSON structure of output.
2249
+ *
2250
+ * See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
2251
+ */
2252
+ tools?: Array<MessageCountTokensTool>;
2253
+ }
2254
+ export declare namespace Messages {
2255
+ export { type Base64ImageSource as Base64ImageSource, type Base64PDFSource as Base64PDFSource, type BashCodeExecutionOutputBlock as BashCodeExecutionOutputBlock, type BashCodeExecutionOutputBlockParam as BashCodeExecutionOutputBlockParam, type BashCodeExecutionResultBlock as BashCodeExecutionResultBlock, type BashCodeExecutionResultBlockParam as BashCodeExecutionResultBlockParam, type BashCodeExecutionToolResultBlock as BashCodeExecutionToolResultBlock, type BashCodeExecutionToolResultBlockParam as BashCodeExecutionToolResultBlockParam, type BashCodeExecutionToolResultError as BashCodeExecutionToolResultError, type BashCodeExecutionToolResultErrorCode as BashCodeExecutionToolResultErrorCode, type BashCodeExecutionToolResultErrorParam as BashCodeExecutionToolResultErrorParam, type CacheControlEphemeral as CacheControlEphemeral, type CacheCreation as CacheCreation, 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 CitationSearchResultLocationParam as CitationSearchResultLocationParam, type CitationWebSearchResultLocationParam as CitationWebSearchResultLocationParam, type CitationsConfig as CitationsConfig, type CitationsConfigParam as CitationsConfigParam, type CitationsDelta as CitationsDelta, type CitationsSearchResultLocation as CitationsSearchResultLocation, type CitationsWebSearchResultLocation as CitationsWebSearchResultLocation, type CodeExecutionOutputBlock as CodeExecutionOutputBlock, type CodeExecutionOutputBlockParam as CodeExecutionOutputBlockParam, type CodeExecutionResultBlock as CodeExecutionResultBlock, type CodeExecutionResultBlockParam as CodeExecutionResultBlockParam, type CodeExecutionTool20250522 as CodeExecutionTool20250522, type CodeExecutionTool20250825 as CodeExecutionTool20250825, type CodeExecutionTool20260120 as CodeExecutionTool20260120, type CodeExecutionToolResultBlock as CodeExecutionToolResultBlock, type CodeExecutionToolResultBlockContent as CodeExecutionToolResultBlockContent, type CodeExecutionToolResultBlockParam as CodeExecutionToolResultBlockParam, type CodeExecutionToolResultBlockParamContent as CodeExecutionToolResultBlockParamContent, type CodeExecutionToolResultError as CodeExecutionToolResultError, type CodeExecutionToolResultErrorCode as CodeExecutionToolResultErrorCode, type CodeExecutionToolResultErrorParam as CodeExecutionToolResultErrorParam, type Container as Container, type ContainerUploadBlock as ContainerUploadBlock, type ContainerUploadBlockParam as ContainerUploadBlockParam, type ContentBlock as ContentBlock, type ContentBlockParam as ContentBlockParam, type ContentBlockStartEvent as ContentBlockStartEvent, type ContentBlockStopEvent as ContentBlockStopEvent, type ContentBlockSource as ContentBlockSource, type ContentBlockSourceContent as ContentBlockSourceContent, type DirectCaller as DirectCaller, type DocumentBlock as DocumentBlock, type DocumentBlockParam as DocumentBlockParam, type EncryptedCodeExecutionResultBlock as EncryptedCodeExecutionResultBlock, type EncryptedCodeExecutionResultBlockParam as EncryptedCodeExecutionResultBlockParam, type ImageBlockParam as ImageBlockParam, type InputJSONDelta as InputJSONDelta, type JSONOutputFormat as JSONOutputFormat, type MemoryTool20250818 as MemoryTool20250818, type Message as Message, type MessageCountTokensTool as MessageCountTokensTool, type MessageDeltaEvent as MessageDeltaEvent, type MessageDeltaUsage as MessageDeltaUsage, type MessageParam as MessageParam, type MessageTokensCount as MessageTokensCount, type Metadata as Metadata, type Model as Model, type OutputConfig as OutputConfig, type PlainTextSource as PlainTextSource, type RawContentBlockDelta as RawContentBlockDelta, 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 SearchResultBlockParam as SearchResultBlockParam, type ServerToolCaller as ServerToolCaller, type ServerToolCaller20260120 as ServerToolCaller20260120, type ServerToolUsage as ServerToolUsage, type ServerToolUseBlock as ServerToolUseBlock, type ServerToolUseBlockParam as ServerToolUseBlockParam, type SignatureDelta as SignatureDelta, type StopReason as StopReason, type TextBlock as TextBlock, type TextBlockParam as TextBlockParam, type TextCitation as TextCitation, type TextCitationParam as TextCitationParam, type TextDelta as TextDelta, type TextEditorCodeExecutionCreateResultBlock as TextEditorCodeExecutionCreateResultBlock, type TextEditorCodeExecutionCreateResultBlockParam as TextEditorCodeExecutionCreateResultBlockParam, type TextEditorCodeExecutionStrReplaceResultBlock as TextEditorCodeExecutionStrReplaceResultBlock, type TextEditorCodeExecutionStrReplaceResultBlockParam as TextEditorCodeExecutionStrReplaceResultBlockParam, type TextEditorCodeExecutionToolResultBlock as TextEditorCodeExecutionToolResultBlock, type TextEditorCodeExecutionToolResultBlockParam as TextEditorCodeExecutionToolResultBlockParam, type TextEditorCodeExecutionToolResultError as TextEditorCodeExecutionToolResultError, type TextEditorCodeExecutionToolResultErrorCode as TextEditorCodeExecutionToolResultErrorCode, type TextEditorCodeExecutionToolResultErrorParam as TextEditorCodeExecutionToolResultErrorParam, type TextEditorCodeExecutionViewResultBlock as TextEditorCodeExecutionViewResultBlock, type TextEditorCodeExecutionViewResultBlockParam as TextEditorCodeExecutionViewResultBlockParam, type ThinkingBlock as ThinkingBlock, type ThinkingBlockParam as ThinkingBlockParam, type ThinkingConfigAdaptive as ThinkingConfigAdaptive, 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 ToolChoiceNone as ToolChoiceNone, type ToolChoiceTool as ToolChoiceTool, type ToolReferenceBlock as ToolReferenceBlock, type ToolReferenceBlockParam as ToolReferenceBlockParam, type ToolResultBlockParam as ToolResultBlockParam, type ToolSearchToolBm25_20251119 as ToolSearchToolBm25_20251119, type ToolSearchToolRegex20251119 as ToolSearchToolRegex20251119, type ToolSearchToolResultBlock as ToolSearchToolResultBlock, type ToolSearchToolResultBlockParam as ToolSearchToolResultBlockParam, type ToolSearchToolResultError as ToolSearchToolResultError, type ToolSearchToolResultErrorCode as ToolSearchToolResultErrorCode, type ToolSearchToolResultErrorParam as ToolSearchToolResultErrorParam, type ToolSearchToolSearchResultBlock as ToolSearchToolSearchResultBlock, type ToolSearchToolSearchResultBlockParam as ToolSearchToolSearchResultBlockParam, type ToolTextEditor20250124 as ToolTextEditor20250124, type ToolTextEditor20250429 as ToolTextEditor20250429, type ToolTextEditor20250728 as ToolTextEditor20250728, type ToolUnion as ToolUnion, type ToolUseBlock as ToolUseBlock, type ToolUseBlockParam as ToolUseBlockParam, type URLImageSource as URLImageSource, type URLPDFSource as URLPDFSource, type Usage as Usage, type UserLocation as UserLocation, type WebFetchBlock as WebFetchBlock, type WebFetchBlockParam as WebFetchBlockParam, type WebFetchTool20250910 as WebFetchTool20250910, type WebFetchTool20260209 as WebFetchTool20260209, type WebFetchTool20260309 as WebFetchTool20260309, type WebFetchToolResultBlock as WebFetchToolResultBlock, type WebFetchToolResultBlockParam as WebFetchToolResultBlockParam, type WebFetchToolResultErrorBlock as WebFetchToolResultErrorBlock, type WebFetchToolResultErrorBlockParam as WebFetchToolResultErrorBlockParam, type WebFetchToolResultErrorCode as WebFetchToolResultErrorCode, type WebSearchResultBlock as WebSearchResultBlock, type WebSearchResultBlockParam as WebSearchResultBlockParam, type WebSearchTool20250305 as WebSearchTool20250305, type WebSearchTool20260209 as WebSearchTool20260209, type WebSearchToolRequestError as WebSearchToolRequestError, type WebSearchToolResultBlock as WebSearchToolResultBlock, type WebSearchToolResultBlockContent as WebSearchToolResultBlockContent, type WebSearchToolResultBlockParam as WebSearchToolResultBlockParam, type WebSearchToolResultBlockParamContent as WebSearchToolResultBlockParamContent, type WebSearchToolResultError as WebSearchToolResultError, type MessageStreamEvent as MessageStreamEvent, type MessageStartEvent as MessageStartEvent, type MessageStopEvent as MessageStopEvent, type ContentBlockDeltaEvent as ContentBlockDeltaEvent, type MessageCreateParams as MessageCreateParams, type MessageCreateParamsNonStreaming as MessageCreateParamsNonStreaming, type MessageCreateParamsStreaming as MessageCreateParamsStreaming, type MessageStreamParams as MessageStreamParams, type MessageCountTokensParams as MessageCountTokensParams, };
2256
+ 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, type MessageBatchesPage as MessageBatchesPage, type BatchCreateParams as BatchCreateParams, type BatchListParams as BatchListParams, };
2257
+ }
2258
+ //# sourceMappingURL=messages.d.ts.map