@puku-ai/sdk 4.0.1 → 4.0.2

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 (582) hide show
  1. package/dist/index.d.ts +26 -0
  2. package/dist/index.js +32 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts +2 -0
  5. package/dist/vendor/_vendor/partial-json-parser/parser.js +223 -0
  6. package/dist/vendor/_vendor/partial-json-parser/parser.js.map +1 -0
  7. package/dist/vendor/api-promise.d.ts +2 -0
  8. package/dist/vendor/api-promise.js +3 -0
  9. package/dist/vendor/api-promise.js.map +1 -0
  10. package/dist/vendor/client.d.ts +399 -0
  11. package/dist/vendor/client.js +976 -0
  12. package/dist/vendor/client.js.map +1 -0
  13. package/dist/vendor/core/api-promise.d.ts +49 -0
  14. package/dist/vendor/core/api-promise.js +77 -0
  15. package/dist/vendor/core/api-promise.js.map +1 -0
  16. package/dist/vendor/core/api.d.ts +10 -0
  17. package/dist/vendor/core/api.js +2 -0
  18. package/dist/vendor/core/api.js.map +1 -0
  19. package/dist/vendor/core/credentials.d.ts +130 -0
  20. package/dist/vendor/core/credentials.js +274 -0
  21. package/dist/vendor/core/credentials.js.map +1 -0
  22. package/dist/vendor/core/error.d.ts +82 -0
  23. package/dist/vendor/core/error.js +140 -0
  24. package/dist/vendor/core/error.js.map +1 -0
  25. package/dist/vendor/core/middleware.d.ts +153 -0
  26. package/dist/vendor/core/middleware.js +168 -0
  27. package/dist/vendor/core/middleware.js.map +1 -0
  28. package/dist/vendor/core/pagination.d.ts +121 -0
  29. package/dist/vendor/core/pagination.js +207 -0
  30. package/dist/vendor/core/pagination.js.map +1 -0
  31. package/dist/vendor/core/resource.d.ts +5 -0
  32. package/dist/vendor/core/resource.js +8 -0
  33. package/dist/vendor/core/resource.js.map +1 -0
  34. package/dist/vendor/core/streaming.d.ts +41 -0
  35. package/dist/vendor/core/streaming.js +342 -0
  36. package/dist/vendor/core/streaming.js.map +1 -0
  37. package/dist/vendor/core/uploads.d.ts +2 -0
  38. package/dist/vendor/core/uploads.js +2 -0
  39. package/dist/vendor/core/uploads.js.map +1 -0
  40. package/dist/vendor/error.d.ts +2 -0
  41. package/dist/vendor/error.js +3 -0
  42. package/dist/vendor/error.js.map +1 -0
  43. package/dist/vendor/helpers/beta/environments.d.ts +22 -0
  44. package/dist/vendor/helpers/beta/environments.js +23 -0
  45. package/dist/vendor/helpers/beta/environments.js.map +1 -0
  46. package/dist/vendor/helpers/beta/json-schema.d.ts +36 -0
  47. package/dist/vendor/helpers/beta/json-schema.js +53 -0
  48. package/dist/vendor/helpers/beta/json-schema.js.map +1 -0
  49. package/dist/vendor/helpers/beta/mcp.d.ts +302 -0
  50. package/dist/vendor/helpers/beta/mcp.js +406 -0
  51. package/dist/vendor/helpers/beta/mcp.js.map +1 -0
  52. package/dist/vendor/helpers/beta/memory.d.ts +10 -0
  53. package/dist/vendor/helpers/beta/memory.js +15 -0
  54. package/dist/vendor/helpers/beta/memory.js.map +1 -0
  55. package/dist/vendor/helpers/beta/standard-schema.d.ts +44 -0
  56. package/dist/vendor/helpers/beta/standard-schema.js +54 -0
  57. package/dist/vendor/helpers/beta/standard-schema.js.map +1 -0
  58. package/dist/vendor/helpers/beta/zod.d.ts +32 -0
  59. package/dist/vendor/helpers/beta/zod.js +52 -0
  60. package/dist/vendor/helpers/beta/zod.js.map +1 -0
  61. package/dist/vendor/helpers/index.d.ts +2 -0
  62. package/dist/vendor/helpers/index.js +3 -0
  63. package/dist/vendor/helpers/index.js.map +1 -0
  64. package/dist/vendor/helpers/json-schema.d.ts +17 -0
  65. package/dist/vendor/helpers/json-schema.js +34 -0
  66. package/dist/vendor/helpers/json-schema.js.map +1 -0
  67. package/dist/vendor/helpers/zod.d.ts +12 -0
  68. package/dist/vendor/helpers/zod.js +42 -0
  69. package/dist/vendor/helpers/zod.js.map +1 -0
  70. package/dist/vendor/index.d.ts +16 -0
  71. package/dist/vendor/index.js +23 -0
  72. package/dist/vendor/index.js.map +1 -0
  73. package/dist/vendor/internal/builtin-types.d.ts +72 -0
  74. package/dist/vendor/internal/builtin-types.js +3 -0
  75. package/dist/vendor/internal/builtin-types.js.map +1 -0
  76. package/dist/vendor/internal/constants.d.ts +4 -0
  77. package/dist/vendor/internal/constants.js +10 -0
  78. package/dist/vendor/internal/constants.js.map +1 -0
  79. package/dist/vendor/internal/decoders/jsonl.d.ts +9 -0
  80. package/dist/vendor/internal/decoders/jsonl.js +37 -0
  81. package/dist/vendor/internal/decoders/jsonl.js.map +1 -0
  82. package/dist/vendor/internal/decoders/line.d.ts +16 -0
  83. package/dist/vendor/internal/decoders/line.js +105 -0
  84. package/dist/vendor/internal/decoders/line.js.map +1 -0
  85. package/dist/vendor/internal/detect-platform.d.ts +14 -0
  86. package/dist/vendor/internal/detect-platform.js +155 -0
  87. package/dist/vendor/internal/detect-platform.js.map +1 -0
  88. package/dist/vendor/internal/errors.d.ts +2 -0
  89. package/dist/vendor/internal/errors.js +38 -0
  90. package/dist/vendor/internal/errors.js.map +1 -0
  91. package/dist/vendor/internal/file-store.d.ts +135 -0
  92. package/dist/vendor/internal/file-store.js +529 -0
  93. package/dist/vendor/internal/file-store.js.map +1 -0
  94. package/dist/vendor/internal/headers.d.ts +28 -0
  95. package/dist/vendor/internal/headers.js +114 -0
  96. package/dist/vendor/internal/headers.js.map +1 -0
  97. package/dist/vendor/internal/message-stream-utils.d.ts +9 -0
  98. package/dist/vendor/internal/message-stream-utils.js +30 -0
  99. package/dist/vendor/internal/message-stream-utils.js.map +1 -0
  100. package/dist/vendor/internal/node.browser.d.ts +8 -0
  101. package/dist/vendor/internal/node.browser.js +19 -0
  102. package/dist/vendor/internal/node.browser.js.map +1 -0
  103. package/dist/vendor/internal/node.d.ts +13 -0
  104. package/dist/vendor/internal/node.js +14 -0
  105. package/dist/vendor/internal/node.js.map +1 -0
  106. package/dist/vendor/internal/parse.d.ts +17 -0
  107. package/dist/vendor/internal/parse.js +62 -0
  108. package/dist/vendor/internal/parse.js.map +1 -0
  109. package/dist/vendor/internal/qs/formats.d.ts +6 -0
  110. package/dist/vendor/internal/qs/formats.js +9 -0
  111. package/dist/vendor/internal/qs/formats.js.map +1 -0
  112. package/dist/vendor/internal/qs/index.d.ts +9 -0
  113. package/dist/vendor/internal/qs/index.js +10 -0
  114. package/dist/vendor/internal/qs/index.js.map +1 -0
  115. package/dist/vendor/internal/qs/stringify.d.ts +2 -0
  116. package/dist/vendor/internal/qs/stringify.js +274 -0
  117. package/dist/vendor/internal/qs/stringify.js.map +1 -0
  118. package/dist/vendor/internal/qs/types.d.ts +56 -0
  119. package/dist/vendor/internal/qs/types.js +2 -0
  120. package/dist/vendor/internal/qs/types.js.map +1 -0
  121. package/dist/vendor/internal/qs/utils.d.ts +14 -0
  122. package/dist/vendor/internal/qs/utils.js +217 -0
  123. package/dist/vendor/internal/qs/utils.js.map +1 -0
  124. package/dist/vendor/internal/request-options.d.ts +126 -0
  125. package/dist/vendor/internal/request-options.js +27 -0
  126. package/dist/vendor/internal/request-options.js.map +1 -0
  127. package/dist/vendor/internal/request-signal.d.ts +3 -0
  128. package/dist/vendor/internal/request-signal.js +45 -0
  129. package/dist/vendor/internal/request-signal.js.map +1 -0
  130. package/dist/vendor/internal/shim-types.d.ts +16 -0
  131. package/dist/vendor/internal/shim-types.js +3 -0
  132. package/dist/vendor/internal/shim-types.js.map +1 -0
  133. package/dist/vendor/internal/shims.d.ts +25 -0
  134. package/dist/vendor/internal/shims.js +85 -0
  135. package/dist/vendor/internal/shims.js.map +1 -0
  136. package/dist/vendor/internal/stainless-helper-header.d.ts +59 -0
  137. package/dist/vendor/internal/stainless-helper-header.js +83 -0
  138. package/dist/vendor/internal/stainless-helper-header.js.map +1 -0
  139. package/dist/vendor/internal/stream-utils.d.ts +7 -0
  140. package/dist/vendor/internal/stream-utils.js +35 -0
  141. package/dist/vendor/internal/stream-utils.js.map +1 -0
  142. package/dist/vendor/internal/to-file.d.ts +44 -0
  143. package/dist/vendor/internal/to-file.js +93 -0
  144. package/dist/vendor/internal/to-file.js.map +1 -0
  145. package/dist/vendor/internal/types.d.ts +62 -0
  146. package/dist/vendor/internal/types.js +3 -0
  147. package/dist/vendor/internal/types.js.map +1 -0
  148. package/dist/vendor/internal/uploads.d.ts +41 -0
  149. package/dist/vendor/internal/uploads.js +139 -0
  150. package/dist/vendor/internal/uploads.js.map +1 -0
  151. package/dist/vendor/internal/utils/abort.d.ts +11 -0
  152. package/dist/vendor/internal/utils/abort.js +22 -0
  153. package/dist/vendor/internal/utils/abort.js.map +1 -0
  154. package/dist/vendor/internal/utils/async-queue.d.ts +30 -0
  155. package/dist/vendor/internal/utils/async-queue.js +66 -0
  156. package/dist/vendor/internal/utils/async-queue.js.map +1 -0
  157. package/dist/vendor/internal/utils/backoff.d.ts +22 -0
  158. package/dist/vendor/internal/utils/backoff.js +36 -0
  159. package/dist/vendor/internal/utils/backoff.js.map +1 -0
  160. package/dist/vendor/internal/utils/base64.d.ts +2 -0
  161. package/dist/vendor/internal/utils/base64.js +33 -0
  162. package/dist/vendor/internal/utils/base64.js.map +1 -0
  163. package/dist/vendor/internal/utils/bytes.d.ts +3 -0
  164. package/dist/vendor/internal/utils/bytes.js +26 -0
  165. package/dist/vendor/internal/utils/bytes.js.map +1 -0
  166. package/dist/vendor/internal/utils/env.d.ts +8 -0
  167. package/dist/vendor/internal/utils/env.js +18 -0
  168. package/dist/vendor/internal/utils/env.js.map +1 -0
  169. package/dist/vendor/internal/utils/log.d.ts +46 -0
  170. package/dist/vendor/internal/utils/log.js +105 -0
  171. package/dist/vendor/internal/utils/log.js.map +1 -0
  172. package/dist/vendor/internal/utils/path.d.ts +14 -0
  173. package/dist/vendor/internal/utils/path.js +74 -0
  174. package/dist/vendor/internal/utils/path.js.map +1 -0
  175. package/dist/vendor/internal/utils/promise.d.ts +10 -0
  176. package/dist/vendor/internal/utils/promise.js +15 -0
  177. package/dist/vendor/internal/utils/promise.js.map +1 -0
  178. package/dist/vendor/internal/utils/query.d.ts +1 -0
  179. package/dist/vendor/internal/utils/query.js +6 -0
  180. package/dist/vendor/internal/utils/query.js.map +1 -0
  181. package/dist/vendor/internal/utils/sleep.d.ts +9 -0
  182. package/dist/vendor/internal/utils/sleep.js +24 -0
  183. package/dist/vendor/internal/utils/sleep.js.map +1 -0
  184. package/dist/vendor/internal/utils/time.d.ts +2 -0
  185. package/dist/vendor/internal/utils/time.js +5 -0
  186. package/dist/vendor/internal/utils/time.js.map +1 -0
  187. package/dist/vendor/internal/utils/uuid.d.ts +4 -0
  188. package/dist/vendor/internal/utils/uuid.js +15 -0
  189. package/dist/vendor/internal/utils/uuid.js.map +1 -0
  190. package/dist/vendor/internal/utils/values.d.ts +24 -0
  191. package/dist/vendor/internal/utils/values.js +106 -0
  192. package/dist/vendor/internal/utils/values.js.map +1 -0
  193. package/dist/vendor/internal/utils.d.ts +7 -0
  194. package/dist/vendor/internal/utils.js +9 -0
  195. package/dist/vendor/internal/utils.js.map +1 -0
  196. package/dist/vendor/lib/BetaMessageStream.d.ts +123 -0
  197. package/dist/vendor/lib/BetaMessageStream.js +662 -0
  198. package/dist/vendor/lib/BetaMessageStream.js.map +1 -0
  199. package/dist/vendor/lib/MessageStream.d.ts +122 -0
  200. package/dist/vendor/lib/MessageStream.js +609 -0
  201. package/dist/vendor/lib/MessageStream.js.map +1 -0
  202. package/dist/vendor/lib/beta-parser.d.ts +36 -0
  203. package/dist/vendor/lib/beta-parser.js +75 -0
  204. package/dist/vendor/lib/beta-parser.js.map +1 -0
  205. package/dist/vendor/lib/credentials/credential-chain.d.ts +38 -0
  206. package/dist/vendor/lib/credentials/credential-chain.js +208 -0
  207. package/dist/vendor/lib/credentials/credential-chain.js.map +1 -0
  208. package/dist/vendor/lib/credentials/identity-token.d.ts +10 -0
  209. package/dist/vendor/lib/credentials/identity-token.js +35 -0
  210. package/dist/vendor/lib/credentials/identity-token.js.map +1 -0
  211. package/dist/vendor/lib/credentials/oidc-federation.d.ts +39 -0
  212. package/dist/vendor/lib/credentials/oidc-federation.js +79 -0
  213. package/dist/vendor/lib/credentials/oidc-federation.js.map +1 -0
  214. package/dist/vendor/lib/credentials/token-cache.d.ts +53 -0
  215. package/dist/vendor/lib/credentials/token-cache.js +110 -0
  216. package/dist/vendor/lib/credentials/token-cache.js.map +1 -0
  217. package/dist/vendor/lib/credentials/types.d.ts +95 -0
  218. package/dist/vendor/lib/credentials/types.js +226 -0
  219. package/dist/vendor/lib/credentials/types.js.map +1 -0
  220. package/dist/vendor/lib/credentials/user-oauth.d.ts +20 -0
  221. package/dist/vendor/lib/credentials/user-oauth.js +94 -0
  222. package/dist/vendor/lib/credentials/user-oauth.js.map +1 -0
  223. package/dist/vendor/lib/credentials.d.ts +3 -0
  224. package/dist/vendor/lib/credentials.js +3 -0
  225. package/dist/vendor/lib/credentials.js.map +1 -0
  226. package/dist/vendor/lib/environments/index.d.ts +3 -0
  227. package/dist/vendor/lib/environments/index.js +4 -0
  228. package/dist/vendor/lib/environments/index.js.map +1 -0
  229. package/dist/vendor/lib/environments/poller.d.ts +94 -0
  230. package/dist/vendor/lib/environments/poller.js +218 -0
  231. package/dist/vendor/lib/environments/poller.js.map +1 -0
  232. package/dist/vendor/lib/environments/worker.d.ts +226 -0
  233. package/dist/vendor/lib/environments/worker.js +572 -0
  234. package/dist/vendor/lib/environments/worker.js.map +1 -0
  235. package/dist/vendor/lib/helper-client.d.ts +30 -0
  236. package/dist/vendor/lib/helper-client.js +55 -0
  237. package/dist/vendor/lib/helper-client.js.map +1 -0
  238. package/dist/vendor/lib/middleware.d.ts +97 -0
  239. package/dist/vendor/lib/middleware.js +775 -0
  240. package/dist/vendor/lib/middleware.js.map +1 -0
  241. package/dist/vendor/lib/parser.d.ts +31 -0
  242. package/dist/vendor/lib/parser.js +62 -0
  243. package/dist/vendor/lib/parser.js.map +1 -0
  244. package/dist/vendor/lib/sessions/accumulate.d.ts +22 -0
  245. package/dist/vendor/lib/sessions/accumulate.js +42 -0
  246. package/dist/vendor/lib/sessions/accumulate.js.map +1 -0
  247. package/dist/vendor/lib/standard-schema.d.ts +130 -0
  248. package/dist/vendor/lib/standard-schema.js +41 -0
  249. package/dist/vendor/lib/standard-schema.js.map +1 -0
  250. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts +48 -0
  251. package/dist/vendor/lib/tools/BetaRunnableTool.js +26 -0
  252. package/dist/vendor/lib/tools/BetaRunnableTool.js.map +1 -0
  253. package/dist/vendor/lib/tools/BetaToolRunner.d.ts +160 -0
  254. package/dist/vendor/lib/tools/BetaToolRunner.js +497 -0
  255. package/dist/vendor/lib/tools/BetaToolRunner.js.map +1 -0
  256. package/dist/vendor/lib/tools/CompactionControl.d.ts +29 -0
  257. package/dist/vendor/lib/tools/CompactionControl.js +25 -0
  258. package/dist/vendor/lib/tools/CompactionControl.js.map +1 -0
  259. package/dist/vendor/lib/tools/SessionToolRunner.d.ts +178 -0
  260. package/dist/vendor/lib/tools/SessionToolRunner.js +737 -0
  261. package/dist/vendor/lib/tools/SessionToolRunner.js.map +1 -0
  262. package/dist/vendor/lib/tools/ToolError.d.ts +32 -0
  263. package/dist/vendor/lib/tools/ToolError.js +43 -0
  264. package/dist/vendor/lib/tools/ToolError.js.map +1 -0
  265. package/dist/vendor/lib/transform-json-schema.d.ts +2 -0
  266. package/dist/vendor/lib/transform-json-schema.js +111 -0
  267. package/dist/vendor/lib/transform-json-schema.js.map +1 -0
  268. package/dist/vendor/pagination.d.ts +2 -0
  269. package/dist/vendor/pagination.js +3 -0
  270. package/dist/vendor/pagination.js.map +1 -0
  271. package/dist/vendor/resource.d.ts +2 -0
  272. package/dist/vendor/resource.js +3 -0
  273. package/dist/vendor/resource.js.map +1 -0
  274. package/dist/vendor/resources/beta/agents/agents.d.ts +1128 -0
  275. package/dist/vendor/resources/beta/agents/agents.js +123 -0
  276. package/dist/vendor/resources/beta/agents/agents.js.map +1 -0
  277. package/dist/vendor/resources/beta/agents/index.d.ts +2 -0
  278. package/dist/vendor/resources/beta/agents/index.js +4 -0
  279. package/dist/vendor/resources/beta/agents/index.js.map +1 -0
  280. package/dist/vendor/resources/beta/agents/versions.d.ts +32 -0
  281. package/dist/vendor/resources/beta/agents/versions.js +32 -0
  282. package/dist/vendor/resources/beta/agents/versions.js.map +1 -0
  283. package/dist/vendor/resources/beta/agents.d.ts +1 -0
  284. package/dist/vendor/resources/beta/agents.js +3 -0
  285. package/dist/vendor/resources/beta/agents.js.map +1 -0
  286. package/dist/vendor/resources/beta/beta.d.ts +131 -0
  287. package/dist/vendor/resources/beta/beta.js +69 -0
  288. package/dist/vendor/resources/beta/beta.js.map +1 -0
  289. package/dist/vendor/resources/beta/deployment-runs.d.ts +305 -0
  290. package/dist/vendor/resources/beta/deployment-runs.js +51 -0
  291. package/dist/vendor/resources/beta/deployment-runs.js.map +1 -0
  292. package/dist/vendor/resources/beta/deployments.d.ts +698 -0
  293. package/dist/vendor/resources/beta/deployments.js +192 -0
  294. package/dist/vendor/resources/beta/deployments.js.map +1 -0
  295. package/dist/vendor/resources/beta/dreams.d.ts +335 -0
  296. package/dist/vendor/resources/beta/dreams.js +112 -0
  297. package/dist/vendor/resources/beta/dreams.js.map +1 -0
  298. package/dist/vendor/resources/beta/environments/environments.d.ts +432 -0
  299. package/dist/vendor/resources/beta/environments/environments.js +142 -0
  300. package/dist/vendor/resources/beta/environments/environments.js.map +1 -0
  301. package/dist/vendor/resources/beta/environments/index.d.ts +2 -0
  302. package/dist/vendor/resources/beta/environments/index.js +4 -0
  303. package/dist/vendor/resources/beta/environments/index.js.map +1 -0
  304. package/dist/vendor/resources/beta/environments/work.d.ts +500 -0
  305. package/dist/vendor/resources/beta/environments/work.js +251 -0
  306. package/dist/vendor/resources/beta/environments/work.js.map +1 -0
  307. package/dist/vendor/resources/beta/environments.d.ts +1 -0
  308. package/dist/vendor/resources/beta/environments.js +3 -0
  309. package/dist/vendor/resources/beta/environments.js.map +1 -0
  310. package/dist/vendor/resources/beta/files.d.ts +190 -0
  311. package/dist/vendor/resources/beta/files.js +120 -0
  312. package/dist/vendor/resources/beta/files.js.map +1 -0
  313. package/dist/vendor/resources/beta/index.d.ts +17 -0
  314. package/dist/vendor/resources/beta/index.js +19 -0
  315. package/dist/vendor/resources/beta/index.js.map +1 -0
  316. package/dist/vendor/resources/beta/memory-stores/index.d.ts +3 -0
  317. package/dist/vendor/resources/beta/memory-stores/index.js +5 -0
  318. package/dist/vendor/resources/beta/memory-stores/index.js.map +1 -0
  319. package/dist/vendor/resources/beta/memory-stores/memories.d.ts +346 -0
  320. package/dist/vendor/resources/beta/memory-stores/memories.js +126 -0
  321. package/dist/vendor/resources/beta/memory-stores/memories.js.map +1 -0
  322. package/dist/vendor/resources/beta/memory-stores/memory-stores.d.ts +230 -0
  323. package/dist/vendor/resources/beta/memory-stores/memory-stores.js +137 -0
  324. package/dist/vendor/resources/beta/memory-stores/memory-stores.js.map +1 -0
  325. package/dist/vendor/resources/beta/memory-stores/memory-versions.d.ts +252 -0
  326. package/dist/vendor/resources/beta/memory-stores/memory-versions.js +77 -0
  327. package/dist/vendor/resources/beta/memory-stores/memory-versions.js.map +1 -0
  328. package/dist/vendor/resources/beta/memory-stores.d.ts +1 -0
  329. package/dist/vendor/resources/beta/memory-stores.js +3 -0
  330. package/dist/vendor/resources/beta/memory-stores.js.map +1 -0
  331. package/dist/vendor/resources/beta/messages/batches.d.ts +685 -0
  332. package/dist/vendor/resources/beta/messages/batches.js +203 -0
  333. package/dist/vendor/resources/beta/messages/batches.js.map +1 -0
  334. package/dist/vendor/resources/beta/messages/index.d.ts +3 -0
  335. package/dist/vendor/resources/beta/messages/index.js +5 -0
  336. package/dist/vendor/resources/beta/messages/index.js.map +1 -0
  337. package/dist/vendor/resources/beta/messages/messages.d.ts +5376 -0
  338. package/dist/vendor/resources/beta/messages/messages.js +158 -0
  339. package/dist/vendor/resources/beta/messages/messages.js.map +1 -0
  340. package/dist/vendor/resources/beta/messages.d.ts +1 -0
  341. package/dist/vendor/resources/beta/messages.js +3 -0
  342. package/dist/vendor/resources/beta/messages.js.map +1 -0
  343. package/dist/vendor/resources/beta/models.d.ts +217 -0
  344. package/dist/vendor/resources/beta/models.js +56 -0
  345. package/dist/vendor/resources/beta/models.js.map +1 -0
  346. package/dist/vendor/resources/beta/organization/api-keys.d.ts +176 -0
  347. package/dist/vendor/resources/beta/organization/api-keys.js +52 -0
  348. package/dist/vendor/resources/beta/organization/api-keys.js.map +1 -0
  349. package/dist/vendor/resources/beta/organization/compliance-settings.d.ts +73 -0
  350. package/dist/vendor/resources/beta/organization/compliance-settings.js +48 -0
  351. package/dist/vendor/resources/beta/organization/compliance-settings.js.map +1 -0
  352. package/dist/vendor/resources/beta/organization/external-keys.d.ts +271 -0
  353. package/dist/vendor/resources/beta/organization/external-keys.js +115 -0
  354. package/dist/vendor/resources/beta/organization/external-keys.js.map +1 -0
  355. package/dist/vendor/resources/beta/organization/federation/federation.d.ts +13 -0
  356. package/dist/vendor/resources/beta/organization/federation/federation.js +13 -0
  357. package/dist/vendor/resources/beta/organization/federation/federation.js.map +1 -0
  358. package/dist/vendor/resources/beta/organization/federation/index.d.ts +3 -0
  359. package/dist/vendor/resources/beta/organization/federation/index.js +5 -0
  360. package/dist/vendor/resources/beta/organization/federation/index.js.map +1 -0
  361. package/dist/vendor/resources/beta/organization/federation/issuers.d.ts +352 -0
  362. package/dist/vendor/resources/beta/organization/federation/issuers.js +165 -0
  363. package/dist/vendor/resources/beta/organization/federation/issuers.js.map +1 -0
  364. package/dist/vendor/resources/beta/organization/federation/rules/index.d.ts +2 -0
  365. package/dist/vendor/resources/beta/organization/federation/rules/index.js +4 -0
  366. package/dist/vendor/resources/beta/organization/federation/rules/index.js.map +1 -0
  367. package/dist/vendor/resources/beta/organization/federation/rules/rules.d.ts +467 -0
  368. package/dist/vendor/resources/beta/organization/federation/rules/rules.js +190 -0
  369. package/dist/vendor/resources/beta/organization/federation/rules/rules.js.map +1 -0
  370. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.d.ts +123 -0
  371. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js +110 -0
  372. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
  373. package/dist/vendor/resources/beta/organization/federation/rules.d.ts +1 -0
  374. package/dist/vendor/resources/beta/organization/federation/rules.js +3 -0
  375. package/dist/vendor/resources/beta/organization/federation/rules.js.map +1 -0
  376. package/dist/vendor/resources/beta/organization/federation.d.ts +1 -0
  377. package/dist/vendor/resources/beta/organization/federation.js +3 -0
  378. package/dist/vendor/resources/beta/organization/federation.js.map +1 -0
  379. package/dist/vendor/resources/beta/organization/index.d.ts +10 -0
  380. package/dist/vendor/resources/beta/organization/index.js +12 -0
  381. package/dist/vendor/resources/beta/organization/index.js.map +1 -0
  382. package/dist/vendor/resources/beta/organization/invites.d.ts +161 -0
  383. package/dist/vendor/resources/beta/organization/invites.js +72 -0
  384. package/dist/vendor/resources/beta/organization/invites.js.map +1 -0
  385. package/dist/vendor/resources/beta/organization/organization.d.ts +72 -0
  386. package/dist/vendor/resources/beta/organization/organization.js +54 -0
  387. package/dist/vendor/resources/beta/organization/organization.js.map +1 -0
  388. package/dist/vendor/resources/beta/organization/rate-limits.d.ts +76 -0
  389. package/dist/vendor/resources/beta/organization/rate-limits.js +27 -0
  390. package/dist/vendor/resources/beta/organization/rate-limits.js.map +1 -0
  391. package/dist/vendor/resources/beta/organization/service-accounts/index.d.ts +2 -0
  392. package/dist/vendor/resources/beta/organization/service-accounts/index.js +4 -0
  393. package/dist/vendor/resources/beta/organization/service-accounts/index.js.map +1 -0
  394. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.d.ts +257 -0
  395. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js +166 -0
  396. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
  397. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.d.ts +140 -0
  398. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js +121 -0
  399. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
  400. package/dist/vendor/resources/beta/organization/service-accounts.d.ts +1 -0
  401. package/dist/vendor/resources/beta/organization/service-accounts.js +3 -0
  402. package/dist/vendor/resources/beta/organization/service-accounts.js.map +1 -0
  403. package/dist/vendor/resources/beta/organization/users.d.ts +123 -0
  404. package/dist/vendor/resources/beta/organization/users.js +63 -0
  405. package/dist/vendor/resources/beta/organization/users.js.map +1 -0
  406. package/dist/vendor/resources/beta/organization/workspaces/index.d.ts +4 -0
  407. package/dist/vendor/resources/beta/organization/workspaces/index.js +6 -0
  408. package/dist/vendor/resources/beta/organization/workspaces/index.js.map +1 -0
  409. package/dist/vendor/resources/beta/organization/workspaces/members.d.ts +134 -0
  410. package/dist/vendor/resources/beta/organization/workspaces/members.js +98 -0
  411. package/dist/vendor/resources/beta/organization/workspaces/members.js.map +1 -0
  412. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.d.ts +82 -0
  413. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js +30 -0
  414. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
  415. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.d.ts +209 -0
  416. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js +185 -0
  417. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
  418. package/dist/vendor/resources/beta/organization/workspaces/workspaces.d.ts +302 -0
  419. package/dist/vendor/resources/beta/organization/workspaces/workspaces.js +104 -0
  420. package/dist/vendor/resources/beta/organization/workspaces/workspaces.js.map +1 -0
  421. package/dist/vendor/resources/beta/organization/workspaces.d.ts +1 -0
  422. package/dist/vendor/resources/beta/organization/workspaces.js +3 -0
  423. package/dist/vendor/resources/beta/organization/workspaces.js.map +1 -0
  424. package/dist/vendor/resources/beta/organization.d.ts +1 -0
  425. package/dist/vendor/resources/beta/organization.js +3 -0
  426. package/dist/vendor/resources/beta/organization.js.map +1 -0
  427. package/dist/vendor/resources/beta/sessions/events.d.ts +1513 -0
  428. package/dist/vendor/resources/beta/sessions/events.js +115 -0
  429. package/dist/vendor/resources/beta/sessions/events.js.map +1 -0
  430. package/dist/vendor/resources/beta/sessions/index.d.ts +4 -0
  431. package/dist/vendor/resources/beta/sessions/index.js +6 -0
  432. package/dist/vendor/resources/beta/sessions/index.js.map +1 -0
  433. package/dist/vendor/resources/beta/sessions/resources.d.ts +227 -0
  434. package/dist/vendor/resources/beta/sessions/resources.js +128 -0
  435. package/dist/vendor/resources/beta/sessions/resources.js.map +1 -0
  436. package/dist/vendor/resources/beta/sessions/sessions.d.ts +866 -0
  437. package/dist/vendor/resources/beta/sessions/sessions.js +150 -0
  438. package/dist/vendor/resources/beta/sessions/sessions.js.map +1 -0
  439. package/dist/vendor/resources/beta/sessions/threads/events.d.ts +77 -0
  440. package/dist/vendor/resources/beta/sessions/threads/events.js +57 -0
  441. package/dist/vendor/resources/beta/sessions/threads/events.js.map +1 -0
  442. package/dist/vendor/resources/beta/sessions/threads/index.d.ts +2 -0
  443. package/dist/vendor/resources/beta/sessions/threads/index.js +4 -0
  444. package/dist/vendor/resources/beta/sessions/threads/index.js.map +1 -0
  445. package/dist/vendor/resources/beta/sessions/threads/threads.d.ts +195 -0
  446. package/dist/vendor/resources/beta/sessions/threads/threads.js +80 -0
  447. package/dist/vendor/resources/beta/sessions/threads/threads.js.map +1 -0
  448. package/dist/vendor/resources/beta/sessions/threads.d.ts +1 -0
  449. package/dist/vendor/resources/beta/sessions/threads.js +3 -0
  450. package/dist/vendor/resources/beta/sessions/threads.js.map +1 -0
  451. package/dist/vendor/resources/beta/sessions.d.ts +1 -0
  452. package/dist/vendor/resources/beta/sessions.js +3 -0
  453. package/dist/vendor/resources/beta/sessions.js.map +1 -0
  454. package/dist/vendor/resources/beta/skills/index.d.ts +2 -0
  455. package/dist/vendor/resources/beta/skills/index.js +4 -0
  456. package/dist/vendor/resources/beta/skills/index.js.map +1 -0
  457. package/dist/vendor/resources/beta/skills/skills.d.ts +178 -0
  458. package/dist/vendor/resources/beta/skills/skills.js +96 -0
  459. package/dist/vendor/resources/beta/skills/skills.js.map +1 -0
  460. package/dist/vendor/resources/beta/skills/versions.d.ts +181 -0
  461. package/dist/vendor/resources/beta/skills/versions.js +125 -0
  462. package/dist/vendor/resources/beta/skills/versions.js.map +1 -0
  463. package/dist/vendor/resources/beta/skills.d.ts +1 -0
  464. package/dist/vendor/resources/beta/skills.js +3 -0
  465. package/dist/vendor/resources/beta/skills.js.map +1 -0
  466. package/dist/vendor/resources/beta/tunnels/certificates.d.ts +162 -0
  467. package/dist/vendor/resources/beta/tunnels/certificates.js +125 -0
  468. package/dist/vendor/resources/beta/tunnels/certificates.js.map +1 -0
  469. package/dist/vendor/resources/beta/tunnels/index.d.ts +2 -0
  470. package/dist/vendor/resources/beta/tunnels/index.js +4 -0
  471. package/dist/vendor/resources/beta/tunnels/index.js.map +1 -0
  472. package/dist/vendor/resources/beta/tunnels/tunnels.d.ts +211 -0
  473. package/dist/vendor/resources/beta/tunnels/tunnels.js +173 -0
  474. package/dist/vendor/resources/beta/tunnels/tunnels.js.map +1 -0
  475. package/dist/vendor/resources/beta/tunnels.d.ts +1 -0
  476. package/dist/vendor/resources/beta/tunnels.js +3 -0
  477. package/dist/vendor/resources/beta/tunnels.js.map +1 -0
  478. package/dist/vendor/resources/beta/user-profiles.d.ts +244 -0
  479. package/dist/vendor/resources/beta/user-profiles.js +114 -0
  480. package/dist/vendor/resources/beta/user-profiles.js.map +1 -0
  481. package/dist/vendor/resources/beta/vaults/credentials.d.ts +715 -0
  482. package/dist/vendor/resources/beta/vaults/credentials.js +173 -0
  483. package/dist/vendor/resources/beta/vaults/credentials.js.map +1 -0
  484. package/dist/vendor/resources/beta/vaults/index.d.ts +2 -0
  485. package/dist/vendor/resources/beta/vaults/index.js +4 -0
  486. package/dist/vendor/resources/beta/vaults/index.js.map +1 -0
  487. package/dist/vendor/resources/beta/vaults/vaults.d.ts +191 -0
  488. package/dist/vendor/resources/beta/vaults/vaults.js +141 -0
  489. package/dist/vendor/resources/beta/vaults/vaults.js.map +1 -0
  490. package/dist/vendor/resources/beta/vaults.d.ts +1 -0
  491. package/dist/vendor/resources/beta/vaults.js +3 -0
  492. package/dist/vendor/resources/beta/vaults.js.map +1 -0
  493. package/dist/vendor/resources/beta/webhooks.d.ts +464 -0
  494. package/dist/vendor/resources/beta/webhooks.js +29 -0
  495. package/dist/vendor/resources/beta/webhooks.js.map +1 -0
  496. package/dist/vendor/resources/beta.d.ts +1 -0
  497. package/dist/vendor/resources/beta.js +3 -0
  498. package/dist/vendor/resources/beta.js.map +1 -0
  499. package/dist/vendor/resources/completions.d.ts +172 -0
  500. package/dist/vendor/resources/completions.js +19 -0
  501. package/dist/vendor/resources/completions.js.map +1 -0
  502. package/dist/vendor/resources/files.d.ts +104 -0
  503. package/dist/vendor/resources/files.js +48 -0
  504. package/dist/vendor/resources/files.js.map +1 -0
  505. package/dist/vendor/resources/index.d.ts +7 -0
  506. package/dist/vendor/resources/index.js +9 -0
  507. package/dist/vendor/resources/index.js.map +1 -0
  508. package/dist/vendor/resources/messages/batches.d.ts +312 -0
  509. package/dist/vendor/resources/messages/batches.js +157 -0
  510. package/dist/vendor/resources/messages/batches.js.map +1 -0
  511. package/dist/vendor/resources/messages/index.d.ts +2 -0
  512. package/dist/vendor/resources/messages/index.js +4 -0
  513. package/dist/vendor/resources/messages/index.js.map +1 -0
  514. package/dist/vendor/resources/messages/messages.d.ts +3886 -0
  515. package/dist/vendor/resources/messages/messages.js +130 -0
  516. package/dist/vendor/resources/messages/messages.js.map +1 -0
  517. package/dist/vendor/resources/messages.d.ts +1 -0
  518. package/dist/vendor/resources/messages.js +3 -0
  519. package/dist/vendor/resources/messages.js.map +1 -0
  520. package/dist/vendor/resources/models.d.ts +196 -0
  521. package/dist/vendor/resources/models.js +41 -0
  522. package/dist/vendor/resources/models.js.map +1 -0
  523. package/dist/vendor/resources/shared.d.ts +43 -0
  524. package/dist/vendor/resources/shared.js +3 -0
  525. package/dist/vendor/resources/shared.js.map +1 -0
  526. package/dist/vendor/resources/skills/index.d.ts +2 -0
  527. package/dist/vendor/resources/skills/index.js +4 -0
  528. package/dist/vendor/resources/skills/index.js.map +1 -0
  529. package/dist/vendor/resources/skills/skills.d.ts +128 -0
  530. package/dist/vendor/resources/skills/skills.js +36 -0
  531. package/dist/vendor/resources/skills/skills.js.map +1 -0
  532. package/dist/vendor/resources/skills/versions.d.ts +103 -0
  533. package/dist/vendor/resources/skills/versions.js +37 -0
  534. package/dist/vendor/resources/skills/versions.js.map +1 -0
  535. package/dist/vendor/resources/skills.d.ts +1 -0
  536. package/dist/vendor/resources/skills.js +3 -0
  537. package/dist/vendor/resources/skills.js.map +1 -0
  538. package/dist/vendor/resources/top-level.d.ts +1 -0
  539. package/dist/vendor/resources/top-level.js +3 -0
  540. package/dist/vendor/resources/top-level.js.map +1 -0
  541. package/dist/vendor/resources.d.ts +1 -0
  542. package/dist/vendor/resources.js +2 -0
  543. package/dist/vendor/resources.js.map +1 -0
  544. package/dist/vendor/streaming.d.ts +2 -0
  545. package/dist/vendor/streaming.js +3 -0
  546. package/dist/vendor/streaming.js.map +1 -0
  547. package/dist/vendor/tools/agent-toolset/fs-util.d.ts +74 -0
  548. package/dist/vendor/tools/agent-toolset/fs-util.js +184 -0
  549. package/dist/vendor/tools/agent-toolset/fs-util.js.map +1 -0
  550. package/dist/vendor/tools/agent-toolset/memories.d.ts +172 -0
  551. package/dist/vendor/tools/agent-toolset/memories.js +910 -0
  552. package/dist/vendor/tools/agent-toolset/memories.js.map +1 -0
  553. package/dist/vendor/tools/agent-toolset/node.browser.d.ts +80 -0
  554. package/dist/vendor/tools/agent-toolset/node.browser.js +129 -0
  555. package/dist/vendor/tools/agent-toolset/node.browser.js.map +1 -0
  556. package/dist/vendor/tools/agent-toolset/node.d.ts +191 -0
  557. package/dist/vendor/tools/agent-toolset/node.js +886 -0
  558. package/dist/vendor/tools/agent-toolset/node.js.map +1 -0
  559. package/dist/vendor/tools/agent-toolset/skills.d.ts +73 -0
  560. package/dist/vendor/tools/agent-toolset/skills.js +320 -0
  561. package/dist/vendor/tools/agent-toolset/skills.js.map +1 -0
  562. package/dist/vendor/tools/agent-toolset/sync-interval.d.ts +18 -0
  563. package/dist/vendor/tools/agent-toolset/sync-interval.js +25 -0
  564. package/dist/vendor/tools/agent-toolset/sync-interval.js.map +1 -0
  565. package/dist/vendor/tools/memory/node.browser.d.ts +26 -0
  566. package/dist/vendor/tools/memory/node.browser.js +44 -0
  567. package/dist/vendor/tools/memory/node.browser.js.map +1 -0
  568. package/dist/vendor/tools/memory/node.d.ts +17 -0
  569. package/dist/vendor/tools/memory/node.js +327 -0
  570. package/dist/vendor/tools/memory/node.js.map +1 -0
  571. package/dist/vendor/uploads.d.ts +2 -0
  572. package/dist/vendor/uploads.js +3 -0
  573. package/dist/vendor/uploads.js.map +1 -0
  574. package/dist/vendor/version.d.ts +1 -0
  575. package/dist/vendor/version.js +2 -0
  576. package/dist/vendor/version.js.map +1 -0
  577. package/package.json +7 -14
  578. package/sdk.cjs +2 -2
  579. package/sdk.cjs.map +2 -2
  580. package/sdk.d.ts +1 -1
  581. package/sdk.mjs +2 -2
  582. package/sdk.mjs.map +3 -3
@@ -0,0 +1,3886 @@
1
+ import { APIPromise } from '../../core/api-promise';
2
+ import { APIResource } from '../../core/resource';
3
+ import { Stream } from '../../core/streaming';
4
+ import { RequestOptions } from '../../internal/request-options';
5
+ import { MessageStream } from '../../lib/MessageStream';
6
+ import { type ExtractParsedContentFromParams, type ParseableMessageCreateParams, type ParsedMessage } from '../../lib/parser';
7
+ import * as BatchesAPI from './batches';
8
+ import { BatchCreateParams, BatchListParams, Batches, DeletedMessageBatch, MessageBatch, MessageBatchCanceledResult, MessageBatchErroredResult, MessageBatchExpiredResult, MessageBatchIndividualResponse, MessageBatchRequestCounts, MessageBatchResult, MessageBatchSucceededResult, MessageBatchesPage } from './batches';
9
+ import * as MessagesAPI from './messages';
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://platform.puku.com/docs/en/get-started)
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: 'puku-opus-5',
28
+ * });
29
+ * ```
30
+ */
31
+ create(params: MessageCreateParamsNonStreaming, options?: RequestOptions): APIPromise<Message>;
32
+ create(params: MessageCreateParamsStreaming, options?: RequestOptions): APIPromise<Stream<RawMessageStreamEvent>>;
33
+ create(params: 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: 'puku-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: 'puku-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://platform.puku.com/docs/en/build-with-puku/token-counting)
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * const messageTokensCount =
87
+ * await client.messages.countTokens({
88
+ * messages: [{ content: 'Hello, world', role: 'user' }],
89
+ * model: 'puku-opus-5',
90
+ * });
91
+ * ```
92
+ */
93
+ countTokens(params: 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
+ /**
151
+ * `close_tab`'s config overrides.
152
+ */
153
+ export interface BrowserCloseTabConfig {
154
+ /**
155
+ * Defer loading for this member. Must resolve to the same value on every enabled
156
+ * member of the toolset.
157
+ */
158
+ defer_loading?: boolean | null;
159
+ /**
160
+ * Whether this member is offered to the model. Default is per member, per the
161
+ * toolset's documentation. A member whose enabled resolves false is withheld from
162
+ * the served schema.
163
+ */
164
+ enabled?: boolean | null;
165
+ }
166
+ /**
167
+ * `double_click`'s config overrides.
168
+ */
169
+ export interface BrowserDoubleClickConfig {
170
+ /**
171
+ * Defer loading for this member. Must resolve to the same value on every enabled
172
+ * member of the toolset.
173
+ */
174
+ defer_loading?: boolean | null;
175
+ /**
176
+ * Whether this member is offered to the model. Default is per member, per the
177
+ * toolset's documentation. A member whose enabled resolves false is withheld from
178
+ * the served schema.
179
+ */
180
+ enabled?: boolean | null;
181
+ }
182
+ /**
183
+ * `file_upload`'s config overrides.
184
+ */
185
+ export interface BrowserFileUploadConfig {
186
+ /**
187
+ * Defer loading for this member. Must resolve to the same value on every enabled
188
+ * member of the toolset.
189
+ */
190
+ defer_loading?: boolean | null;
191
+ /**
192
+ * Whether this member is offered to the model. Default is per member, per the
193
+ * toolset's documentation. A member whose enabled resolves false is withheld from
194
+ * the served schema.
195
+ */
196
+ enabled?: boolean | null;
197
+ }
198
+ /**
199
+ * `find`'s config overrides.
200
+ */
201
+ export interface BrowserFindConfig {
202
+ /**
203
+ * Defer loading for this member. Must resolve to the same value on every enabled
204
+ * member of the toolset.
205
+ */
206
+ defer_loading?: boolean | null;
207
+ /**
208
+ * Whether this member is offered to the model. Default is per member, per the
209
+ * toolset's documentation. A member whose enabled resolves false is withheld from
210
+ * the served schema.
211
+ */
212
+ enabled?: boolean | null;
213
+ }
214
+ /**
215
+ * `form_input`'s config overrides.
216
+ */
217
+ export interface BrowserFormInputConfig {
218
+ /**
219
+ * Defer loading for this member. Must resolve to the same value on every enabled
220
+ * member of the toolset.
221
+ */
222
+ defer_loading?: boolean | null;
223
+ /**
224
+ * Whether this member is offered to the model. Default is per member, per the
225
+ * toolset's documentation. A member whose enabled resolves false is withheld from
226
+ * the served schema.
227
+ */
228
+ enabled?: boolean | null;
229
+ }
230
+ /**
231
+ * `get_page_text`'s config overrides.
232
+ */
233
+ export interface BrowserGetPageTextConfig {
234
+ /**
235
+ * Defer loading for this member. Must resolve to the same value on every enabled
236
+ * member of the toolset.
237
+ */
238
+ defer_loading?: boolean | null;
239
+ /**
240
+ * Whether this member is offered to the model. Default is per member, per the
241
+ * toolset's documentation. A member whose enabled resolves false is withheld from
242
+ * the served schema.
243
+ */
244
+ enabled?: boolean | null;
245
+ }
246
+ /**
247
+ * `hold_key`'s config overrides.
248
+ */
249
+ export interface BrowserHoldKeyConfig {
250
+ /**
251
+ * Defer loading for this member. Must resolve to the same value on every enabled
252
+ * member of the toolset.
253
+ */
254
+ defer_loading?: boolean | null;
255
+ /**
256
+ * Whether this member is offered to the model. Default is per member, per the
257
+ * toolset's documentation. A member whose enabled resolves false is withheld from
258
+ * the served schema.
259
+ */
260
+ enabled?: boolean | null;
261
+ }
262
+ /**
263
+ * `hover`'s config overrides.
264
+ */
265
+ export interface BrowserHoverConfig {
266
+ /**
267
+ * Defer loading for this member. Must resolve to the same value on every enabled
268
+ * member of the toolset.
269
+ */
270
+ defer_loading?: boolean | null;
271
+ /**
272
+ * Whether this member is offered to the model. Default is per member, per the
273
+ * toolset's documentation. A member whose enabled resolves false is withheld from
274
+ * the served schema.
275
+ */
276
+ enabled?: boolean | null;
277
+ }
278
+ /**
279
+ * `javascript_exec`'s config overrides.
280
+ */
281
+ export interface BrowserJavascriptExecConfig {
282
+ /**
283
+ * Defer loading for this member. Must resolve to the same value on every enabled
284
+ * member of the toolset.
285
+ */
286
+ defer_loading?: boolean | null;
287
+ /**
288
+ * Whether this member is offered to the model. Default is per member, per the
289
+ * toolset's documentation. A member whose enabled resolves false is withheld from
290
+ * the served schema.
291
+ */
292
+ enabled?: boolean | null;
293
+ }
294
+ /**
295
+ * `key`'s config overrides.
296
+ */
297
+ export interface BrowserKeyConfig {
298
+ /**
299
+ * Defer loading for this member. Must resolve to the same value on every enabled
300
+ * member of the toolset.
301
+ */
302
+ defer_loading?: boolean | null;
303
+ /**
304
+ * Whether this member is offered to the model. Default is per member, per the
305
+ * toolset's documentation. A member whose enabled resolves false is withheld from
306
+ * the served schema.
307
+ */
308
+ enabled?: boolean | null;
309
+ }
310
+ /**
311
+ * `left_click`'s config overrides.
312
+ */
313
+ export interface BrowserLeftClickConfig {
314
+ /**
315
+ * Defer loading for this member. Must resolve to the same value on every enabled
316
+ * member of the toolset.
317
+ */
318
+ defer_loading?: boolean | null;
319
+ /**
320
+ * Whether this member is offered to the model. Default is per member, per the
321
+ * toolset's documentation. A member whose enabled resolves false is withheld from
322
+ * the served schema.
323
+ */
324
+ enabled?: boolean | null;
325
+ }
326
+ /**
327
+ * `left_click_drag`'s config overrides.
328
+ */
329
+ export interface BrowserLeftClickDragConfig {
330
+ /**
331
+ * Defer loading for this member. Must resolve to the same value on every enabled
332
+ * member of the toolset.
333
+ */
334
+ defer_loading?: boolean | null;
335
+ /**
336
+ * Whether this member is offered to the model. Default is per member, per the
337
+ * toolset's documentation. A member whose enabled resolves false is withheld from
338
+ * the served schema.
339
+ */
340
+ enabled?: boolean | null;
341
+ }
342
+ /**
343
+ * `left_mouse_down`'s config overrides.
344
+ */
345
+ export interface BrowserLeftMouseDownConfig {
346
+ /**
347
+ * Defer loading for this member. Must resolve to the same value on every enabled
348
+ * member of the toolset.
349
+ */
350
+ defer_loading?: boolean | null;
351
+ /**
352
+ * Whether this member is offered to the model. Default is per member, per the
353
+ * toolset's documentation. A member whose enabled resolves false is withheld from
354
+ * the served schema.
355
+ */
356
+ enabled?: boolean | null;
357
+ }
358
+ /**
359
+ * `left_mouse_up`'s config overrides.
360
+ */
361
+ export interface BrowserLeftMouseUpConfig {
362
+ /**
363
+ * Defer loading for this member. Must resolve to the same value on every enabled
364
+ * member of the toolset.
365
+ */
366
+ defer_loading?: boolean | null;
367
+ /**
368
+ * Whether this member is offered to the model. Default is per member, per the
369
+ * toolset's documentation. A member whose enabled resolves false is withheld from
370
+ * the served schema.
371
+ */
372
+ enabled?: boolean | null;
373
+ }
374
+ /**
375
+ * `list_tabs`'s config overrides.
376
+ */
377
+ export interface BrowserListTabsConfig {
378
+ /**
379
+ * Defer loading for this member. Must resolve to the same value on every enabled
380
+ * member of the toolset.
381
+ */
382
+ defer_loading?: boolean | null;
383
+ /**
384
+ * Whether this member is offered to the model. Default is per member, per the
385
+ * toolset's documentation. A member whose enabled resolves false is withheld from
386
+ * the served schema.
387
+ */
388
+ enabled?: boolean | null;
389
+ }
390
+ /**
391
+ * `middle_click`'s config overrides.
392
+ */
393
+ export interface BrowserMiddleClickConfig {
394
+ /**
395
+ * Defer loading for this member. Must resolve to the same value on every enabled
396
+ * member of the toolset.
397
+ */
398
+ defer_loading?: boolean | null;
399
+ /**
400
+ * Whether this member is offered to the model. Default is per member, per the
401
+ * toolset's documentation. A member whose enabled resolves false is withheld from
402
+ * the served schema.
403
+ */
404
+ enabled?: boolean | null;
405
+ }
406
+ /**
407
+ * `mouse_move`'s config overrides.
408
+ */
409
+ export interface BrowserMouseMoveConfig {
410
+ /**
411
+ * Defer loading for this member. Must resolve to the same value on every enabled
412
+ * member of the toolset.
413
+ */
414
+ defer_loading?: boolean | null;
415
+ /**
416
+ * Whether this member is offered to the model. Default is per member, per the
417
+ * toolset's documentation. A member whose enabled resolves false is withheld from
418
+ * the served schema.
419
+ */
420
+ enabled?: boolean | null;
421
+ }
422
+ /**
423
+ * `navigate`'s config overrides.
424
+ */
425
+ export interface BrowserNavigateConfig {
426
+ /**
427
+ * Defer loading for this member. Must resolve to the same value on every enabled
428
+ * member of the toolset.
429
+ */
430
+ defer_loading?: boolean | null;
431
+ /**
432
+ * Whether this member is offered to the model. Default is per member, per the
433
+ * toolset's documentation. A member whose enabled resolves false is withheld from
434
+ * the served schema.
435
+ */
436
+ enabled?: boolean | null;
437
+ }
438
+ /**
439
+ * `new_tab`'s config overrides.
440
+ */
441
+ export interface BrowserNewTabConfig {
442
+ /**
443
+ * Defer loading for this member. Must resolve to the same value on every enabled
444
+ * member of the toolset.
445
+ */
446
+ defer_loading?: boolean | null;
447
+ /**
448
+ * Whether this member is offered to the model. Default is per member, per the
449
+ * toolset's documentation. A member whose enabled resolves false is withheld from
450
+ * the served schema.
451
+ */
452
+ enabled?: boolean | null;
453
+ }
454
+ /**
455
+ * `read_console`'s config overrides.
456
+ */
457
+ export interface BrowserReadConsoleConfig {
458
+ /**
459
+ * Defer loading for this member. Must resolve to the same value on every enabled
460
+ * member of the toolset.
461
+ */
462
+ defer_loading?: boolean | null;
463
+ /**
464
+ * Whether this member is offered to the model. Default is per member, per the
465
+ * toolset's documentation. A member whose enabled resolves false is withheld from
466
+ * the served schema.
467
+ */
468
+ enabled?: boolean | null;
469
+ }
470
+ /**
471
+ * `read_network`'s config overrides.
472
+ */
473
+ export interface BrowserReadNetworkConfig {
474
+ /**
475
+ * Defer loading for this member. Must resolve to the same value on every enabled
476
+ * member of the toolset.
477
+ */
478
+ defer_loading?: boolean | null;
479
+ /**
480
+ * Whether this member is offered to the model. Default is per member, per the
481
+ * toolset's documentation. A member whose enabled resolves false is withheld from
482
+ * the served schema.
483
+ */
484
+ enabled?: boolean | null;
485
+ }
486
+ /**
487
+ * `read_page`'s config overrides.
488
+ */
489
+ export interface BrowserReadPageConfig {
490
+ /**
491
+ * Defer loading for this member. Must resolve to the same value on every enabled
492
+ * member of the toolset.
493
+ */
494
+ defer_loading?: boolean | null;
495
+ /**
496
+ * Whether this member is offered to the model. Default is per member, per the
497
+ * toolset's documentation. A member whose enabled resolves false is withheld from
498
+ * the served schema.
499
+ */
500
+ enabled?: boolean | null;
501
+ }
502
+ /**
503
+ * `right_click`'s config overrides.
504
+ */
505
+ export interface BrowserRightClickConfig {
506
+ /**
507
+ * Defer loading for this member. Must resolve to the same value on every enabled
508
+ * member of the toolset.
509
+ */
510
+ defer_loading?: boolean | null;
511
+ /**
512
+ * Whether this member is offered to the model. Default is per member, per the
513
+ * toolset's documentation. A member whose enabled resolves false is withheld from
514
+ * the served schema.
515
+ */
516
+ enabled?: boolean | null;
517
+ }
518
+ /**
519
+ * `screenshot`'s config overrides.
520
+ */
521
+ export interface BrowserScreenshotConfig {
522
+ /**
523
+ * Defer loading for this member. Must resolve to the same value on every enabled
524
+ * member of the toolset.
525
+ */
526
+ defer_loading?: boolean | null;
527
+ /**
528
+ * Whether this member is offered to the model. Default is per member, per the
529
+ * toolset's documentation. A member whose enabled resolves false is withheld from
530
+ * the served schema.
531
+ */
532
+ enabled?: boolean | null;
533
+ }
534
+ /**
535
+ * `scroll`'s config overrides.
536
+ */
537
+ export interface BrowserScrollConfig {
538
+ /**
539
+ * Defer loading for this member. Must resolve to the same value on every enabled
540
+ * member of the toolset.
541
+ */
542
+ defer_loading?: boolean | null;
543
+ /**
544
+ * Whether this member is offered to the model. Default is per member, per the
545
+ * toolset's documentation. A member whose enabled resolves false is withheld from
546
+ * the served schema.
547
+ */
548
+ enabled?: boolean | null;
549
+ }
550
+ /**
551
+ * `scroll_to`'s config overrides.
552
+ */
553
+ export interface BrowserScrollToConfig {
554
+ /**
555
+ * Defer loading for this member. Must resolve to the same value on every enabled
556
+ * member of the toolset.
557
+ */
558
+ defer_loading?: boolean | null;
559
+ /**
560
+ * Whether this member is offered to the model. Default is per member, per the
561
+ * toolset's documentation. A member whose enabled resolves false is withheld from
562
+ * the served schema.
563
+ */
564
+ enabled?: boolean | null;
565
+ }
566
+ /**
567
+ * The caller's browser state after a browser toolset member call — the full
568
+ * inventory of open tabs, which tab is active, and any side effects (tabs opened,
569
+ * download state changes) the call produced.
570
+ *
571
+ * At most one per `tool_result`, only on a non-error result answering a browser
572
+ * toolset member `tool_use`. The server renders the model-visible text from it;
573
+ * the model never sees the raw fields.
574
+ */
575
+ export interface BrowserStateBlockParam {
576
+ /**
577
+ * All tabs open in the browser after this call — the full inventory, not a delta.
578
+ * May be empty. Whenever non-empty, exactly one entry carries `active: true`.
579
+ */
580
+ tabs: Array<BrowserStateTabEntry>;
581
+ type: 'browser_state';
582
+ /**
583
+ * Create a cache control breakpoint at this content block.
584
+ */
585
+ cache_control?: CacheControlEphemeral | null;
586
+ /**
587
+ * Tabs opened and download state changes during this call. "Nothing to report" is
588
+ * expressed by omitting the field, never by an empty list.
589
+ */
590
+ state_changes?: Array<BrowserStateChange> | null;
591
+ }
592
+ /**
593
+ * A tab this call's execution opened that remains open at its end — the creation
594
+ * delta of the `tabs` inventory, not an event log.
595
+ *
596
+ * Carries only the `tab_id`; the tab's `title` and `url` live on its `tabs` entry,
597
+ * which must include the same `tab_id`. A tab opened during a failed call gets no
598
+ * deferred `tab_opened`; it simply appears in the next result's `tabs` inventory.
599
+ */
600
+ export type BrowserStateChange = BrowserStateChangeTabOpened | BrowserStateChangeDownloadStarted | BrowserStateChangeDownloadCompleted | BrowserStateChangeDownloadFailed;
601
+ /**
602
+ * A file download that finished during this call, reported with the same
603
+ * `download_id` as its `download_started` — or without a prior `download_started`,
604
+ * when the download finished during the call that started it (at most one state
605
+ * change per `download_id` per result).
606
+ */
607
+ export interface BrowserStateChangeDownloadCompleted {
608
+ /**
609
+ * The caller-assigned identifier for this download, stable across the state
610
+ * changes reporting it.
611
+ */
612
+ download_id: string;
613
+ type: 'download_completed';
614
+ /**
615
+ * The final post-redirect URL the download was served from.
616
+ */
617
+ url: string;
618
+ /**
619
+ * Where the executor saved the file, on the executor's filesystem. Only included
620
+ * when another tool in the same environment can read the file at that path.
621
+ */
622
+ path?: string | null;
623
+ /**
624
+ * The completed download's size.
625
+ */
626
+ size_bytes?: number | null;
627
+ }
628
+ /**
629
+ * A file download that failed — or was cancelled — during this call.
630
+ */
631
+ export interface BrowserStateChangeDownloadFailed {
632
+ /**
633
+ * The caller-assigned identifier for this download, stable across the state
634
+ * changes reporting it.
635
+ */
636
+ download_id: string;
637
+ type: 'download_failed';
638
+ /**
639
+ * The final post-redirect URL the download was served from.
640
+ */
641
+ url: string;
642
+ /**
643
+ * The failure or cancellation detail, when known.
644
+ */
645
+ error?: string | null;
646
+ }
647
+ /**
648
+ * A file download that started during this call.
649
+ */
650
+ export interface BrowserStateChangeDownloadStarted {
651
+ /**
652
+ * The caller-assigned identifier for this download, stable across the state
653
+ * changes reporting it.
654
+ */
655
+ download_id: string;
656
+ type: 'download_started';
657
+ /**
658
+ * The final post-redirect URL the download was served from.
659
+ */
660
+ url: string;
661
+ }
662
+ /**
663
+ * A tab this call's execution opened that remains open at its end — the creation
664
+ * delta of the `tabs` inventory, not an event log.
665
+ *
666
+ * Carries only the `tab_id`; the tab's `title` and `url` live on its `tabs` entry,
667
+ * which must include the same `tab_id`. A tab opened during a failed call gets no
668
+ * deferred `tab_opened`; it simply appears in the next result's `tabs` inventory.
669
+ */
670
+ export interface BrowserStateChangeTabOpened {
671
+ /**
672
+ * The `tab_id` of the opened tab, present in `tabs`.
673
+ */
674
+ tab_id: string;
675
+ type: 'tab_opened';
676
+ }
677
+ /**
678
+ * One open browser tab reported in a `browser_state` block's `tabs` inventory.
679
+ *
680
+ * `tab_id` is the caller-assigned identifier for the tab; `title` and `url`
681
+ * describe the page the tab is currently showing and may be empty strings (a blank
682
+ * tab legitimately has both empty). `active` marks the tab that is active after
683
+ * this call; whenever `tabs` is non-empty, exactly one entry is marked.
684
+ */
685
+ export interface BrowserStateTabEntry {
686
+ /**
687
+ * The caller-assigned identifier for this tab, unique within the inventory.
688
+ */
689
+ tab_id: string;
690
+ /**
691
+ * The title of the page the tab is showing. May be empty.
692
+ */
693
+ title: string;
694
+ /**
695
+ * The URL of the page the tab is showing. May be empty.
696
+ */
697
+ url: string;
698
+ /**
699
+ * Whether this tab is the active tab after this call. Whenever `tabs` is
700
+ * non-empty, exactly one entry is marked `active: true`.
701
+ */
702
+ active?: boolean;
703
+ }
704
+ /**
705
+ * `switch_tab`'s config overrides.
706
+ */
707
+ export interface BrowserSwitchTabConfig {
708
+ /**
709
+ * Defer loading for this member. Must resolve to the same value on every enabled
710
+ * member of the toolset.
711
+ */
712
+ defer_loading?: boolean | null;
713
+ /**
714
+ * Whether this member is offered to the model. Default is per member, per the
715
+ * toolset's documentation. A member whose enabled resolves false is withheld from
716
+ * the served schema.
717
+ */
718
+ enabled?: boolean | null;
719
+ }
720
+ /**
721
+ * The browser toolset: a single `tools[]` entry (carrying no `name`) that declares
722
+ * the browser tool family. The model is served the family's tool with any members
723
+ * disabled via `configs` removed from its schema.
724
+ */
725
+ export interface BrowserToolset20260801 {
726
+ type: 'browser_toolset_20260801';
727
+ /**
728
+ * Create a cache control breakpoint at this content block.
729
+ */
730
+ cache_control?: CacheControlEphemeral | null;
731
+ /**
732
+ * Per-member configuration for `browser_toolset_20260801`: one optional field per
733
+ * member tool, keyed by the member name — the same name the member's `tool_use`
734
+ * blocks carry. Every member is an accepted key, and a member's defaults apply
735
+ * wherever its key is absent. Unknown keys are rejected: the field set is this
736
+ * toolset version's complete member set.
737
+ */
738
+ configs?: BrowserToolsetConfigs | null;
739
+ }
740
+ /**
741
+ * Per-member configuration for `browser_toolset_20260801`: one optional field per
742
+ * member tool, keyed by the member name — the same name the member's `tool_use`
743
+ * blocks carry. Every member is an accepted key, and a member's defaults apply
744
+ * wherever its key is absent. Unknown keys are rejected: the field set is this
745
+ * toolset version's complete member set.
746
+ */
747
+ export interface BrowserToolsetConfigs {
748
+ /**
749
+ * `close_tab`'s config overrides.
750
+ */
751
+ close_tab?: BrowserCloseTabConfig | null;
752
+ /**
753
+ * `double_click`'s config overrides.
754
+ */
755
+ double_click?: BrowserDoubleClickConfig | null;
756
+ /**
757
+ * `file_upload`'s config overrides.
758
+ */
759
+ file_upload?: BrowserFileUploadConfig | null;
760
+ /**
761
+ * `find`'s config overrides.
762
+ */
763
+ find?: BrowserFindConfig | null;
764
+ /**
765
+ * `form_input`'s config overrides.
766
+ */
767
+ form_input?: BrowserFormInputConfig | null;
768
+ /**
769
+ * `get_page_text`'s config overrides.
770
+ */
771
+ get_page_text?: BrowserGetPageTextConfig | null;
772
+ /**
773
+ * `hold_key`'s config overrides.
774
+ */
775
+ hold_key?: BrowserHoldKeyConfig | null;
776
+ /**
777
+ * `hover`'s config overrides.
778
+ */
779
+ hover?: BrowserHoverConfig | null;
780
+ /**
781
+ * `javascript_exec`'s config overrides.
782
+ */
783
+ javascript_exec?: BrowserJavascriptExecConfig | null;
784
+ /**
785
+ * `key`'s config overrides.
786
+ */
787
+ key?: BrowserKeyConfig | null;
788
+ /**
789
+ * `left_click`'s config overrides.
790
+ */
791
+ left_click?: BrowserLeftClickConfig | null;
792
+ /**
793
+ * `left_click_drag`'s config overrides.
794
+ */
795
+ left_click_drag?: BrowserLeftClickDragConfig | null;
796
+ /**
797
+ * `left_mouse_down`'s config overrides.
798
+ */
799
+ left_mouse_down?: BrowserLeftMouseDownConfig | null;
800
+ /**
801
+ * `left_mouse_up`'s config overrides.
802
+ */
803
+ left_mouse_up?: BrowserLeftMouseUpConfig | null;
804
+ /**
805
+ * `list_tabs`'s config overrides.
806
+ */
807
+ list_tabs?: BrowserListTabsConfig | null;
808
+ /**
809
+ * `middle_click`'s config overrides.
810
+ */
811
+ middle_click?: BrowserMiddleClickConfig | null;
812
+ /**
813
+ * `mouse_move`'s config overrides.
814
+ */
815
+ mouse_move?: BrowserMouseMoveConfig | null;
816
+ /**
817
+ * `navigate`'s config overrides.
818
+ */
819
+ navigate?: BrowserNavigateConfig | null;
820
+ /**
821
+ * `new_tab`'s config overrides.
822
+ */
823
+ new_tab?: BrowserNewTabConfig | null;
824
+ /**
825
+ * `read_console`'s config overrides.
826
+ */
827
+ read_console?: BrowserReadConsoleConfig | null;
828
+ /**
829
+ * `read_network`'s config overrides.
830
+ */
831
+ read_network?: BrowserReadNetworkConfig | null;
832
+ /**
833
+ * `read_page`'s config overrides.
834
+ */
835
+ read_page?: BrowserReadPageConfig | null;
836
+ /**
837
+ * `right_click`'s config overrides.
838
+ */
839
+ right_click?: BrowserRightClickConfig | null;
840
+ /**
841
+ * `screenshot`'s config overrides.
842
+ */
843
+ screenshot?: BrowserScreenshotConfig | null;
844
+ /**
845
+ * `scroll`'s config overrides.
846
+ */
847
+ scroll?: BrowserScrollConfig | null;
848
+ /**
849
+ * `scroll_to`'s config overrides.
850
+ */
851
+ scroll_to?: BrowserScrollToConfig | null;
852
+ /**
853
+ * `switch_tab`'s config overrides.
854
+ */
855
+ switch_tab?: BrowserSwitchTabConfig | null;
856
+ /**
857
+ * `triple_click`'s config overrides.
858
+ */
859
+ triple_click?: BrowserTripleClickConfig | null;
860
+ /**
861
+ * `type`'s config overrides.
862
+ */
863
+ type?: BrowserTypeConfig | null;
864
+ /**
865
+ * `wait`'s config overrides.
866
+ */
867
+ wait?: BrowserWaitConfig | null;
868
+ /**
869
+ * `zoom`'s config overrides.
870
+ */
871
+ zoom?: BrowserZoomConfig | null;
872
+ }
873
+ /**
874
+ * `triple_click`'s config overrides.
875
+ */
876
+ export interface BrowserTripleClickConfig {
877
+ /**
878
+ * Defer loading for this member. Must resolve to the same value on every enabled
879
+ * member of the toolset.
880
+ */
881
+ defer_loading?: boolean | null;
882
+ /**
883
+ * Whether this member is offered to the model. Default is per member, per the
884
+ * toolset's documentation. A member whose enabled resolves false is withheld from
885
+ * the served schema.
886
+ */
887
+ enabled?: boolean | null;
888
+ }
889
+ /**
890
+ * `type`'s config overrides.
891
+ */
892
+ export interface BrowserTypeConfig {
893
+ /**
894
+ * Defer loading for this member. Must resolve to the same value on every enabled
895
+ * member of the toolset.
896
+ */
897
+ defer_loading?: boolean | null;
898
+ /**
899
+ * Whether this member is offered to the model. Default is per member, per the
900
+ * toolset's documentation. A member whose enabled resolves false is withheld from
901
+ * the served schema.
902
+ */
903
+ enabled?: boolean | null;
904
+ }
905
+ /**
906
+ * `wait`'s config overrides.
907
+ */
908
+ export interface BrowserWaitConfig {
909
+ /**
910
+ * Defer loading for this member. Must resolve to the same value on every enabled
911
+ * member of the toolset.
912
+ */
913
+ defer_loading?: boolean | null;
914
+ /**
915
+ * Whether this member is offered to the model. Default is per member, per the
916
+ * toolset's documentation. A member whose enabled resolves false is withheld from
917
+ * the served schema.
918
+ */
919
+ enabled?: boolean | null;
920
+ }
921
+ /**
922
+ * `zoom`'s config overrides.
923
+ */
924
+ export interface BrowserZoomConfig {
925
+ /**
926
+ * Defer loading for this member. Must resolve to the same value on every enabled
927
+ * member of the toolset.
928
+ */
929
+ defer_loading?: boolean | null;
930
+ /**
931
+ * Whether this member is offered to the model. Default is per member, per the
932
+ * toolset's documentation. A member whose enabled resolves false is withheld from
933
+ * the served schema.
934
+ */
935
+ enabled?: boolean | null;
936
+ }
937
+ export interface CacheControlEphemeral {
938
+ type: 'ephemeral';
939
+ /**
940
+ * The time-to-live for the cache control breakpoint.
941
+ *
942
+ * This may be one the following values:
943
+ *
944
+ * - `5m`: 5 minutes
945
+ * - `1h`: 1 hour
946
+ *
947
+ * Defaults to `5m`. See
948
+ * [prompt caching pricing](https://platform.puku.com/docs/en/build-with-puku/prompt-caching)
949
+ * for details.
950
+ */
951
+ ttl?: '5m' | '1h';
952
+ }
953
+ export interface CacheCreation {
954
+ /**
955
+ * The number of input tokens used to create the 1 hour cache entry.
956
+ */
957
+ ephemeral_1h_input_tokens: number;
958
+ /**
959
+ * The number of input tokens used to create the 5 minute cache entry.
960
+ */
961
+ ephemeral_5m_input_tokens: number;
962
+ }
963
+ export interface CitationCharLocation {
964
+ cited_text: string;
965
+ document_index: number;
966
+ document_title: string | null;
967
+ end_char_index: number;
968
+ file_id: string | null;
969
+ start_char_index: number;
970
+ type: 'char_location';
971
+ }
972
+ export interface CitationCharLocationParam {
973
+ cited_text: string;
974
+ document_index: number;
975
+ document_title: string | null;
976
+ end_char_index: number;
977
+ start_char_index: number;
978
+ type: 'char_location';
979
+ }
980
+ export interface CitationContentBlockLocation {
981
+ /**
982
+ * The full text of the cited block range, concatenated.
983
+ *
984
+ * Always equals the contents of `content[start_block_index:end_block_index]`
985
+ * joined together. The text block is the minimal citable unit; this field is never
986
+ * a substring of a single block. Not counted toward output tokens, and not counted
987
+ * toward input tokens when sent back in subsequent turns.
988
+ */
989
+ cited_text: string;
990
+ document_index: number;
991
+ document_title: string | null;
992
+ /**
993
+ * Exclusive 0-based end index of the cited block range in the source's `content`
994
+ * array.
995
+ *
996
+ * Always greater than `start_block_index`; a single-block citation has
997
+ * `end_block_index = start_block_index + 1`.
998
+ */
999
+ end_block_index: number;
1000
+ file_id: string | null;
1001
+ /**
1002
+ * 0-based index of the first cited block in the source's `content` array.
1003
+ */
1004
+ start_block_index: number;
1005
+ type: 'content_block_location';
1006
+ }
1007
+ export interface CitationContentBlockLocationParam {
1008
+ /**
1009
+ * The full text of the cited block range, concatenated.
1010
+ *
1011
+ * Always equals the contents of `content[start_block_index:end_block_index]`
1012
+ * joined together. The text block is the minimal citable unit; this field is never
1013
+ * a substring of a single block. Not counted toward output tokens, and not counted
1014
+ * toward input tokens when sent back in subsequent turns.
1015
+ */
1016
+ cited_text: string;
1017
+ document_index: number;
1018
+ document_title: string | null;
1019
+ /**
1020
+ * Exclusive 0-based end index of the cited block range in the source's `content`
1021
+ * array.
1022
+ *
1023
+ * Always greater than `start_block_index`; a single-block citation has
1024
+ * `end_block_index = start_block_index + 1`.
1025
+ */
1026
+ end_block_index: number;
1027
+ /**
1028
+ * 0-based index of the first cited block in the source's `content` array.
1029
+ */
1030
+ start_block_index: number;
1031
+ type: 'content_block_location';
1032
+ }
1033
+ export interface CitationPageLocation {
1034
+ cited_text: string;
1035
+ document_index: number;
1036
+ document_title: string | null;
1037
+ end_page_number: number;
1038
+ file_id: string | null;
1039
+ start_page_number: number;
1040
+ type: 'page_location';
1041
+ }
1042
+ export interface CitationPageLocationParam {
1043
+ cited_text: string;
1044
+ document_index: number;
1045
+ document_title: string | null;
1046
+ end_page_number: number;
1047
+ start_page_number: number;
1048
+ type: 'page_location';
1049
+ }
1050
+ export interface CitationSearchResultLocationParam {
1051
+ /**
1052
+ * The full text of the cited block range, concatenated.
1053
+ *
1054
+ * Always equals the contents of `content[start_block_index:end_block_index]`
1055
+ * joined together. The text block is the minimal citable unit; this field is never
1056
+ * a substring of a single block. Not counted toward output tokens, and not counted
1057
+ * toward input tokens when sent back in subsequent turns.
1058
+ */
1059
+ cited_text: string;
1060
+ /**
1061
+ * Exclusive 0-based end index of the cited block range in the source's `content`
1062
+ * array.
1063
+ *
1064
+ * Always greater than `start_block_index`; a single-block citation has
1065
+ * `end_block_index = start_block_index + 1`.
1066
+ */
1067
+ end_block_index: number;
1068
+ /**
1069
+ * 0-based index of the cited search result among all `search_result` content
1070
+ * blocks in the request, in the order they appear across messages and tool
1071
+ * results.
1072
+ *
1073
+ * Counted separately from `document_index`; server-side web search results are not
1074
+ * included in this count.
1075
+ */
1076
+ search_result_index: number;
1077
+ source: string;
1078
+ /**
1079
+ * 0-based index of the first cited block in the source's `content` array.
1080
+ */
1081
+ start_block_index: number;
1082
+ title: string | null;
1083
+ type: 'search_result_location';
1084
+ }
1085
+ export interface CitationWebSearchResultLocationParam {
1086
+ cited_text: string;
1087
+ encrypted_index: string;
1088
+ title: string | null;
1089
+ type: 'web_search_result_location';
1090
+ url: string;
1091
+ }
1092
+ export interface CitationsConfig {
1093
+ enabled: boolean;
1094
+ }
1095
+ export interface CitationsConfigParam {
1096
+ enabled?: boolean;
1097
+ }
1098
+ export interface CitationsDelta {
1099
+ citation: CitationCharLocation | CitationPageLocation | CitationContentBlockLocation | CitationsWebSearchResultLocation | CitationsSearchResultLocation;
1100
+ type: 'citations_delta';
1101
+ }
1102
+ export interface CitationsSearchResultLocation {
1103
+ /**
1104
+ * The full text of the cited block range, concatenated.
1105
+ *
1106
+ * Always equals the contents of `content[start_block_index:end_block_index]`
1107
+ * joined together. The text block is the minimal citable unit; this field is never
1108
+ * a substring of a single block. Not counted toward output tokens, and not counted
1109
+ * toward input tokens when sent back in subsequent turns.
1110
+ */
1111
+ cited_text: string;
1112
+ /**
1113
+ * Exclusive 0-based end index of the cited block range in the source's `content`
1114
+ * array.
1115
+ *
1116
+ * Always greater than `start_block_index`; a single-block citation has
1117
+ * `end_block_index = start_block_index + 1`.
1118
+ */
1119
+ end_block_index: number;
1120
+ /**
1121
+ * 0-based index of the cited search result among all `search_result` content
1122
+ * blocks in the request, in the order they appear across messages and tool
1123
+ * results.
1124
+ *
1125
+ * Counted separately from `document_index`; server-side web search results are not
1126
+ * included in this count.
1127
+ */
1128
+ search_result_index: number;
1129
+ source: string;
1130
+ /**
1131
+ * 0-based index of the first cited block in the source's `content` array.
1132
+ */
1133
+ start_block_index: number;
1134
+ title: string | null;
1135
+ type: 'search_result_location';
1136
+ }
1137
+ export interface CitationsWebSearchResultLocation {
1138
+ cited_text: string;
1139
+ encrypted_index: string;
1140
+ title: string | null;
1141
+ type: 'web_search_result_location';
1142
+ url: string;
1143
+ }
1144
+ export interface CodeExecutionOutputBlock {
1145
+ file_id: string;
1146
+ type: 'code_execution_output';
1147
+ }
1148
+ export interface CodeExecutionOutputBlockParam {
1149
+ file_id: string;
1150
+ type: 'code_execution_output';
1151
+ }
1152
+ export interface CodeExecutionResultBlock {
1153
+ content: Array<CodeExecutionOutputBlock>;
1154
+ return_code: number;
1155
+ stderr: string;
1156
+ stdout: string;
1157
+ type: 'code_execution_result';
1158
+ }
1159
+ export interface CodeExecutionResultBlockParam {
1160
+ content: Array<CodeExecutionOutputBlockParam>;
1161
+ return_code: number;
1162
+ stderr: string;
1163
+ stdout: string;
1164
+ type: 'code_execution_result';
1165
+ }
1166
+ export interface CodeExecutionTool20250522 {
1167
+ /**
1168
+ * Name of the tool.
1169
+ *
1170
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1171
+ */
1172
+ name: 'code_execution';
1173
+ type: 'code_execution_20250522';
1174
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
1175
+ /**
1176
+ * Create a cache control breakpoint at this content block.
1177
+ */
1178
+ cache_control?: CacheControlEphemeral | null;
1179
+ /**
1180
+ * If true, tool will not be included in initial system prompt. Only loaded when
1181
+ * returned via tool_reference from tool search.
1182
+ */
1183
+ defer_loading?: boolean;
1184
+ /**
1185
+ * When true, guarantees schema validation on tool names and inputs
1186
+ */
1187
+ strict?: boolean;
1188
+ }
1189
+ export interface CodeExecutionTool20250825 {
1190
+ /**
1191
+ * Name of the tool.
1192
+ *
1193
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1194
+ */
1195
+ name: 'code_execution';
1196
+ type: 'code_execution_20250825';
1197
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
1198
+ /**
1199
+ * Create a cache control breakpoint at this content block.
1200
+ */
1201
+ cache_control?: CacheControlEphemeral | null;
1202
+ /**
1203
+ * If true, tool will not be included in initial system prompt. Only loaded when
1204
+ * returned via tool_reference from tool search.
1205
+ */
1206
+ defer_loading?: boolean;
1207
+ /**
1208
+ * When true, guarantees schema validation on tool names and inputs
1209
+ */
1210
+ strict?: boolean;
1211
+ }
1212
+ /**
1213
+ * Code execution tool with REPL state persistence (daemon mode + gVisor
1214
+ * checkpoint).
1215
+ */
1216
+ export interface CodeExecutionTool20260120 {
1217
+ /**
1218
+ * Name of the tool.
1219
+ *
1220
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1221
+ */
1222
+ name: 'code_execution';
1223
+ type: 'code_execution_20260120';
1224
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
1225
+ /**
1226
+ * Create a cache control breakpoint at this content block.
1227
+ */
1228
+ cache_control?: CacheControlEphemeral | null;
1229
+ /**
1230
+ * If true, tool will not be included in initial system prompt. Only loaded when
1231
+ * returned via tool_reference from tool search.
1232
+ */
1233
+ defer_loading?: boolean;
1234
+ /**
1235
+ * When true, guarantees schema validation on tool names and inputs
1236
+ */
1237
+ strict?: boolean;
1238
+ }
1239
+ /**
1240
+ * Code execution tool with REPL state persistence.
1241
+ */
1242
+ export interface CodeExecutionTool20260521 {
1243
+ /**
1244
+ * Name of the tool.
1245
+ *
1246
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1247
+ */
1248
+ name: 'code_execution';
1249
+ type: 'code_execution_20260521';
1250
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
1251
+ /**
1252
+ * Create a cache control breakpoint at this content block.
1253
+ */
1254
+ cache_control?: CacheControlEphemeral | null;
1255
+ /**
1256
+ * If true, tool will not be included in initial system prompt. Only loaded when
1257
+ * returned via tool_reference from tool search.
1258
+ */
1259
+ defer_loading?: boolean;
1260
+ /**
1261
+ * When true, guarantees schema validation on tool names and inputs
1262
+ */
1263
+ strict?: boolean;
1264
+ }
1265
+ export interface CodeExecutionToolResultBlock {
1266
+ /**
1267
+ * Code execution result with encrypted stdout for PFC + web_search results.
1268
+ */
1269
+ content: CodeExecutionToolResultBlockContent;
1270
+ tool_use_id: string;
1271
+ type: 'code_execution_tool_result';
1272
+ }
1273
+ /**
1274
+ * Code execution result with encrypted stdout for PFC + web_search results.
1275
+ */
1276
+ export type CodeExecutionToolResultBlockContent = CodeExecutionToolResultError | CodeExecutionResultBlock | EncryptedCodeExecutionResultBlock;
1277
+ export interface CodeExecutionToolResultBlockParam {
1278
+ /**
1279
+ * Code execution result with encrypted stdout for PFC + web_search results.
1280
+ */
1281
+ content: CodeExecutionToolResultBlockParamContent;
1282
+ tool_use_id: string;
1283
+ type: 'code_execution_tool_result';
1284
+ /**
1285
+ * Create a cache control breakpoint at this content block.
1286
+ */
1287
+ cache_control?: CacheControlEphemeral | null;
1288
+ }
1289
+ /**
1290
+ * Code execution result with encrypted stdout for PFC + web_search results.
1291
+ */
1292
+ export type CodeExecutionToolResultBlockParamContent = CodeExecutionToolResultErrorParam | CodeExecutionResultBlockParam | EncryptedCodeExecutionResultBlockParam;
1293
+ export interface CodeExecutionToolResultError {
1294
+ error_code: CodeExecutionToolResultErrorCode;
1295
+ type: 'code_execution_tool_result_error';
1296
+ }
1297
+ export type CodeExecutionToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded';
1298
+ export interface CodeExecutionToolResultErrorParam {
1299
+ error_code: CodeExecutionToolResultErrorCode;
1300
+ type: 'code_execution_tool_result_error';
1301
+ }
1302
+ /**
1303
+ * `cursor_position`'s config overrides.
1304
+ */
1305
+ export interface ComputerCursorPositionConfig {
1306
+ /**
1307
+ * Defer loading for this member. Must resolve to the same value on every enabled
1308
+ * member of the toolset.
1309
+ */
1310
+ defer_loading?: boolean | null;
1311
+ /**
1312
+ * Whether this member is offered to the model. Default is per member, per the
1313
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1314
+ * the served schema.
1315
+ */
1316
+ enabled?: boolean | null;
1317
+ }
1318
+ /**
1319
+ * `double_click`'s config overrides.
1320
+ */
1321
+ export interface ComputerDoubleClickConfig {
1322
+ /**
1323
+ * Defer loading for this member. Must resolve to the same value on every enabled
1324
+ * member of the toolset.
1325
+ */
1326
+ defer_loading?: boolean | null;
1327
+ /**
1328
+ * Whether this member is offered to the model. Default is per member, per the
1329
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1330
+ * the served schema.
1331
+ */
1332
+ enabled?: boolean | null;
1333
+ }
1334
+ /**
1335
+ * `hold_key`'s config overrides.
1336
+ */
1337
+ export interface ComputerHoldKeyConfig {
1338
+ /**
1339
+ * Defer loading for this member. Must resolve to the same value on every enabled
1340
+ * member of the toolset.
1341
+ */
1342
+ defer_loading?: boolean | null;
1343
+ /**
1344
+ * Whether this member is offered to the model. Default is per member, per the
1345
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1346
+ * the served schema.
1347
+ */
1348
+ enabled?: boolean | null;
1349
+ }
1350
+ /**
1351
+ * `key`'s config overrides.
1352
+ */
1353
+ export interface ComputerKeyConfig {
1354
+ /**
1355
+ * Defer loading for this member. Must resolve to the same value on every enabled
1356
+ * member of the toolset.
1357
+ */
1358
+ defer_loading?: boolean | null;
1359
+ /**
1360
+ * Whether this member is offered to the model. Default is per member, per the
1361
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1362
+ * the served schema.
1363
+ */
1364
+ enabled?: boolean | null;
1365
+ }
1366
+ /**
1367
+ * `left_click`'s config overrides.
1368
+ */
1369
+ export interface ComputerLeftClickConfig {
1370
+ /**
1371
+ * Defer loading for this member. Must resolve to the same value on every enabled
1372
+ * member of the toolset.
1373
+ */
1374
+ defer_loading?: boolean | null;
1375
+ /**
1376
+ * Whether this member is offered to the model. Default is per member, per the
1377
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1378
+ * the served schema.
1379
+ */
1380
+ enabled?: boolean | null;
1381
+ }
1382
+ /**
1383
+ * `left_click_drag`'s config overrides.
1384
+ */
1385
+ export interface ComputerLeftClickDragConfig {
1386
+ /**
1387
+ * Defer loading for this member. Must resolve to the same value on every enabled
1388
+ * member of the toolset.
1389
+ */
1390
+ defer_loading?: boolean | null;
1391
+ /**
1392
+ * Whether this member is offered to the model. Default is per member, per the
1393
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1394
+ * the served schema.
1395
+ */
1396
+ enabled?: boolean | null;
1397
+ }
1398
+ /**
1399
+ * `left_mouse_down`'s config overrides.
1400
+ */
1401
+ export interface ComputerLeftMouseDownConfig {
1402
+ /**
1403
+ * Defer loading for this member. Must resolve to the same value on every enabled
1404
+ * member of the toolset.
1405
+ */
1406
+ defer_loading?: boolean | null;
1407
+ /**
1408
+ * Whether this member is offered to the model. Default is per member, per the
1409
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1410
+ * the served schema.
1411
+ */
1412
+ enabled?: boolean | null;
1413
+ }
1414
+ /**
1415
+ * `left_mouse_up`'s config overrides.
1416
+ */
1417
+ export interface ComputerLeftMouseUpConfig {
1418
+ /**
1419
+ * Defer loading for this member. Must resolve to the same value on every enabled
1420
+ * member of the toolset.
1421
+ */
1422
+ defer_loading?: boolean | null;
1423
+ /**
1424
+ * Whether this member is offered to the model. Default is per member, per the
1425
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1426
+ * the served schema.
1427
+ */
1428
+ enabled?: boolean | null;
1429
+ }
1430
+ /**
1431
+ * `middle_click`'s config overrides.
1432
+ */
1433
+ export interface ComputerMiddleClickConfig {
1434
+ /**
1435
+ * Defer loading for this member. Must resolve to the same value on every enabled
1436
+ * member of the toolset.
1437
+ */
1438
+ defer_loading?: boolean | null;
1439
+ /**
1440
+ * Whether this member is offered to the model. Default is per member, per the
1441
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1442
+ * the served schema.
1443
+ */
1444
+ enabled?: boolean | null;
1445
+ }
1446
+ /**
1447
+ * `mouse_move`'s config overrides.
1448
+ */
1449
+ export interface ComputerMouseMoveConfig {
1450
+ /**
1451
+ * Defer loading for this member. Must resolve to the same value on every enabled
1452
+ * member of the toolset.
1453
+ */
1454
+ defer_loading?: boolean | null;
1455
+ /**
1456
+ * Whether this member is offered to the model. Default is per member, per the
1457
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1458
+ * the served schema.
1459
+ */
1460
+ enabled?: boolean | null;
1461
+ }
1462
+ /**
1463
+ * `right_click`'s config overrides.
1464
+ */
1465
+ export interface ComputerRightClickConfig {
1466
+ /**
1467
+ * Defer loading for this member. Must resolve to the same value on every enabled
1468
+ * member of the toolset.
1469
+ */
1470
+ defer_loading?: boolean | null;
1471
+ /**
1472
+ * Whether this member is offered to the model. Default is per member, per the
1473
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1474
+ * the served schema.
1475
+ */
1476
+ enabled?: boolean | null;
1477
+ }
1478
+ /**
1479
+ * `screenshot`'s config overrides.
1480
+ */
1481
+ export interface ComputerScreenshotConfig {
1482
+ /**
1483
+ * Defer loading for this member. Must resolve to the same value on every enabled
1484
+ * member of the toolset.
1485
+ */
1486
+ defer_loading?: boolean | null;
1487
+ /**
1488
+ * Whether this member is offered to the model. Default is per member, per the
1489
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1490
+ * the served schema.
1491
+ */
1492
+ enabled?: boolean | null;
1493
+ }
1494
+ /**
1495
+ * `scroll`'s config overrides.
1496
+ */
1497
+ export interface ComputerScrollConfig {
1498
+ /**
1499
+ * Defer loading for this member. Must resolve to the same value on every enabled
1500
+ * member of the toolset.
1501
+ */
1502
+ defer_loading?: boolean | null;
1503
+ /**
1504
+ * Whether this member is offered to the model. Default is per member, per the
1505
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1506
+ * the served schema.
1507
+ */
1508
+ enabled?: boolean | null;
1509
+ }
1510
+ /**
1511
+ * The computer toolset: a single `tools[]` entry (carrying no `name`) that
1512
+ * declares the computer tool family. The model is served the family's tool with
1513
+ * any members disabled via `configs` removed from its schema. Every member is
1514
+ * enabled by default, zoom included. The single-tool options `display_number` and
1515
+ * `enable_zoom` are not fields of a toolset entry — it carries only `type`,
1516
+ * `configs`, and `cache_control`; zoom is controlled via `configs.zoom.enabled`.
1517
+ */
1518
+ export interface ComputerToolset20260801 {
1519
+ type: 'computer_toolset_20260801';
1520
+ /**
1521
+ * Create a cache control breakpoint at this content block.
1522
+ */
1523
+ cache_control?: CacheControlEphemeral | null;
1524
+ /**
1525
+ * Per-member configuration for `computer_toolset_20260801`: one optional field per
1526
+ * member tool, keyed by the member name — the same name the member's `tool_use`
1527
+ * blocks carry. Every member is an accepted key, and a member's defaults apply
1528
+ * wherever its key is absent. Unknown keys are rejected: the field set is this
1529
+ * toolset version's complete member set.
1530
+ */
1531
+ configs?: ComputerToolsetConfigs | null;
1532
+ }
1533
+ /**
1534
+ * Per-member configuration for `computer_toolset_20260801`: one optional field per
1535
+ * member tool, keyed by the member name — the same name the member's `tool_use`
1536
+ * blocks carry. Every member is an accepted key, and a member's defaults apply
1537
+ * wherever its key is absent. Unknown keys are rejected: the field set is this
1538
+ * toolset version's complete member set.
1539
+ */
1540
+ export interface ComputerToolsetConfigs {
1541
+ /**
1542
+ * `cursor_position`'s config overrides.
1543
+ */
1544
+ cursor_position?: ComputerCursorPositionConfig | null;
1545
+ /**
1546
+ * `double_click`'s config overrides.
1547
+ */
1548
+ double_click?: ComputerDoubleClickConfig | null;
1549
+ /**
1550
+ * `hold_key`'s config overrides.
1551
+ */
1552
+ hold_key?: ComputerHoldKeyConfig | null;
1553
+ /**
1554
+ * `key`'s config overrides.
1555
+ */
1556
+ key?: ComputerKeyConfig | null;
1557
+ /**
1558
+ * `left_click`'s config overrides.
1559
+ */
1560
+ left_click?: ComputerLeftClickConfig | null;
1561
+ /**
1562
+ * `left_click_drag`'s config overrides.
1563
+ */
1564
+ left_click_drag?: ComputerLeftClickDragConfig | null;
1565
+ /**
1566
+ * `left_mouse_down`'s config overrides.
1567
+ */
1568
+ left_mouse_down?: ComputerLeftMouseDownConfig | null;
1569
+ /**
1570
+ * `left_mouse_up`'s config overrides.
1571
+ */
1572
+ left_mouse_up?: ComputerLeftMouseUpConfig | null;
1573
+ /**
1574
+ * `middle_click`'s config overrides.
1575
+ */
1576
+ middle_click?: ComputerMiddleClickConfig | null;
1577
+ /**
1578
+ * `mouse_move`'s config overrides.
1579
+ */
1580
+ mouse_move?: ComputerMouseMoveConfig | null;
1581
+ /**
1582
+ * `right_click`'s config overrides.
1583
+ */
1584
+ right_click?: ComputerRightClickConfig | null;
1585
+ /**
1586
+ * `screenshot`'s config overrides.
1587
+ */
1588
+ screenshot?: ComputerScreenshotConfig | null;
1589
+ /**
1590
+ * `scroll`'s config overrides.
1591
+ */
1592
+ scroll?: ComputerScrollConfig | null;
1593
+ /**
1594
+ * `triple_click`'s config overrides.
1595
+ */
1596
+ triple_click?: ComputerTripleClickConfig | null;
1597
+ /**
1598
+ * `type`'s config overrides.
1599
+ */
1600
+ type?: ComputerTypeConfig | null;
1601
+ /**
1602
+ * `wait`'s config overrides.
1603
+ */
1604
+ wait?: ComputerWaitConfig | null;
1605
+ /**
1606
+ * `zoom`'s config overrides.
1607
+ */
1608
+ zoom?: ComputerZoomConfig | null;
1609
+ }
1610
+ /**
1611
+ * `triple_click`'s config overrides.
1612
+ */
1613
+ export interface ComputerTripleClickConfig {
1614
+ /**
1615
+ * Defer loading for this member. Must resolve to the same value on every enabled
1616
+ * member of the toolset.
1617
+ */
1618
+ defer_loading?: boolean | null;
1619
+ /**
1620
+ * Whether this member is offered to the model. Default is per member, per the
1621
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1622
+ * the served schema.
1623
+ */
1624
+ enabled?: boolean | null;
1625
+ }
1626
+ /**
1627
+ * `type`'s config overrides.
1628
+ */
1629
+ export interface ComputerTypeConfig {
1630
+ /**
1631
+ * Defer loading for this member. Must resolve to the same value on every enabled
1632
+ * member of the toolset.
1633
+ */
1634
+ defer_loading?: boolean | null;
1635
+ /**
1636
+ * Whether this member is offered to the model. Default is per member, per the
1637
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1638
+ * the served schema.
1639
+ */
1640
+ enabled?: boolean | null;
1641
+ }
1642
+ /**
1643
+ * `wait`'s config overrides.
1644
+ */
1645
+ export interface ComputerWaitConfig {
1646
+ /**
1647
+ * Defer loading for this member. Must resolve to the same value on every enabled
1648
+ * member of the toolset.
1649
+ */
1650
+ defer_loading?: boolean | null;
1651
+ /**
1652
+ * Whether this member is offered to the model. Default is per member, per the
1653
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1654
+ * the served schema.
1655
+ */
1656
+ enabled?: boolean | null;
1657
+ }
1658
+ /**
1659
+ * `zoom`'s config overrides.
1660
+ */
1661
+ export interface ComputerZoomConfig {
1662
+ /**
1663
+ * Defer loading for this member. Must resolve to the same value on every enabled
1664
+ * member of the toolset.
1665
+ */
1666
+ defer_loading?: boolean | null;
1667
+ /**
1668
+ * Whether this member is offered to the model. Default is per member, per the
1669
+ * toolset's documentation. A member whose enabled resolves false is withheld from
1670
+ * the served schema.
1671
+ */
1672
+ enabled?: boolean | null;
1673
+ }
1674
+ /**
1675
+ * Information about the container used in the request (for the code execution
1676
+ * tool)
1677
+ */
1678
+ export interface Container {
1679
+ /**
1680
+ * Identifier for the container used in this request
1681
+ */
1682
+ id: string;
1683
+ /**
1684
+ * The time at which the container will expire.
1685
+ */
1686
+ expires_at: string;
1687
+ /**
1688
+ * Skills loaded in the container
1689
+ */
1690
+ skills: Array<ContainerSkill> | null;
1691
+ }
1692
+ /**
1693
+ * Container parameters with skills to be loaded.
1694
+ */
1695
+ export interface ContainerParams {
1696
+ /**
1697
+ * Container id
1698
+ */
1699
+ id?: string | null;
1700
+ /**
1701
+ * List of skills to load in the container
1702
+ */
1703
+ skills?: Array<SkillParams> | null;
1704
+ }
1705
+ /**
1706
+ * A skill that was loaded in a container (response model).
1707
+ */
1708
+ export interface ContainerSkill {
1709
+ /**
1710
+ * Skill ID
1711
+ */
1712
+ skill_id: string;
1713
+ /**
1714
+ * Type of skill - either 'puku' (built-in) or 'custom' (user-defined)
1715
+ */
1716
+ type: 'puku' | 'custom';
1717
+ /**
1718
+ * The resolved version: a skill version ID for custom skills.
1719
+ */
1720
+ version: string;
1721
+ }
1722
+ /**
1723
+ * Response model for a file uploaded to the container.
1724
+ */
1725
+ export interface ContainerUploadBlock {
1726
+ file_id: string;
1727
+ type: 'container_upload';
1728
+ }
1729
+ /**
1730
+ * A content block that represents a file to be uploaded to the container Files
1731
+ * uploaded via this block will be available in the container's input directory.
1732
+ */
1733
+ export interface ContainerUploadBlockParam {
1734
+ file_id: string;
1735
+ type: 'container_upload';
1736
+ /**
1737
+ * Create a cache control breakpoint at this content block.
1738
+ */
1739
+ cache_control?: CacheControlEphemeral | null;
1740
+ }
1741
+ /**
1742
+ * Response model for a file uploaded to the container.
1743
+ */
1744
+ export type ContentBlock = TextBlock | ThinkingBlock | RedactedThinkingBlock | ToolUseBlock | ServerToolUseBlock | WebSearchToolResultBlock | WebFetchToolResultBlock | CodeExecutionToolResultBlock | BashCodeExecutionToolResultBlock | TextEditorCodeExecutionToolResultBlock | ToolSearchToolResultBlock | ContainerUploadBlock;
1745
+ /**
1746
+ * Regular text content.
1747
+ */
1748
+ export type ContentBlockParam = TextBlockParam | ImageBlockParam | DocumentBlockParam | SearchResultBlockParam | ThinkingBlockParam | RedactedThinkingBlockParam | ToolUseBlockParam | ToolResultBlockParam | ServerToolUseBlockParam | WebSearchToolResultBlockParam | WebFetchToolResultBlockParam | CodeExecutionToolResultBlockParam | BashCodeExecutionToolResultBlockParam | TextEditorCodeExecutionToolResultBlockParam | ToolSearchToolResultBlockParam | ContainerUploadBlockParam;
1749
+ export interface ContentBlockSource {
1750
+ content: string | Array<ContentBlockSourceContent>;
1751
+ type: 'content';
1752
+ }
1753
+ export type ContentBlockSourceContent = TextBlockParam | ImageBlockParam;
1754
+ /**
1755
+ * Tool invocation directly from the model.
1756
+ */
1757
+ export interface DirectCaller {
1758
+ type: 'direct';
1759
+ }
1760
+ export interface DocumentBlock {
1761
+ /**
1762
+ * Citation configuration for the document
1763
+ */
1764
+ citations: CitationsConfig | null;
1765
+ source: Base64PDFSource | PlainTextSource;
1766
+ /**
1767
+ * The title of the document
1768
+ */
1769
+ title: string | null;
1770
+ type: 'document';
1771
+ }
1772
+ export interface DocumentBlockParam {
1773
+ source: Base64PDFSource | PlainTextSource | ContentBlockSource | URLPDFSource | FileDocumentSource;
1774
+ type: 'document';
1775
+ /**
1776
+ * Create a cache control breakpoint at this content block.
1777
+ */
1778
+ cache_control?: CacheControlEphemeral | null;
1779
+ citations?: CitationsConfigParam | null;
1780
+ context?: string | null;
1781
+ title?: string | null;
1782
+ }
1783
+ /**
1784
+ * Code execution result with encrypted stdout for PFC + web_search results.
1785
+ */
1786
+ export interface EncryptedCodeExecutionResultBlock {
1787
+ content: Array<CodeExecutionOutputBlock>;
1788
+ encrypted_stdout: string;
1789
+ return_code: number;
1790
+ stderr: string;
1791
+ type: 'encrypted_code_execution_result';
1792
+ }
1793
+ /**
1794
+ * Code execution result with encrypted stdout for PFC + web_search results.
1795
+ */
1796
+ export interface EncryptedCodeExecutionResultBlockParam {
1797
+ content: Array<CodeExecutionOutputBlockParam>;
1798
+ encrypted_stdout: string;
1799
+ return_code: number;
1800
+ stderr: string;
1801
+ type: 'encrypted_code_execution_result';
1802
+ }
1803
+ export interface FileDocumentSource {
1804
+ file_id: string;
1805
+ type: 'file';
1806
+ }
1807
+ export interface FileImageSource {
1808
+ file_id: string;
1809
+ type: 'file';
1810
+ }
1811
+ export interface ImageBlockParam {
1812
+ source: Base64ImageSource | URLImageSource | FileImageSource;
1813
+ type: 'image';
1814
+ /**
1815
+ * Create a cache control breakpoint at this content block.
1816
+ */
1817
+ cache_control?: CacheControlEphemeral | null;
1818
+ /**
1819
+ * Configures the transformations the server applies to this image before the model
1820
+ * observes it. Each key names a condition the server transforms images for; its
1821
+ * value selects the transformation applied. Omitted keys keep their default
1822
+ * behavior, and an empty object is equivalent to omitting the field.
1823
+ */
1824
+ transformations?: ImageTransformationsParam | null;
1825
+ }
1826
+ /**
1827
+ * Configures the transformations the server applies to this image before the model
1828
+ * observes it. Each key names a condition the server transforms images for; its
1829
+ * value selects the transformation applied. Omitted keys keep their default
1830
+ * behavior, and an empty object is equivalent to omitting the field.
1831
+ */
1832
+ export interface ImageTransformationsParam {
1833
+ /**
1834
+ * What the server does when this image exceeds the model's maximum image size.
1835
+ * `"downsize"` (the default) scales the image down to fit, which changes the
1836
+ * dimensions the model observes without telling you. `"error"` instead rejects the
1837
+ * request with a 400 error naming the image's dimensions and the largest
1838
+ * dimensions that fit, so you can scale the image deliberately — your image is
1839
+ * never silently scaled down.
1840
+ */
1841
+ oversized_image?: 'downsize' | 'error';
1842
+ }
1843
+ export interface InputJSONDelta {
1844
+ partial_json: string;
1845
+ type: 'input_json_delta';
1846
+ }
1847
+ export interface JSONOutputFormat {
1848
+ /**
1849
+ * The JSON schema of the format
1850
+ */
1851
+ schema: {
1852
+ [key: string]: unknown;
1853
+ };
1854
+ type: 'json_schema';
1855
+ }
1856
+ export interface MemoryTool20250818 {
1857
+ /**
1858
+ * Name of the tool.
1859
+ *
1860
+ * This is how the tool will be called by the model and in `tool_use` blocks.
1861
+ */
1862
+ name: 'memory';
1863
+ type: 'memory_20250818';
1864
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
1865
+ /**
1866
+ * Create a cache control breakpoint at this content block.
1867
+ */
1868
+ cache_control?: CacheControlEphemeral | null;
1869
+ /**
1870
+ * If true, tool will not be included in initial system prompt. Only loaded when
1871
+ * returned via tool_reference from tool search.
1872
+ */
1873
+ defer_loading?: boolean;
1874
+ input_examples?: Array<{
1875
+ [key: string]: unknown;
1876
+ }>;
1877
+ /**
1878
+ * When true, guarantees schema validation on tool names and inputs
1879
+ */
1880
+ strict?: boolean;
1881
+ }
1882
+ export interface Message {
1883
+ /**
1884
+ * Unique object identifier.
1885
+ *
1886
+ * The format and length of IDs may change over time.
1887
+ */
1888
+ id: string;
1889
+ /**
1890
+ * Information about the container used in the request (for the code execution
1891
+ * tool)
1892
+ */
1893
+ container: Container | null;
1894
+ /**
1895
+ * Content generated by the model.
1896
+ *
1897
+ * This is an array of content blocks, each of which has a `type` that determines
1898
+ * its shape.
1899
+ *
1900
+ * Example:
1901
+ *
1902
+ * ```json
1903
+ * [{ "type": "text", "text": "Hi, I'm Puku." }]
1904
+ * ```
1905
+ *
1906
+ * If the request input `messages` ended with an `assistant` turn, then the
1907
+ * response `content` will continue directly from that last turn. You can use this
1908
+ * to constrain the model's output.
1909
+ *
1910
+ * For example, if the input `messages` were:
1911
+ *
1912
+ * ```json
1913
+ * [
1914
+ * {
1915
+ * "role": "user",
1916
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
1917
+ * },
1918
+ * { "role": "assistant", "content": "The best answer is (" }
1919
+ * ]
1920
+ * ```
1921
+ *
1922
+ * Then the response `content` might be:
1923
+ *
1924
+ * ```json
1925
+ * [{ "type": "text", "text": "B)" }]
1926
+ * ```
1927
+ */
1928
+ content: Array<ContentBlock>;
1929
+ /**
1930
+ * The model that will complete your prompt.
1931
+ *
1932
+ * See [models](https://docs.puku.com/en/docs/models-overview) for additional
1933
+ * details and options.
1934
+ */
1935
+ model: Model;
1936
+ /**
1937
+ * Conversational role of the generated message.
1938
+ *
1939
+ * This will always be `"assistant"`.
1940
+ */
1941
+ role: 'assistant';
1942
+ /**
1943
+ * Structured information about a refusal.
1944
+ */
1945
+ stop_details: RefusalStopDetails | null;
1946
+ /**
1947
+ * The reason that we stopped.
1948
+ *
1949
+ * This may be one the following values:
1950
+ *
1951
+ * - `"end_turn"`: the model reached a natural stopping point
1952
+ * - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
1953
+ * - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
1954
+ * - `"tool_use"`: the model invoked one or more tools
1955
+ * - `"pause_turn"`: we paused a long-running turn. You may provide the response
1956
+ * back as-is in a subsequent request to let the model continue.
1957
+ * - `"refusal"`: when streaming classifiers intervene to handle potential policy
1958
+ * violations
1959
+ * - `"model_context_window_exceeded"`: we exceeded the model's context window
1960
+ *
1961
+ * In non-streaming mode this value is always non-null. In streaming mode, it is
1962
+ * null in the `message_start` event and non-null otherwise.
1963
+ */
1964
+ stop_reason: StopReason | null;
1965
+ /**
1966
+ * Which custom stop sequence was generated, if any.
1967
+ *
1968
+ * This value will be a non-null string if one of your custom stop sequences was
1969
+ * generated.
1970
+ */
1971
+ stop_sequence: string | null;
1972
+ /**
1973
+ * Object type.
1974
+ *
1975
+ * For Messages, this is always `"message"`.
1976
+ */
1977
+ type: 'message';
1978
+ /**
1979
+ * Billing and rate-limit usage.
1980
+ *
1981
+ * PukuAI's API bills and rate-limits by token counts, as tokens represent the
1982
+ * underlying cost to our systems.
1983
+ *
1984
+ * Under the hood, the API transforms requests into a format suitable for the
1985
+ * model. The model's output then goes through a parsing stage before becoming an
1986
+ * API response. As a result, the token counts in `usage` will not match one-to-one
1987
+ * with the exact visible content of an API request or response.
1988
+ *
1989
+ * For example, `output_tokens` will be non-zero, even for an empty string response
1990
+ * from Puku.
1991
+ *
1992
+ * Total input tokens in a request is the summation of `input_tokens`,
1993
+ * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
1994
+ */
1995
+ usage: Usage;
1996
+ }
1997
+ /**
1998
+ * Code execution tool with REPL state persistence (daemon mode + gVisor
1999
+ * checkpoint).
2000
+ */
2001
+ export type MessageCountTokensTool = Tool | ToolBash20250124 | CodeExecutionTool20250522 | CodeExecutionTool20250825 | CodeExecutionTool20260120 | CodeExecutionTool20260521 | BrowserToolset20260801 | MemoryTool20250818 | ComputerToolset20260801 | ToolTextEditor20250124 | ToolTextEditor20250429 | ToolTextEditor20250728 | WebSearchTool20250305 | WebFetchTool20250910 | WebSearchTool20260209 | WebFetchTool20260209 | WebFetchTool20260309 | WebSearchTool20260318 | WebFetchTool20260318 | ToolSearchToolBm25_20251119 | ToolSearchToolRegex20251119;
2002
+ /**
2003
+ * Container identifier for reuse across requests.
2004
+ */
2005
+ export type MessageCreateParamsContainer = ContainerParams | string;
2006
+ export interface MessageDeltaUsage {
2007
+ /**
2008
+ * The cumulative number of input tokens used to create the cache entry.
2009
+ */
2010
+ cache_creation_input_tokens: number | null;
2011
+ /**
2012
+ * The cumulative number of input tokens read from the cache.
2013
+ */
2014
+ cache_read_input_tokens: number | null;
2015
+ /**
2016
+ * The cumulative number of input tokens which were used.
2017
+ */
2018
+ input_tokens: number | null;
2019
+ /**
2020
+ * The cumulative number of output tokens which were used.
2021
+ */
2022
+ output_tokens: number;
2023
+ /**
2024
+ * Breakdown of output tokens by category.
2025
+ *
2026
+ * `output_tokens` remains the inclusive, authoritative total used for billing.
2027
+ * This object provides a read-only decomposition for observability — for example,
2028
+ * how many of the billed output tokens were spent on internal reasoning that may
2029
+ * have been summarized before being returned to you.
2030
+ */
2031
+ output_tokens_details: OutputTokensDetails | null;
2032
+ /**
2033
+ * The number of server tool requests.
2034
+ */
2035
+ server_tool_use: ServerToolUsage | null;
2036
+ }
2037
+ export interface MessageParam {
2038
+ content: string | Array<ContentBlockParam>;
2039
+ role: 'user' | 'assistant' | 'system';
2040
+ }
2041
+ export interface MessageTokensCount {
2042
+ /**
2043
+ * The total number of tokens across the provided list of messages, system prompt,
2044
+ * and tools.
2045
+ */
2046
+ input_tokens: number;
2047
+ }
2048
+ export interface Metadata {
2049
+ /**
2050
+ * An external identifier for the user who is associated with the request.
2051
+ *
2052
+ * This should be a uuid, hash value, or other opaque identifier. PukuAI may use
2053
+ * this id to help detect abuse. Do not include any identifying information such as
2054
+ * name, email address, or phone number.
2055
+ */
2056
+ user_id?: string | null;
2057
+ }
2058
+ /**
2059
+ * The model that will complete your prompt.
2060
+ *
2061
+ * See [models](https://docs.puku.com/en/docs/models-overview) for additional
2062
+ * details and options.
2063
+ */
2064
+ export type Model = 'puku-ai-2.7' | 'puku-ai-2.8' | 'opus-4.8' | (string & {});
2065
+ export interface OutputConfig {
2066
+ /**
2067
+ * All possible effort levels.
2068
+ */
2069
+ effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
2070
+ /**
2071
+ * A schema to specify Puku's output format in responses. See
2072
+ * [structured outputs](https://platform.puku.com/docs/en/build-with-puku/structured-outputs)
2073
+ */
2074
+ format?: JSONOutputFormat | null;
2075
+ }
2076
+ export interface OutputTokensDetails {
2077
+ /**
2078
+ * Number of output tokens the model generated as internal reasoning, including the
2079
+ * thinking-block delimiter tokens.
2080
+ *
2081
+ * Reflects the raw reasoning the model produced, not the (possibly shorter)
2082
+ * summarized thinking text returned in the response body. Computed by
2083
+ * re-tokenizing the raw reasoning text, so it may differ from the model's exact
2084
+ * generation count by a small number of tokens. Always ≤ `output_tokens`;
2085
+ * `output_tokens - thinking_tokens` approximates the non-reasoning output.
2086
+ */
2087
+ thinking_tokens: number;
2088
+ }
2089
+ export interface PlainTextSource {
2090
+ data: string;
2091
+ media_type: 'text/plain';
2092
+ type: 'text';
2093
+ }
2094
+ export type RawContentBlockDelta = TextDelta | InputJSONDelta | CitationsDelta | ThinkingDelta | SignatureDelta;
2095
+ export interface RawContentBlockDeltaEvent {
2096
+ delta: RawContentBlockDelta;
2097
+ index: number;
2098
+ type: 'content_block_delta';
2099
+ }
2100
+ export interface RawContentBlockStartEvent {
2101
+ /**
2102
+ * Response model for a file uploaded to the container.
2103
+ */
2104
+ content_block: TextBlock | ThinkingBlock | RedactedThinkingBlock | ToolUseBlock | ServerToolUseBlock | WebSearchToolResultBlock | WebFetchToolResultBlock | CodeExecutionToolResultBlock | BashCodeExecutionToolResultBlock | TextEditorCodeExecutionToolResultBlock | ToolSearchToolResultBlock | ContainerUploadBlock;
2105
+ index: number;
2106
+ type: 'content_block_start';
2107
+ }
2108
+ export interface RawContentBlockStopEvent {
2109
+ index: number;
2110
+ type: 'content_block_stop';
2111
+ }
2112
+ export interface RawMessageDeltaEvent {
2113
+ delta: RawMessageDeltaEvent.Delta;
2114
+ type: 'message_delta';
2115
+ /**
2116
+ * Billing and rate-limit usage.
2117
+ *
2118
+ * PukuAI's API bills and rate-limits by token counts, as tokens represent the
2119
+ * underlying cost to our systems.
2120
+ *
2121
+ * Under the hood, the API transforms requests into a format suitable for the
2122
+ * model. The model's output then goes through a parsing stage before becoming an
2123
+ * API response. As a result, the token counts in `usage` will not match one-to-one
2124
+ * with the exact visible content of an API request or response.
2125
+ *
2126
+ * For example, `output_tokens` will be non-zero, even for an empty string response
2127
+ * from Puku.
2128
+ *
2129
+ * Total input tokens in a request is the summation of `input_tokens`,
2130
+ * `cache_creation_input_tokens`, and `cache_read_input_tokens`.
2131
+ */
2132
+ usage: MessageDeltaUsage;
2133
+ }
2134
+ export declare namespace RawMessageDeltaEvent {
2135
+ interface Delta {
2136
+ /**
2137
+ * Information about the container used in the request (for the code execution
2138
+ * tool)
2139
+ */
2140
+ container: MessagesAPI.Container | null;
2141
+ /**
2142
+ * Structured information about a refusal.
2143
+ */
2144
+ stop_details: MessagesAPI.RefusalStopDetails | null;
2145
+ stop_reason: MessagesAPI.StopReason | null;
2146
+ stop_sequence: string | null;
2147
+ }
2148
+ }
2149
+ export interface RawMessageStartEvent {
2150
+ message: Message;
2151
+ type: 'message_start';
2152
+ }
2153
+ export interface RawMessageStopEvent {
2154
+ type: 'message_stop';
2155
+ }
2156
+ export type RawMessageStreamEvent = RawMessageStartEvent | RawMessageDeltaEvent | RawMessageStopEvent | RawContentBlockStartEvent | RawContentBlockDeltaEvent | RawContentBlockStopEvent;
2157
+ export interface RedactedThinkingBlock {
2158
+ /**
2159
+ * The contents of this redacted thinking block, returned when portions of the
2160
+ * model's thinking were safety-redacted. This field is opaque and encrypted, with
2161
+ * no readable content.
2162
+ *
2163
+ * Pass `redacted_thinking` blocks back to the API unchanged when continuing a
2164
+ * multi-turn conversation.
2165
+ *
2166
+ * See
2167
+ * [extended thinking](https://platform.puku.com/docs/en/build-with-puku/extended-thinking#redacted-thinking-blocks)
2168
+ * for details.
2169
+ */
2170
+ data: string;
2171
+ type: 'redacted_thinking';
2172
+ }
2173
+ export interface RedactedThinkingBlockParam {
2174
+ /**
2175
+ * The `data` value of this redacted thinking block, exactly as returned by the API
2176
+ * in a previous response. Opaque and encrypted; pass it back unchanged.
2177
+ */
2178
+ data: string;
2179
+ type: 'redacted_thinking';
2180
+ }
2181
+ /**
2182
+ * Structured information about a refusal.
2183
+ */
2184
+ export interface RefusalStopDetails {
2185
+ /**
2186
+ * The policy category that triggered a refusal.
2187
+ *
2188
+ * - `cyber` - The request could enable cyber harm, such as malware or exploit
2189
+ * development. Benign cybersecurity work can also trigger this category.
2190
+ * - `bio` - The request could enable biological harm, such as dangerous lab
2191
+ * methods. Beneficial life sciences work can also trigger this category.
2192
+ * - `frontier_llm` - The request could assist the development of competing AI
2193
+ * models, which is restricted under
2194
+ * [PukuAI's commercial terms](https://www.puku.com/legal/commercial-terms).
2195
+ * Benign machine learning work can also trigger this category.
2196
+ * - `reasoning_extraction` - The request asks the model to reproduce its internal
2197
+ * reasoning in the response text. To get reasoning in a structured form instead,
2198
+ * use
2199
+ * [adaptive thinking](https://platform.puku.com/docs/en/build-with-puku/adaptive-thinking).
2200
+ * - `general_harms` - The request could be related to an area that was determined
2201
+ * as harmful. Benign work might sometimes trigger this category.
2202
+ */
2203
+ category: 'cyber' | 'bio' | 'frontier_llm' | 'reasoning_extraction' | 'general_harms' | null;
2204
+ /**
2205
+ * Human-readable explanation of the refusal.
2206
+ *
2207
+ * This text is not guaranteed to be stable. `null` when no explanation is
2208
+ * available for the category.
2209
+ */
2210
+ explanation: string | null;
2211
+ type: 'refusal';
2212
+ }
2213
+ export interface SearchResultBlockParam {
2214
+ content: Array<TextBlockParam>;
2215
+ source: string;
2216
+ title: string;
2217
+ type: 'search_result';
2218
+ /**
2219
+ * Create a cache control breakpoint at this content block.
2220
+ */
2221
+ cache_control?: CacheControlEphemeral | null;
2222
+ citations?: CitationsConfigParam;
2223
+ }
2224
+ /**
2225
+ * Tool invocation generated by a server-side tool.
2226
+ */
2227
+ export interface ServerToolCaller {
2228
+ tool_id: string;
2229
+ type: 'code_execution_20250825';
2230
+ }
2231
+ export interface ServerToolCaller20260120 {
2232
+ tool_id: string;
2233
+ type: 'code_execution_20260120';
2234
+ }
2235
+ export interface ServerToolUsage {
2236
+ /**
2237
+ * The number of web fetch tool requests.
2238
+ */
2239
+ web_fetch_requests: number;
2240
+ /**
2241
+ * The number of web search tool requests.
2242
+ */
2243
+ web_search_requests: number;
2244
+ }
2245
+ export interface ServerToolUseBlock {
2246
+ id: string;
2247
+ /**
2248
+ * Tool invocation directly from the model.
2249
+ */
2250
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
2251
+ input: unknown;
2252
+ name: 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25';
2253
+ type: 'server_tool_use';
2254
+ }
2255
+ export interface ServerToolUseBlockParam {
2256
+ id: string;
2257
+ input: unknown;
2258
+ name: 'web_search' | 'web_fetch' | 'code_execution' | 'bash_code_execution' | 'text_editor_code_execution' | 'tool_search_tool_regex' | 'tool_search_tool_bm25';
2259
+ type: 'server_tool_use';
2260
+ /**
2261
+ * Create a cache control breakpoint at this content block.
2262
+ */
2263
+ cache_control?: CacheControlEphemeral | null;
2264
+ /**
2265
+ * Tool invocation directly from the model.
2266
+ */
2267
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
2268
+ }
2269
+ export interface SignatureDelta {
2270
+ /**
2271
+ * The `signature` for this thinking block: an opaque value used to verify that the
2272
+ * block was generated by Puku when it is passed back to the API. Delivered in a
2273
+ * `signature_delta` event just before the block's `content_block_stop` event.
2274
+ */
2275
+ signature: string;
2276
+ type: 'signature_delta';
2277
+ }
2278
+ /**
2279
+ * Specification for a skill to be loaded in a container (request model).
2280
+ */
2281
+ export interface SkillParams {
2282
+ /**
2283
+ * Skill ID
2284
+ */
2285
+ skill_id: string;
2286
+ /**
2287
+ * Type of skill - either 'puku' (built-in) or 'custom' (user-defined)
2288
+ */
2289
+ type: 'puku' | 'custom';
2290
+ /**
2291
+ * Skill version or 'latest' for most recent version
2292
+ */
2293
+ version?: string;
2294
+ }
2295
+ export type StopReason = 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | 'pause_turn' | 'refusal' | 'model_context_window_exceeded';
2296
+ export interface TextBlock {
2297
+ /**
2298
+ * Citations supporting the text block.
2299
+ *
2300
+ * The type of citation returned will depend on the type of document being cited.
2301
+ * Citing a PDF results in `page_location`, plain text results in `char_location`,
2302
+ * and content document results in `content_block_location`.
2303
+ */
2304
+ citations: Array<TextCitation> | null;
2305
+ text: string;
2306
+ type: 'text';
2307
+ }
2308
+ export interface TextBlockParam {
2309
+ text: string;
2310
+ type: 'text';
2311
+ /**
2312
+ * Create a cache control breakpoint at this content block.
2313
+ */
2314
+ cache_control?: CacheControlEphemeral | null;
2315
+ citations?: Array<TextCitationParam> | null;
2316
+ }
2317
+ export type TextCitation = CitationCharLocation | CitationPageLocation | CitationContentBlockLocation | CitationsWebSearchResultLocation | CitationsSearchResultLocation;
2318
+ export type TextCitationParam = CitationCharLocationParam | CitationPageLocationParam | CitationContentBlockLocationParam | CitationWebSearchResultLocationParam | CitationSearchResultLocationParam;
2319
+ export interface TextDelta {
2320
+ text: string;
2321
+ type: 'text_delta';
2322
+ }
2323
+ export interface TextEditorCodeExecutionCreateResultBlock {
2324
+ is_file_update: boolean;
2325
+ type: 'text_editor_code_execution_create_result';
2326
+ }
2327
+ export interface TextEditorCodeExecutionCreateResultBlockParam {
2328
+ is_file_update: boolean;
2329
+ type: 'text_editor_code_execution_create_result';
2330
+ }
2331
+ export interface TextEditorCodeExecutionStrReplaceResultBlock {
2332
+ lines: Array<string> | null;
2333
+ new_lines: number | null;
2334
+ new_start: number | null;
2335
+ old_lines: number | null;
2336
+ old_start: number | null;
2337
+ type: 'text_editor_code_execution_str_replace_result';
2338
+ }
2339
+ export interface TextEditorCodeExecutionStrReplaceResultBlockParam {
2340
+ type: 'text_editor_code_execution_str_replace_result';
2341
+ lines?: Array<string> | null;
2342
+ new_lines?: number | null;
2343
+ new_start?: number | null;
2344
+ old_lines?: number | null;
2345
+ old_start?: number | null;
2346
+ }
2347
+ export interface TextEditorCodeExecutionToolResultBlock {
2348
+ content: TextEditorCodeExecutionToolResultError | TextEditorCodeExecutionViewResultBlock | TextEditorCodeExecutionCreateResultBlock | TextEditorCodeExecutionStrReplaceResultBlock;
2349
+ tool_use_id: string;
2350
+ type: 'text_editor_code_execution_tool_result';
2351
+ }
2352
+ export interface TextEditorCodeExecutionToolResultBlockParam {
2353
+ content: TextEditorCodeExecutionToolResultErrorParam | TextEditorCodeExecutionViewResultBlockParam | TextEditorCodeExecutionCreateResultBlockParam | TextEditorCodeExecutionStrReplaceResultBlockParam;
2354
+ tool_use_id: string;
2355
+ type: 'text_editor_code_execution_tool_result';
2356
+ /**
2357
+ * Create a cache control breakpoint at this content block.
2358
+ */
2359
+ cache_control?: CacheControlEphemeral | null;
2360
+ }
2361
+ export interface TextEditorCodeExecutionToolResultError {
2362
+ error_code: TextEditorCodeExecutionToolResultErrorCode;
2363
+ error_message: string | null;
2364
+ type: 'text_editor_code_execution_tool_result_error';
2365
+ }
2366
+ export type TextEditorCodeExecutionToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded' | 'file_not_found';
2367
+ export interface TextEditorCodeExecutionToolResultErrorParam {
2368
+ error_code: TextEditorCodeExecutionToolResultErrorCode;
2369
+ type: 'text_editor_code_execution_tool_result_error';
2370
+ error_message?: string | null;
2371
+ }
2372
+ export interface TextEditorCodeExecutionViewResultBlock {
2373
+ content: string;
2374
+ file_type: 'text' | 'image' | 'pdf';
2375
+ num_lines: number | null;
2376
+ start_line: number | null;
2377
+ total_lines: number | null;
2378
+ type: 'text_editor_code_execution_view_result';
2379
+ }
2380
+ export interface TextEditorCodeExecutionViewResultBlockParam {
2381
+ content: string;
2382
+ file_type: 'text' | 'image' | 'pdf';
2383
+ type: 'text_editor_code_execution_view_result';
2384
+ num_lines?: number | null;
2385
+ start_line?: number | null;
2386
+ total_lines?: number | null;
2387
+ }
2388
+ export interface ThinkingBlock {
2389
+ /**
2390
+ * A value used to verify that this thinking block was generated by Puku when it
2391
+ * is passed back to the API.
2392
+ *
2393
+ * This is an opaque field and should not be interpreted or parsed. When passing
2394
+ * thinking blocks back to the API (required when using tools with extended
2395
+ * thinking), pass them back exactly as received, with this field intact.
2396
+ *
2397
+ * See
2398
+ * [extended thinking](https://platform.puku.com/docs/en/build-with-puku/extended-thinking)
2399
+ * for details.
2400
+ */
2401
+ signature: string;
2402
+ /**
2403
+ * The text of Puku's thinking process for this block.
2404
+ */
2405
+ thinking: string;
2406
+ type: 'thinking';
2407
+ }
2408
+ export interface ThinkingBlockParam {
2409
+ /**
2410
+ * The `signature` value of this thinking block, exactly as returned by the API in
2411
+ * a previous response. Used to verify that the block was generated by Puku.
2412
+ *
2413
+ * Thinking blocks must be passed back unmodified and in their original order; a
2414
+ * modified block results in a 400 `invalid_request_error`.
2415
+ */
2416
+ signature: string;
2417
+ /**
2418
+ * The `thinking` text of this block as returned by the API.
2419
+ */
2420
+ thinking: string;
2421
+ type: 'thinking';
2422
+ }
2423
+ export interface ThinkingConfigAdaptive {
2424
+ type: 'adaptive';
2425
+ /**
2426
+ * Controls how thinking content appears in the response. When set to `summarized`,
2427
+ * thinking is returned normally. When set to `omitted`, thinking content is
2428
+ * redacted but a signature is returned for multi-turn continuity. Defaults to
2429
+ * `summarized`.
2430
+ */
2431
+ display?: 'summarized' | 'omitted' | null;
2432
+ }
2433
+ export interface ThinkingConfigDisabled {
2434
+ type: 'disabled';
2435
+ }
2436
+ export interface ThinkingConfigEnabled {
2437
+ /**
2438
+ * Determines how many tokens Puku can use for its internal reasoning process.
2439
+ * Larger budgets can enable more thorough analysis for complex problems, improving
2440
+ * response quality.
2441
+ *
2442
+ * Must be ≥1024 and less than `max_tokens`.
2443
+ *
2444
+ * See
2445
+ * [extended thinking](https://platform.puku.com/docs/en/build-with-puku/extended-thinking)
2446
+ * for details.
2447
+ */
2448
+ budget_tokens: number;
2449
+ type: 'enabled';
2450
+ /**
2451
+ * Controls how thinking content appears in the response. When set to `summarized`,
2452
+ * thinking is returned normally. When set to `omitted`, thinking content is
2453
+ * redacted but a signature is returned for multi-turn continuity. Defaults to
2454
+ * `summarized`.
2455
+ */
2456
+ display?: 'summarized' | 'omitted' | null;
2457
+ }
2458
+ /**
2459
+ * Configuration for enabling Puku's extended thinking.
2460
+ *
2461
+ * When enabled, responses include `thinking` content blocks showing Puku's
2462
+ * thinking process before the final answer. Requires a minimum budget of 1,024
2463
+ * tokens and counts towards your `max_tokens` limit.
2464
+ *
2465
+ * See
2466
+ * [extended thinking](https://platform.puku.com/docs/en/build-with-puku/extended-thinking)
2467
+ * for details.
2468
+ */
2469
+ export type ThinkingConfigParam = ThinkingConfigEnabled | ThinkingConfigDisabled | ThinkingConfigAdaptive;
2470
+ export interface ThinkingDelta {
2471
+ /**
2472
+ * The incremental `thinking` text for this content block. Concatenate the
2473
+ * `thinking` values of successive `thinking_delta` events to assemble the block's
2474
+ * full `thinking` value.
2475
+ */
2476
+ thinking: string;
2477
+ type: 'thinking_delta';
2478
+ }
2479
+ export interface Tool {
2480
+ /**
2481
+ * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
2482
+ *
2483
+ * This defines the shape of the `input` that your tool accepts and that the model
2484
+ * will produce.
2485
+ */
2486
+ input_schema: Tool.InputSchema;
2487
+ /**
2488
+ * Name of the tool.
2489
+ *
2490
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2491
+ */
2492
+ name: string;
2493
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2494
+ /**
2495
+ * Create a cache control breakpoint at this content block.
2496
+ */
2497
+ cache_control?: CacheControlEphemeral | null;
2498
+ /**
2499
+ * If true, tool will not be included in initial system prompt. Only loaded when
2500
+ * returned via tool_reference from tool search.
2501
+ */
2502
+ defer_loading?: boolean;
2503
+ /**
2504
+ * Description of what this tool does.
2505
+ *
2506
+ * Tool descriptions should be as detailed as possible. The more information that
2507
+ * the model has about what the tool is and how to use it, the better it will
2508
+ * perform. You can use natural language descriptions to reinforce important
2509
+ * aspects of the tool input JSON schema.
2510
+ */
2511
+ description?: string;
2512
+ /**
2513
+ * Enable eager input streaming for this tool. When true, tool input parameters
2514
+ * will be streamed incrementally as they are generated, and types will be inferred
2515
+ * on-the-fly rather than buffering the full JSON output. When false, streaming is
2516
+ * disabled for this tool even if the fine-grained-tool-streaming beta is active.
2517
+ * When null (default), uses the default behavior based on beta headers.
2518
+ */
2519
+ eager_input_streaming?: boolean | null;
2520
+ input_examples?: Array<{
2521
+ [key: string]: unknown;
2522
+ }>;
2523
+ /**
2524
+ * When true, guarantees schema validation on tool names and inputs
2525
+ */
2526
+ strict?: boolean;
2527
+ type?: 'custom' | null;
2528
+ }
2529
+ export declare namespace Tool {
2530
+ /**
2531
+ * [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
2532
+ *
2533
+ * This defines the shape of the `input` that your tool accepts and that the model
2534
+ * will produce.
2535
+ */
2536
+ interface InputSchema {
2537
+ type: 'object';
2538
+ properties?: unknown | null;
2539
+ required?: Array<string> | null;
2540
+ [k: string]: unknown;
2541
+ }
2542
+ }
2543
+ export interface ToolBash20250124 {
2544
+ /**
2545
+ * Name of the tool.
2546
+ *
2547
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2548
+ */
2549
+ name: 'bash';
2550
+ type: 'bash_20250124';
2551
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2552
+ /**
2553
+ * Create a cache control breakpoint at this content block.
2554
+ */
2555
+ cache_control?: CacheControlEphemeral | null;
2556
+ /**
2557
+ * If true, tool will not be included in initial system prompt. Only loaded when
2558
+ * returned via tool_reference from tool search.
2559
+ */
2560
+ defer_loading?: boolean;
2561
+ input_examples?: Array<{
2562
+ [key: string]: unknown;
2563
+ }>;
2564
+ /**
2565
+ * When true, guarantees schema validation on tool names and inputs
2566
+ */
2567
+ strict?: boolean;
2568
+ }
2569
+ /**
2570
+ * How the model should use the provided tools. The model can use a specific tool,
2571
+ * any available tool, decide by itself, or not use tools at all.
2572
+ */
2573
+ export type ToolChoice = ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceNone;
2574
+ /**
2575
+ * The model will use any available tools.
2576
+ */
2577
+ export interface ToolChoiceAny {
2578
+ type: 'any';
2579
+ /**
2580
+ * Whether to disable parallel tool use.
2581
+ *
2582
+ * Defaults to `false`. If set to `true`, the model will output exactly one tool
2583
+ * use.
2584
+ */
2585
+ disable_parallel_tool_use?: boolean;
2586
+ }
2587
+ /**
2588
+ * The model will automatically decide whether to use tools.
2589
+ */
2590
+ export interface ToolChoiceAuto {
2591
+ type: 'auto';
2592
+ /**
2593
+ * Whether to disable parallel tool use.
2594
+ *
2595
+ * Defaults to `false`. If set to `true`, the model will output at most one tool
2596
+ * use.
2597
+ */
2598
+ disable_parallel_tool_use?: boolean;
2599
+ }
2600
+ /**
2601
+ * The model will not be allowed to use tools.
2602
+ */
2603
+ export interface ToolChoiceNone {
2604
+ type: 'none';
2605
+ }
2606
+ /**
2607
+ * The model will use the specified tool with `tool_choice.name`.
2608
+ */
2609
+ export interface ToolChoiceTool {
2610
+ /**
2611
+ * The name of the tool to use.
2612
+ */
2613
+ name: string;
2614
+ type: 'tool';
2615
+ /**
2616
+ * Whether to disable parallel tool use.
2617
+ *
2618
+ * Defaults to `false`. If set to `true`, the model will output exactly one tool
2619
+ * use.
2620
+ */
2621
+ disable_parallel_tool_use?: boolean;
2622
+ }
2623
+ export interface ToolReferenceBlock {
2624
+ tool_name: string;
2625
+ type: 'tool_reference';
2626
+ }
2627
+ /**
2628
+ * Tool reference block that can be included in tool_result content.
2629
+ */
2630
+ export interface ToolReferenceBlockParam {
2631
+ tool_name: string;
2632
+ type: 'tool_reference';
2633
+ /**
2634
+ * Create a cache control breakpoint at this content block.
2635
+ */
2636
+ cache_control?: CacheControlEphemeral | null;
2637
+ }
2638
+ export interface ToolResultBlockParam {
2639
+ tool_use_id: string;
2640
+ type: 'tool_result';
2641
+ /**
2642
+ * Create a cache control breakpoint at this content block.
2643
+ */
2644
+ cache_control?: CacheControlEphemeral | null;
2645
+ content?: string | Array<TextBlockParam | ImageBlockParam | SearchResultBlockParam | DocumentBlockParam | ToolReferenceBlockParam | BrowserStateBlockParam>;
2646
+ is_error?: boolean;
2647
+ /**
2648
+ * For a toolset member tool_result, the toolset family of the paired tool_use.
2649
+ */
2650
+ toolset_name?: string | null;
2651
+ }
2652
+ export interface ToolSearchToolBm25_20251119 {
2653
+ /**
2654
+ * Name of the tool.
2655
+ *
2656
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2657
+ */
2658
+ name: 'tool_search_tool_bm25';
2659
+ type: 'tool_search_tool_bm25_20251119' | 'tool_search_tool_bm25';
2660
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2661
+ /**
2662
+ * Create a cache control breakpoint at this content block.
2663
+ */
2664
+ cache_control?: CacheControlEphemeral | null;
2665
+ /**
2666
+ * If true, tool will not be included in initial system prompt. Only loaded when
2667
+ * returned via tool_reference from tool search.
2668
+ */
2669
+ defer_loading?: boolean;
2670
+ /**
2671
+ * When true, guarantees schema validation on tool names and inputs
2672
+ */
2673
+ strict?: boolean;
2674
+ }
2675
+ export interface ToolSearchToolRegex20251119 {
2676
+ /**
2677
+ * Name of the tool.
2678
+ *
2679
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2680
+ */
2681
+ name: 'tool_search_tool_regex';
2682
+ type: 'tool_search_tool_regex_20251119' | 'tool_search_tool_regex';
2683
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2684
+ /**
2685
+ * Create a cache control breakpoint at this content block.
2686
+ */
2687
+ cache_control?: CacheControlEphemeral | null;
2688
+ /**
2689
+ * If true, tool will not be included in initial system prompt. Only loaded when
2690
+ * returned via tool_reference from tool search.
2691
+ */
2692
+ defer_loading?: boolean;
2693
+ /**
2694
+ * When true, guarantees schema validation on tool names and inputs
2695
+ */
2696
+ strict?: boolean;
2697
+ }
2698
+ export interface ToolSearchToolResultBlock {
2699
+ content: ToolSearchToolResultError | ToolSearchToolSearchResultBlock;
2700
+ tool_use_id: string;
2701
+ type: 'tool_search_tool_result';
2702
+ }
2703
+ export interface ToolSearchToolResultBlockParam {
2704
+ content: ToolSearchToolResultErrorParam | ToolSearchToolSearchResultBlockParam;
2705
+ tool_use_id: string;
2706
+ type: 'tool_search_tool_result';
2707
+ /**
2708
+ * Create a cache control breakpoint at this content block.
2709
+ */
2710
+ cache_control?: CacheControlEphemeral | null;
2711
+ }
2712
+ export interface ToolSearchToolResultError {
2713
+ error_code: ToolSearchToolResultErrorCode;
2714
+ error_message: string | null;
2715
+ type: 'tool_search_tool_result_error';
2716
+ }
2717
+ export type ToolSearchToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'too_many_requests' | 'execution_time_exceeded';
2718
+ export interface ToolSearchToolResultErrorParam {
2719
+ error_code: ToolSearchToolResultErrorCode;
2720
+ type: 'tool_search_tool_result_error';
2721
+ error_message?: string | null;
2722
+ }
2723
+ export interface ToolSearchToolSearchResultBlock {
2724
+ tool_references: Array<ToolReferenceBlock>;
2725
+ type: 'tool_search_tool_search_result';
2726
+ }
2727
+ export interface ToolSearchToolSearchResultBlockParam {
2728
+ tool_references: Array<ToolReferenceBlockParam>;
2729
+ type: 'tool_search_tool_search_result';
2730
+ }
2731
+ export interface ToolTextEditor20250124 {
2732
+ /**
2733
+ * Name of the tool.
2734
+ *
2735
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2736
+ */
2737
+ name: 'str_replace_editor';
2738
+ type: 'text_editor_20250124';
2739
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2740
+ /**
2741
+ * Create a cache control breakpoint at this content block.
2742
+ */
2743
+ cache_control?: CacheControlEphemeral | null;
2744
+ /**
2745
+ * If true, tool will not be included in initial system prompt. Only loaded when
2746
+ * returned via tool_reference from tool search.
2747
+ */
2748
+ defer_loading?: boolean;
2749
+ input_examples?: Array<{
2750
+ [key: string]: unknown;
2751
+ }>;
2752
+ /**
2753
+ * When true, guarantees schema validation on tool names and inputs
2754
+ */
2755
+ strict?: boolean;
2756
+ }
2757
+ export interface ToolTextEditor20250429 {
2758
+ /**
2759
+ * Name of the tool.
2760
+ *
2761
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2762
+ */
2763
+ name: 'str_replace_based_edit_tool';
2764
+ type: 'text_editor_20250429';
2765
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2766
+ /**
2767
+ * Create a cache control breakpoint at this content block.
2768
+ */
2769
+ cache_control?: CacheControlEphemeral | null;
2770
+ /**
2771
+ * If true, tool will not be included in initial system prompt. Only loaded when
2772
+ * returned via tool_reference from tool search.
2773
+ */
2774
+ defer_loading?: boolean;
2775
+ input_examples?: Array<{
2776
+ [key: string]: unknown;
2777
+ }>;
2778
+ /**
2779
+ * When true, guarantees schema validation on tool names and inputs
2780
+ */
2781
+ strict?: boolean;
2782
+ }
2783
+ export interface ToolTextEditor20250728 {
2784
+ /**
2785
+ * Name of the tool.
2786
+ *
2787
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2788
+ */
2789
+ name: 'str_replace_based_edit_tool';
2790
+ type: 'text_editor_20250728';
2791
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2792
+ /**
2793
+ * Create a cache control breakpoint at this content block.
2794
+ */
2795
+ cache_control?: CacheControlEphemeral | null;
2796
+ /**
2797
+ * If true, tool will not be included in initial system prompt. Only loaded when
2798
+ * returned via tool_reference from tool search.
2799
+ */
2800
+ defer_loading?: boolean;
2801
+ input_examples?: Array<{
2802
+ [key: string]: unknown;
2803
+ }>;
2804
+ /**
2805
+ * Maximum number of characters to display when viewing a file. If not specified,
2806
+ * defaults to displaying the full file.
2807
+ */
2808
+ max_characters?: number | null;
2809
+ /**
2810
+ * When true, guarantees schema validation on tool names and inputs
2811
+ */
2812
+ strict?: boolean;
2813
+ }
2814
+ /**
2815
+ * Code execution tool with REPL state persistence (daemon mode + gVisor
2816
+ * checkpoint).
2817
+ */
2818
+ export type ToolUnion = Tool | ToolBash20250124 | CodeExecutionTool20250522 | CodeExecutionTool20250825 | CodeExecutionTool20260120 | CodeExecutionTool20260521 | BrowserToolset20260801 | MemoryTool20250818 | ComputerToolset20260801 | ToolTextEditor20250124 | ToolTextEditor20250429 | ToolTextEditor20250728 | WebSearchTool20250305 | WebFetchTool20250910 | WebSearchTool20260209 | WebFetchTool20260209 | WebFetchTool20260309 | WebSearchTool20260318 | WebFetchTool20260318 | ToolSearchToolBm25_20251119 | ToolSearchToolRegex20251119;
2819
+ export interface ToolUseBlock {
2820
+ id: string;
2821
+ /**
2822
+ * Tool invocation directly from the model.
2823
+ */
2824
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
2825
+ input: unknown;
2826
+ name: string;
2827
+ type: 'tool_use';
2828
+ /**
2829
+ * For a toolset member tool_use, the toolset family.
2830
+ */
2831
+ toolset_name?: string | null;
2832
+ }
2833
+ export interface ToolUseBlockParam {
2834
+ id: string;
2835
+ input: unknown;
2836
+ name: string;
2837
+ type: 'tool_use';
2838
+ /**
2839
+ * Create a cache control breakpoint at this content block.
2840
+ */
2841
+ cache_control?: CacheControlEphemeral | null;
2842
+ /**
2843
+ * Tool invocation directly from the model.
2844
+ */
2845
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
2846
+ /**
2847
+ * For a toolset member tool_use, the toolset family this member belongs to.
2848
+ */
2849
+ toolset_name?: string | null;
2850
+ }
2851
+ export interface URLImageSource {
2852
+ type: 'url';
2853
+ url: string;
2854
+ }
2855
+ export interface URLPDFSource {
2856
+ type: 'url';
2857
+ url: string;
2858
+ }
2859
+ export interface Usage {
2860
+ /**
2861
+ * Breakdown of cached tokens by TTL
2862
+ */
2863
+ cache_creation: CacheCreation | null;
2864
+ /**
2865
+ * The number of input tokens used to create the cache entry.
2866
+ */
2867
+ cache_creation_input_tokens: number | null;
2868
+ /**
2869
+ * The number of input tokens read from the cache.
2870
+ */
2871
+ cache_read_input_tokens: number | null;
2872
+ /**
2873
+ * The geographic region where inference was performed for this request.
2874
+ */
2875
+ inference_geo: string | null;
2876
+ /**
2877
+ * The number of input tokens which were used.
2878
+ */
2879
+ input_tokens: number;
2880
+ /**
2881
+ * The number of output tokens which were used.
2882
+ */
2883
+ output_tokens: number;
2884
+ /**
2885
+ * Breakdown of output tokens by category.
2886
+ *
2887
+ * `output_tokens` remains the inclusive, authoritative total used for billing.
2888
+ * This object provides a read-only decomposition for observability — for example,
2889
+ * how many of the billed output tokens were spent on internal reasoning that may
2890
+ * have been summarized before being returned to you.
2891
+ */
2892
+ output_tokens_details: OutputTokensDetails | null;
2893
+ /**
2894
+ * The number of server tool requests.
2895
+ */
2896
+ server_tool_use: ServerToolUsage | null;
2897
+ /**
2898
+ * If the request used the priority, standard, or batch tier.
2899
+ */
2900
+ service_tier: 'standard' | 'priority' | 'batch' | null;
2901
+ }
2902
+ export interface UserLocation {
2903
+ type: 'approximate';
2904
+ /**
2905
+ * The city of the user.
2906
+ */
2907
+ city?: string | null;
2908
+ /**
2909
+ * The two letter
2910
+ * [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
2911
+ * user.
2912
+ */
2913
+ country?: string | null;
2914
+ /**
2915
+ * The region of the user.
2916
+ */
2917
+ region?: string | null;
2918
+ /**
2919
+ * The [IANA timezone](https://nodatime.org/TimeZones) of the user.
2920
+ */
2921
+ timezone?: string | null;
2922
+ }
2923
+ export interface WebFetchBlock {
2924
+ content: DocumentBlock;
2925
+ /**
2926
+ * ISO 8601 timestamp when the content was retrieved
2927
+ */
2928
+ retrieved_at: string | null;
2929
+ type: 'web_fetch_result';
2930
+ /**
2931
+ * Fetched content URL
2932
+ */
2933
+ url: string;
2934
+ }
2935
+ export interface WebFetchBlockParam {
2936
+ content: DocumentBlockParam;
2937
+ type: 'web_fetch_result';
2938
+ /**
2939
+ * Fetched content URL
2940
+ */
2941
+ url: string;
2942
+ /**
2943
+ * ISO 8601 timestamp when the content was retrieved
2944
+ */
2945
+ retrieved_at?: string | null;
2946
+ }
2947
+ export interface WebFetchTool20250910 {
2948
+ /**
2949
+ * Name of the tool.
2950
+ *
2951
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2952
+ */
2953
+ name: 'web_fetch';
2954
+ type: 'web_fetch_20250910';
2955
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
2956
+ /**
2957
+ * List of domains to allow fetching from
2958
+ */
2959
+ allowed_domains?: Array<string> | null;
2960
+ /**
2961
+ * List of domains to block fetching from
2962
+ */
2963
+ blocked_domains?: Array<string> | null;
2964
+ /**
2965
+ * Create a cache control breakpoint at this content block.
2966
+ */
2967
+ cache_control?: CacheControlEphemeral | null;
2968
+ /**
2969
+ * Citations configuration for fetched documents. Citations are disabled by
2970
+ * default.
2971
+ */
2972
+ citations?: CitationsConfigParam | null;
2973
+ /**
2974
+ * If true, tool will not be included in initial system prompt. Only loaded when
2975
+ * returned via tool_reference from tool search.
2976
+ */
2977
+ defer_loading?: boolean;
2978
+ /**
2979
+ * Maximum number of tokens used by including web page text content in the context.
2980
+ * The limit is approximate and does not apply to binary content such as PDFs.
2981
+ */
2982
+ max_content_tokens?: number | null;
2983
+ /**
2984
+ * Maximum number of times the tool can be used in the API request.
2985
+ */
2986
+ max_uses?: number | null;
2987
+ /**
2988
+ * When true, guarantees schema validation on tool names and inputs
2989
+ */
2990
+ strict?: boolean;
2991
+ }
2992
+ export interface WebFetchTool20260209 {
2993
+ /**
2994
+ * Name of the tool.
2995
+ *
2996
+ * This is how the tool will be called by the model and in `tool_use` blocks.
2997
+ */
2998
+ name: 'web_fetch';
2999
+ type: 'web_fetch_20260209';
3000
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
3001
+ /**
3002
+ * List of domains to allow fetching from
3003
+ */
3004
+ allowed_domains?: Array<string> | null;
3005
+ /**
3006
+ * List of domains to block fetching from
3007
+ */
3008
+ blocked_domains?: Array<string> | null;
3009
+ /**
3010
+ * Create a cache control breakpoint at this content block.
3011
+ */
3012
+ cache_control?: CacheControlEphemeral | null;
3013
+ /**
3014
+ * Citations configuration for fetched documents. Citations are disabled by
3015
+ * default.
3016
+ */
3017
+ citations?: CitationsConfigParam | null;
3018
+ /**
3019
+ * If true, tool will not be included in initial system prompt. Only loaded when
3020
+ * returned via tool_reference from tool search.
3021
+ */
3022
+ defer_loading?: boolean;
3023
+ /**
3024
+ * Maximum number of tokens used by including web page text content in the context.
3025
+ * The limit is approximate and does not apply to binary content such as PDFs.
3026
+ */
3027
+ max_content_tokens?: number | null;
3028
+ /**
3029
+ * Maximum number of times the tool can be used in the API request.
3030
+ */
3031
+ max_uses?: number | null;
3032
+ /**
3033
+ * When true, guarantees schema validation on tool names and inputs
3034
+ */
3035
+ strict?: boolean;
3036
+ }
3037
+ /**
3038
+ * Web fetch tool with use_cache parameter for bypassing cached content.
3039
+ */
3040
+ export interface WebFetchTool20260309 {
3041
+ /**
3042
+ * Name of the tool.
3043
+ *
3044
+ * This is how the tool will be called by the model and in `tool_use` blocks.
3045
+ */
3046
+ name: 'web_fetch';
3047
+ type: 'web_fetch_20260309';
3048
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
3049
+ /**
3050
+ * List of domains to allow fetching from
3051
+ */
3052
+ allowed_domains?: Array<string> | null;
3053
+ /**
3054
+ * List of domains to block fetching from
3055
+ */
3056
+ blocked_domains?: Array<string> | null;
3057
+ /**
3058
+ * Create a cache control breakpoint at this content block.
3059
+ */
3060
+ cache_control?: CacheControlEphemeral | null;
3061
+ /**
3062
+ * Citations configuration for fetched documents. Citations are disabled by
3063
+ * default.
3064
+ */
3065
+ citations?: CitationsConfigParam | null;
3066
+ /**
3067
+ * If true, tool will not be included in initial system prompt. Only loaded when
3068
+ * returned via tool_reference from tool search.
3069
+ */
3070
+ defer_loading?: boolean;
3071
+ /**
3072
+ * Maximum number of tokens used by including web page text content in the context.
3073
+ * The limit is approximate and does not apply to binary content such as PDFs.
3074
+ */
3075
+ max_content_tokens?: number | null;
3076
+ /**
3077
+ * Maximum number of times the tool can be used in the API request.
3078
+ */
3079
+ max_uses?: number | null;
3080
+ /**
3081
+ * When true, guarantees schema validation on tool names and inputs
3082
+ */
3083
+ strict?: boolean;
3084
+ /**
3085
+ * Whether to use cached content. Set to false to bypass the cache and fetch fresh
3086
+ * content. Only set to false when the user explicitly requests fresh content or
3087
+ * when fetching rapidly-changing sources.
3088
+ */
3089
+ use_cache?: boolean;
3090
+ }
3091
+ export interface WebFetchTool20260318 {
3092
+ /**
3093
+ * Name of the tool.
3094
+ *
3095
+ * This is how the tool will be called by the model and in `tool_use` blocks.
3096
+ */
3097
+ name: 'web_fetch';
3098
+ type: 'web_fetch_20260318';
3099
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
3100
+ /**
3101
+ * List of domains to allow fetching from
3102
+ */
3103
+ allowed_domains?: Array<string> | null;
3104
+ /**
3105
+ * List of domains to block fetching from
3106
+ */
3107
+ blocked_domains?: Array<string> | null;
3108
+ /**
3109
+ * Create a cache control breakpoint at this content block.
3110
+ */
3111
+ cache_control?: CacheControlEphemeral | null;
3112
+ /**
3113
+ * Citations configuration for fetched documents. Citations are disabled by
3114
+ * default.
3115
+ */
3116
+ citations?: CitationsConfigParam | null;
3117
+ /**
3118
+ * If true, tool will not be included in initial system prompt. Only loaded when
3119
+ * returned via tool_reference from tool search.
3120
+ */
3121
+ defer_loading?: boolean;
3122
+ /**
3123
+ * Maximum number of tokens used by including web page text content in the context.
3124
+ * The limit is approximate and does not apply to binary content such as PDFs.
3125
+ */
3126
+ max_content_tokens?: number | null;
3127
+ /**
3128
+ * Maximum number of times the tool can be used in the API request.
3129
+ */
3130
+ max_uses?: number | null;
3131
+ /**
3132
+ * How this tool's result blocks appear in the API response when the result was
3133
+ * consumed by a completed code_execution call in the same turn. 'full' returns the
3134
+ * complete content (default). 'excluded' drops the nested server_tool_use and
3135
+ * result block pair entirely. Results from direct calls, or from code_execution
3136
+ * calls that paused before completing, are always returned in full so they can be
3137
+ * sent back on the next turn.
3138
+ */
3139
+ response_inclusion?: 'full' | 'excluded';
3140
+ /**
3141
+ * When true, guarantees schema validation on tool names and inputs
3142
+ */
3143
+ strict?: boolean;
3144
+ /**
3145
+ * Whether to use cached content. Set to false to bypass the cache and fetch fresh
3146
+ * content. Only set to false when the user explicitly requests fresh content or
3147
+ * when fetching rapidly-changing sources.
3148
+ */
3149
+ use_cache?: boolean;
3150
+ }
3151
+ export interface WebFetchToolResultBlock {
3152
+ /**
3153
+ * Tool invocation directly from the model.
3154
+ */
3155
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
3156
+ content: WebFetchToolResultErrorBlock | WebFetchBlock;
3157
+ tool_use_id: string;
3158
+ type: 'web_fetch_tool_result';
3159
+ }
3160
+ export interface WebFetchToolResultBlockParam {
3161
+ content: WebFetchToolResultErrorBlockParam | WebFetchBlockParam;
3162
+ tool_use_id: string;
3163
+ type: 'web_fetch_tool_result';
3164
+ /**
3165
+ * Create a cache control breakpoint at this content block.
3166
+ */
3167
+ cache_control?: CacheControlEphemeral | null;
3168
+ /**
3169
+ * Tool invocation directly from the model.
3170
+ */
3171
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
3172
+ }
3173
+ export interface WebFetchToolResultErrorBlock {
3174
+ error_code: WebFetchToolResultErrorCode;
3175
+ type: 'web_fetch_tool_result_error';
3176
+ }
3177
+ export interface WebFetchToolResultErrorBlockParam {
3178
+ error_code: WebFetchToolResultErrorCode;
3179
+ type: 'web_fetch_tool_result_error';
3180
+ }
3181
+ export type WebFetchToolResultErrorCode = 'invalid_tool_input' | 'url_too_long' | 'url_not_allowed' | 'url_not_in_prior_context' | 'url_not_accessible' | 'unsupported_content_type' | 'too_many_requests' | 'max_uses_exceeded' | 'unavailable';
3182
+ export interface WebSearchResultBlock {
3183
+ encrypted_content: string;
3184
+ page_age: string | null;
3185
+ title: string;
3186
+ type: 'web_search_result';
3187
+ url: string;
3188
+ }
3189
+ export interface WebSearchResultBlockParam {
3190
+ encrypted_content: string;
3191
+ title: string;
3192
+ type: 'web_search_result';
3193
+ url: string;
3194
+ page_age?: string | null;
3195
+ }
3196
+ export interface WebSearchTool20250305 {
3197
+ /**
3198
+ * Name of the tool.
3199
+ *
3200
+ * This is how the tool will be called by the model and in `tool_use` blocks.
3201
+ */
3202
+ name: 'web_search';
3203
+ type: 'web_search_20250305';
3204
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
3205
+ /**
3206
+ * If provided, only these domains will be included in results. Cannot be used
3207
+ * alongside `blocked_domains`.
3208
+ */
3209
+ allowed_domains?: Array<string> | null;
3210
+ /**
3211
+ * If provided, these domains will never appear in results. Cannot be used
3212
+ * alongside `allowed_domains`.
3213
+ */
3214
+ blocked_domains?: Array<string> | null;
3215
+ /**
3216
+ * Create a cache control breakpoint at this content block.
3217
+ */
3218
+ cache_control?: CacheControlEphemeral | null;
3219
+ /**
3220
+ * If true, tool will not be included in initial system prompt. Only loaded when
3221
+ * returned via tool_reference from tool search.
3222
+ */
3223
+ defer_loading?: boolean;
3224
+ /**
3225
+ * Maximum number of times the tool can be used in the API request.
3226
+ */
3227
+ max_uses?: number | null;
3228
+ /**
3229
+ * When true, guarantees schema validation on tool names and inputs
3230
+ */
3231
+ strict?: boolean;
3232
+ /**
3233
+ * Parameters for the user's location. Used to provide more relevant search
3234
+ * results.
3235
+ */
3236
+ user_location?: UserLocation | null;
3237
+ }
3238
+ export declare namespace WebSearchTool20250305 {
3239
+ /**
3240
+ * @deprecated Import `UserLocation` from `puku` directly instead of using
3241
+ * `WebSearchTool20250305.UserLocation`.
3242
+ */
3243
+ type UserLocation = Messages.UserLocation;
3244
+ }
3245
+ export interface WebSearchTool20260209 {
3246
+ /**
3247
+ * Name of the tool.
3248
+ *
3249
+ * This is how the tool will be called by the model and in `tool_use` blocks.
3250
+ */
3251
+ name: 'web_search';
3252
+ type: 'web_search_20260209';
3253
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
3254
+ /**
3255
+ * If provided, only these domains will be included in results. Cannot be used
3256
+ * alongside `blocked_domains`.
3257
+ */
3258
+ allowed_domains?: Array<string> | null;
3259
+ /**
3260
+ * If provided, these domains will never appear in results. Cannot be used
3261
+ * alongside `allowed_domains`.
3262
+ */
3263
+ blocked_domains?: Array<string> | null;
3264
+ /**
3265
+ * Create a cache control breakpoint at this content block.
3266
+ */
3267
+ cache_control?: CacheControlEphemeral | null;
3268
+ /**
3269
+ * If true, tool will not be included in initial system prompt. Only loaded when
3270
+ * returned via tool_reference from tool search.
3271
+ */
3272
+ defer_loading?: boolean;
3273
+ /**
3274
+ * Maximum number of times the tool can be used in the API request.
3275
+ */
3276
+ max_uses?: number | null;
3277
+ /**
3278
+ * When true, guarantees schema validation on tool names and inputs
3279
+ */
3280
+ strict?: boolean;
3281
+ /**
3282
+ * Parameters for the user's location. Used to provide more relevant search
3283
+ * results.
3284
+ */
3285
+ user_location?: UserLocation | null;
3286
+ }
3287
+ export declare namespace WebSearchTool20260209 {
3288
+ /**
3289
+ * @deprecated Import `UserLocation` from `puku` directly instead of using
3290
+ * `WebSearchTool20260209.UserLocation`.
3291
+ */
3292
+ type UserLocation = Messages.UserLocation;
3293
+ }
3294
+ export interface WebSearchTool20260318 {
3295
+ /**
3296
+ * Name of the tool.
3297
+ *
3298
+ * This is how the tool will be called by the model and in `tool_use` blocks.
3299
+ */
3300
+ name: 'web_search';
3301
+ type: 'web_search_20260318';
3302
+ allowed_callers?: Array<'direct' | 'code_execution_20250825' | 'code_execution_20260120' | 'code_execution_20260521'>;
3303
+ /**
3304
+ * If provided, only these domains will be included in results. Cannot be used
3305
+ * alongside `blocked_domains`.
3306
+ */
3307
+ allowed_domains?: Array<string> | null;
3308
+ /**
3309
+ * If provided, these domains will never appear in results. Cannot be used
3310
+ * alongside `allowed_domains`.
3311
+ */
3312
+ blocked_domains?: Array<string> | null;
3313
+ /**
3314
+ * Create a cache control breakpoint at this content block.
3315
+ */
3316
+ cache_control?: CacheControlEphemeral | null;
3317
+ /**
3318
+ * If true, tool will not be included in initial system prompt. Only loaded when
3319
+ * returned via tool_reference from tool search.
3320
+ */
3321
+ defer_loading?: boolean;
3322
+ /**
3323
+ * Maximum number of times the tool can be used in the API request.
3324
+ */
3325
+ max_uses?: number | null;
3326
+ /**
3327
+ * How this tool's result blocks appear in the API response when the result was
3328
+ * consumed by a completed code_execution call in the same turn. 'full' returns the
3329
+ * complete content (default). 'excluded' drops the nested server_tool_use and
3330
+ * result block pair entirely. Results from direct calls, or from code_execution
3331
+ * calls that paused before completing, are always returned in full so they can be
3332
+ * sent back on the next turn.
3333
+ */
3334
+ response_inclusion?: 'full' | 'excluded';
3335
+ /**
3336
+ * When true, guarantees schema validation on tool names and inputs
3337
+ */
3338
+ strict?: boolean;
3339
+ /**
3340
+ * Parameters for the user's location. Used to provide more relevant search
3341
+ * results.
3342
+ */
3343
+ user_location?: UserLocation | null;
3344
+ }
3345
+ export interface WebSearchToolRequestError {
3346
+ error_code: WebSearchToolResultErrorCode;
3347
+ type: 'web_search_tool_result_error';
3348
+ }
3349
+ export interface WebSearchToolResultBlock {
3350
+ /**
3351
+ * Tool invocation directly from the model.
3352
+ */
3353
+ caller: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
3354
+ content: WebSearchToolResultBlockContent;
3355
+ tool_use_id: string;
3356
+ type: 'web_search_tool_result';
3357
+ }
3358
+ export type WebSearchToolResultBlockContent = WebSearchToolResultError | Array<WebSearchResultBlock>;
3359
+ export interface WebSearchToolResultBlockParam {
3360
+ content: WebSearchToolResultBlockParamContent;
3361
+ tool_use_id: string;
3362
+ type: 'web_search_tool_result';
3363
+ /**
3364
+ * Create a cache control breakpoint at this content block.
3365
+ */
3366
+ cache_control?: CacheControlEphemeral | null;
3367
+ /**
3368
+ * Tool invocation directly from the model.
3369
+ */
3370
+ caller?: DirectCaller | ServerToolCaller | ServerToolCaller20260120;
3371
+ }
3372
+ export type WebSearchToolResultBlockParamContent = Array<WebSearchResultBlockParam> | WebSearchToolRequestError;
3373
+ export interface WebSearchToolResultError {
3374
+ error_code: WebSearchToolResultErrorCode;
3375
+ type: 'web_search_tool_result_error';
3376
+ }
3377
+ export type WebSearchToolResultErrorCode = 'invalid_tool_input' | 'unavailable' | 'max_uses_exceeded' | 'too_many_requests' | 'query_too_long' | 'request_too_large';
3378
+ export type MessageStreamEvent = RawMessageStreamEvent;
3379
+ export type MessageStartEvent = RawMessageStartEvent;
3380
+ export type MessageDeltaEvent = RawMessageDeltaEvent;
3381
+ export type MessageStopEvent = RawMessageStopEvent;
3382
+ export type ContentBlockStartEvent = RawContentBlockStartEvent;
3383
+ export type ContentBlockDeltaEvent = RawContentBlockDeltaEvent;
3384
+ export type ContentBlockStopEvent = RawContentBlockStopEvent;
3385
+ export type MessageCreateParams = MessageCreateParamsNonStreaming | MessageCreateParamsStreaming;
3386
+ export interface MessageCreateParamsBase {
3387
+ /**
3388
+ * Body param: The maximum number of tokens to generate before stopping.
3389
+ *
3390
+ * Note that our models may stop _before_ reaching this maximum. This parameter
3391
+ * only specifies the absolute maximum number of tokens to generate.
3392
+ *
3393
+ * Set to `0` to populate the
3394
+ * [prompt cache](https://platform.puku.com/docs/en/build-with-puku/prompt-caching#pre-warming-the-cache)
3395
+ * without generating a response.
3396
+ *
3397
+ * Different models have different maximum values for this parameter. See
3398
+ * [models](https://platform.puku.com/docs/en/about-puku/models/overview) for
3399
+ * details.
3400
+ */
3401
+ max_tokens: number;
3402
+ /**
3403
+ * Body param: Input messages.
3404
+ *
3405
+ * Our models are trained to operate on alternating `user` and `assistant`
3406
+ * conversational turns. When creating a new `Message`, you specify the prior
3407
+ * conversational turns with the `messages` parameter, and the model then generates
3408
+ * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
3409
+ * in your request will be combined into a single turn.
3410
+ *
3411
+ * Each input message must be an object with a `role` and `content`. You can
3412
+ * specify a single `user`-role message, or you can include multiple `user` and
3413
+ * `assistant` messages.
3414
+ *
3415
+ * If the final message uses the `assistant` role, the response content will
3416
+ * continue immediately from the content in that message. This can be used to
3417
+ * constrain part of the model's response.
3418
+ *
3419
+ * Example with a single `user` message:
3420
+ *
3421
+ * ```json
3422
+ * [{ "role": "user", "content": "Hello, Puku" }]
3423
+ * ```
3424
+ *
3425
+ * Example with multiple conversational turns:
3426
+ *
3427
+ * ```json
3428
+ * [
3429
+ * { "role": "user", "content": "Hello there." },
3430
+ * { "role": "assistant", "content": "Hi, I'm Puku. How can I help you?" },
3431
+ * { "role": "user", "content": "Can you explain LLMs in plain English?" }
3432
+ * ]
3433
+ * ```
3434
+ *
3435
+ * Example with a partially-filled response from Puku:
3436
+ *
3437
+ * ```json
3438
+ * [
3439
+ * {
3440
+ * "role": "user",
3441
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
3442
+ * },
3443
+ * { "role": "assistant", "content": "The best answer is (" }
3444
+ * ]
3445
+ * ```
3446
+ *
3447
+ * Each input message `content` may be either a single `string` or an array of
3448
+ * content blocks, where each block has a specific `type`. Using a `string` for
3449
+ * `content` is shorthand for an array of one content block of type `"text"`. The
3450
+ * following input messages are equivalent:
3451
+ *
3452
+ * ```json
3453
+ * { "role": "user", "content": "Hello, Puku" }
3454
+ * ```
3455
+ *
3456
+ * ```json
3457
+ * { "role": "user", "content": [{ "type": "text", "text": "Hello, Puku" }] }
3458
+ * ```
3459
+ *
3460
+ * See
3461
+ * [input examples](https://platform.puku.com/docs/en/build-with-puku/working-with-messages).
3462
+ *
3463
+ * Note that if you want to include a
3464
+ * [system prompt](https://platform.puku.com/docs/en/build-with-puku/prompt-engineering/puku-prompting-best-practices#give-puku-a-role),
3465
+ * you can use the top-level `system` parameter — there is no `"system"` role for
3466
+ * input messages in the Messages API.
3467
+ *
3468
+ * There is a limit of 100,000 messages in a single request.
3469
+ */
3470
+ messages: Array<MessageParam>;
3471
+ /**
3472
+ * Body param: The model that will complete your prompt.
3473
+ *
3474
+ * See [models](https://docs.puku.com/en/docs/models-overview) for additional
3475
+ * details and options.
3476
+ */
3477
+ model: Model;
3478
+ /**
3479
+ * Body param: Top-level cache control automatically applies a cache_control marker
3480
+ * to the last cacheable block in the request.
3481
+ */
3482
+ cache_control?: CacheControlEphemeral | null;
3483
+ /**
3484
+ * Body param: Container identifier for reuse across requests.
3485
+ */
3486
+ container?: MessageCreateParamsContainer | null;
3487
+ /**
3488
+ * Body param: Specifies the geographic region for inference processing. If not
3489
+ * specified, the workspace's `default_inference_geo` is used.
3490
+ */
3491
+ inference_geo?: string | null;
3492
+ /**
3493
+ * Body param: An object describing metadata about the request.
3494
+ */
3495
+ metadata?: Metadata;
3496
+ /**
3497
+ * Body param: Configuration options for the model's output, such as the output
3498
+ * format.
3499
+ */
3500
+ output_config?: OutputConfig;
3501
+ /**
3502
+ * Body param: Determines whether to use priority capacity (if available) or
3503
+ * standard capacity for this request.
3504
+ *
3505
+ * PukuAI offers different levels of service for your API requests. See
3506
+ * [service-tiers](https://platform.puku.com/docs/en/api/service-tiers) for
3507
+ * details.
3508
+ */
3509
+ service_tier?: 'auto' | 'standard_only';
3510
+ /**
3511
+ * Body param: Custom text sequences that will cause the model to stop generating.
3512
+ *
3513
+ * Our models will normally stop when they have naturally completed their turn,
3514
+ * which will result in a response `stop_reason` of `"end_turn"`.
3515
+ *
3516
+ * If you want the model to stop generating when it encounters custom strings of
3517
+ * text, you can use the `stop_sequences` parameter. If the model encounters one of
3518
+ * the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
3519
+ * and the response `stop_sequence` value will contain the matched stop sequence.
3520
+ */
3521
+ stop_sequences?: Array<string>;
3522
+ /**
3523
+ * Body param: Whether to incrementally stream the response using server-sent
3524
+ * events.
3525
+ *
3526
+ * See [streaming](https://platform.puku.com/docs/en/build-with-puku/streaming)
3527
+ * for details.
3528
+ */
3529
+ stream?: boolean;
3530
+ /**
3531
+ * Body param: System prompt.
3532
+ *
3533
+ * A system prompt is a way of providing context and instructions to Puku, such
3534
+ * as specifying a particular goal or role. See our
3535
+ * [guide to system prompts](https://platform.puku.com/docs/en/build-with-puku/prompt-engineering/puku-prompting-best-practices#give-puku-a-role).
3536
+ */
3537
+ system?: string | Array<TextBlockParam>;
3538
+ /**
3539
+ * @deprecated Deprecated. Models released after Puku Opus 4.6 do not support
3540
+ * setting temperature. A value of 1.0 of will be accepted for backwards
3541
+ * compatibility, all other values will be rejected with a 400 error.
3542
+ */
3543
+ temperature?: number;
3544
+ /**
3545
+ * Body param: Configuration for enabling Puku's extended thinking.
3546
+ *
3547
+ * When enabled, responses include `thinking` content blocks showing Puku's
3548
+ * thinking process before the final answer. Requires a minimum budget of 1,024
3549
+ * tokens and counts towards your `max_tokens` limit.
3550
+ *
3551
+ * See
3552
+ * [extended thinking](https://platform.puku.com/docs/en/build-with-puku/extended-thinking)
3553
+ * for details.
3554
+ */
3555
+ thinking?: ThinkingConfigParam;
3556
+ /**
3557
+ * Body param: How the model should use the provided tools. The model can use a
3558
+ * specific tool, any available tool, decide by itself, or not use tools at all.
3559
+ */
3560
+ tool_choice?: ToolChoice;
3561
+ /**
3562
+ * Body param: Definitions of tools that the model may use.
3563
+ *
3564
+ * If you include `tools` in your API request, the model may return `tool_use`
3565
+ * content blocks that represent the model's use of those tools. You can then run
3566
+ * those tools using the tool input generated by the model and then optionally
3567
+ * return results back to the model using `tool_result` content blocks.
3568
+ *
3569
+ * There are two types of tools: **client tools** and **server tools**. The
3570
+ * behavior described below applies to client tools. For
3571
+ * [server tools](https://platform.puku.com/docs/en/agents-and-tools/tool-use/server-tools),
3572
+ * see their individual documentation as each has its own behavior (e.g., the
3573
+ * [web search tool](https://platform.puku.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
3574
+ *
3575
+ * Each tool definition includes:
3576
+ *
3577
+ * - `name`: Name of the tool.
3578
+ * - `description`: Optional, but strongly-recommended description of the tool.
3579
+ * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
3580
+ * tool `input` shape that the model will produce in `tool_use` output content
3581
+ * blocks.
3582
+ *
3583
+ * For example, if you defined `tools` as:
3584
+ *
3585
+ * ```json
3586
+ * [
3587
+ * {
3588
+ * "name": "get_stock_price",
3589
+ * "description": "Get the current stock price for a given ticker symbol.",
3590
+ * "input_schema": {
3591
+ * "type": "object",
3592
+ * "properties": {
3593
+ * "ticker": {
3594
+ * "type": "string",
3595
+ * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
3596
+ * }
3597
+ * },
3598
+ * "required": ["ticker"]
3599
+ * }
3600
+ * }
3601
+ * ]
3602
+ * ```
3603
+ *
3604
+ * And then asked the model "What's the S&P 500 at today?", the model might produce
3605
+ * `tool_use` content blocks in the response like this:
3606
+ *
3607
+ * ```json
3608
+ * [
3609
+ * {
3610
+ * "type": "tool_use",
3611
+ * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
3612
+ * "name": "get_stock_price",
3613
+ * "input": { "ticker": "^GSPC" }
3614
+ * }
3615
+ * ]
3616
+ * ```
3617
+ *
3618
+ * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
3619
+ * input, and return the following back to the model in a subsequent `user`
3620
+ * message:
3621
+ *
3622
+ * ```json
3623
+ * [
3624
+ * {
3625
+ * "type": "tool_result",
3626
+ * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
3627
+ * "content": "259.75 USD"
3628
+ * }
3629
+ * ]
3630
+ * ```
3631
+ *
3632
+ * Tools can be used for workflows that include running client-side tools and
3633
+ * functions, or more generally whenever you want the model to produce a particular
3634
+ * JSON structure of output.
3635
+ *
3636
+ * See our
3637
+ * [guide](https://platform.puku.com/docs/en/agents-and-tools/tool-use/overview)
3638
+ * for more details.
3639
+ */
3640
+ tools?: Array<ToolUnion>;
3641
+ /**
3642
+ * @deprecated Deprecated. Models released after Puku Opus 4.6 do not accept
3643
+ * top_k; any value will be rejected with a 400 error.
3644
+ */
3645
+ top_k?: number;
3646
+ /**
3647
+ * @deprecated Deprecated. Models released after Puku Opus 4.6 do not support
3648
+ * setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
3649
+ * other values will be rejected with a 400 error.
3650
+ */
3651
+ top_p?: number;
3652
+ /**
3653
+ * Header param: The user profile ID to attribute this request to. Use when acting
3654
+ * on behalf of a party other than your organization. Requires the `user-profiles`
3655
+ * beta header.
3656
+ */
3657
+ user_profile_id?: string;
3658
+ }
3659
+ export declare namespace MessageCreateParams {
3660
+ type MessageCreateParamsNonStreaming = MessagesAPI.MessageCreateParamsNonStreaming;
3661
+ type MessageCreateParamsStreaming = MessagesAPI.MessageCreateParamsStreaming;
3662
+ }
3663
+ export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase {
3664
+ /**
3665
+ * Body param: Whether to incrementally stream the response using server-sent
3666
+ * events.
3667
+ *
3668
+ * See [streaming](https://platform.puku.com/docs/en/build-with-puku/streaming)
3669
+ * for details.
3670
+ */
3671
+ stream?: false;
3672
+ }
3673
+ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
3674
+ /**
3675
+ * Body param: Whether to incrementally stream the response using server-sent
3676
+ * events.
3677
+ *
3678
+ * See [streaming](https://platform.puku.com/docs/en/build-with-puku/streaming)
3679
+ * for details.
3680
+ */
3681
+ stream: true;
3682
+ }
3683
+ export type MessageStreamParams = ParseableMessageCreateParams;
3684
+ export interface MessageCountTokensParams {
3685
+ /**
3686
+ * Body param: Input messages.
3687
+ *
3688
+ * Our models are trained to operate on alternating `user` and `assistant`
3689
+ * conversational turns. When creating a new `Message`, you specify the prior
3690
+ * conversational turns with the `messages` parameter, and the model then generates
3691
+ * the next `Message` in the conversation. Consecutive `user` or `assistant` turns
3692
+ * in your request will be combined into a single turn.
3693
+ *
3694
+ * Each input message must be an object with a `role` and `content`. You can
3695
+ * specify a single `user`-role message, or you can include multiple `user` and
3696
+ * `assistant` messages.
3697
+ *
3698
+ * If the final message uses the `assistant` role, the response content will
3699
+ * continue immediately from the content in that message. This can be used to
3700
+ * constrain part of the model's response.
3701
+ *
3702
+ * Example with a single `user` message:
3703
+ *
3704
+ * ```json
3705
+ * [{ "role": "user", "content": "Hello, Puku" }]
3706
+ * ```
3707
+ *
3708
+ * Example with multiple conversational turns:
3709
+ *
3710
+ * ```json
3711
+ * [
3712
+ * { "role": "user", "content": "Hello there." },
3713
+ * { "role": "assistant", "content": "Hi, I'm Puku. How can I help you?" },
3714
+ * { "role": "user", "content": "Can you explain LLMs in plain English?" }
3715
+ * ]
3716
+ * ```
3717
+ *
3718
+ * Example with a partially-filled response from Puku:
3719
+ *
3720
+ * ```json
3721
+ * [
3722
+ * {
3723
+ * "role": "user",
3724
+ * "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
3725
+ * },
3726
+ * { "role": "assistant", "content": "The best answer is (" }
3727
+ * ]
3728
+ * ```
3729
+ *
3730
+ * Each input message `content` may be either a single `string` or an array of
3731
+ * content blocks, where each block has a specific `type`. Using a `string` for
3732
+ * `content` is shorthand for an array of one content block of type `"text"`. The
3733
+ * following input messages are equivalent:
3734
+ *
3735
+ * ```json
3736
+ * { "role": "user", "content": "Hello, Puku" }
3737
+ * ```
3738
+ *
3739
+ * ```json
3740
+ * { "role": "user", "content": [{ "type": "text", "text": "Hello, Puku" }] }
3741
+ * ```
3742
+ *
3743
+ * See
3744
+ * [input examples](https://platform.puku.com/docs/en/build-with-puku/working-with-messages).
3745
+ *
3746
+ * Note that if you want to include a
3747
+ * [system prompt](https://platform.puku.com/docs/en/build-with-puku/prompt-engineering/puku-prompting-best-practices#give-puku-a-role),
3748
+ * you can use the top-level `system` parameter — there is no `"system"` role for
3749
+ * input messages in the Messages API.
3750
+ *
3751
+ * There is a limit of 100,000 messages in a single request.
3752
+ */
3753
+ messages: Array<MessageParam>;
3754
+ /**
3755
+ * Body param: The model that will complete your prompt.
3756
+ *
3757
+ * See [models](https://docs.puku.com/en/docs/models-overview) for additional
3758
+ * details and options.
3759
+ */
3760
+ model: Model;
3761
+ /**
3762
+ * Body param: Top-level cache control automatically applies a cache_control marker
3763
+ * to the last cacheable block in the request.
3764
+ */
3765
+ cache_control?: CacheControlEphemeral | null;
3766
+ /**
3767
+ * Body param: Configuration options for the model's output, such as the output
3768
+ * format.
3769
+ */
3770
+ output_config?: OutputConfig;
3771
+ /**
3772
+ * Body param: System prompt.
3773
+ *
3774
+ * A system prompt is a way of providing context and instructions to Puku, such
3775
+ * as specifying a particular goal or role. See our
3776
+ * [guide to system prompts](https://platform.puku.com/docs/en/build-with-puku/prompt-engineering/puku-prompting-best-practices#give-puku-a-role).
3777
+ */
3778
+ system?: string | Array<TextBlockParam>;
3779
+ /**
3780
+ * Body param: Configuration for enabling Puku's extended thinking.
3781
+ *
3782
+ * When enabled, responses include `thinking` content blocks showing Puku's
3783
+ * thinking process before the final answer. Requires a minimum budget of 1,024
3784
+ * tokens and counts towards your `max_tokens` limit.
3785
+ *
3786
+ * See
3787
+ * [extended thinking](https://platform.puku.com/docs/en/build-with-puku/extended-thinking)
3788
+ * for details.
3789
+ */
3790
+ thinking?: ThinkingConfigParam;
3791
+ /**
3792
+ * Body param: How the model should use the provided tools. The model can use a
3793
+ * specific tool, any available tool, decide by itself, or not use tools at all.
3794
+ */
3795
+ tool_choice?: ToolChoice;
3796
+ /**
3797
+ * Body param: Definitions of tools that the model may use.
3798
+ *
3799
+ * If you include `tools` in your API request, the model may return `tool_use`
3800
+ * content blocks that represent the model's use of those tools. You can then run
3801
+ * those tools using the tool input generated by the model and then optionally
3802
+ * return results back to the model using `tool_result` content blocks.
3803
+ *
3804
+ * There are two types of tools: **client tools** and **server tools**. The
3805
+ * behavior described below applies to client tools. For
3806
+ * [server tools](https://platform.puku.com/docs/en/agents-and-tools/tool-use/server-tools),
3807
+ * see their individual documentation as each has its own behavior (e.g., the
3808
+ * [web search tool](https://platform.puku.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
3809
+ *
3810
+ * Each tool definition includes:
3811
+ *
3812
+ * - `name`: Name of the tool.
3813
+ * - `description`: Optional, but strongly-recommended description of the tool.
3814
+ * - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
3815
+ * tool `input` shape that the model will produce in `tool_use` output content
3816
+ * blocks.
3817
+ *
3818
+ * For example, if you defined `tools` as:
3819
+ *
3820
+ * ```json
3821
+ * [
3822
+ * {
3823
+ * "name": "get_stock_price",
3824
+ * "description": "Get the current stock price for a given ticker symbol.",
3825
+ * "input_schema": {
3826
+ * "type": "object",
3827
+ * "properties": {
3828
+ * "ticker": {
3829
+ * "type": "string",
3830
+ * "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
3831
+ * }
3832
+ * },
3833
+ * "required": ["ticker"]
3834
+ * }
3835
+ * }
3836
+ * ]
3837
+ * ```
3838
+ *
3839
+ * And then asked the model "What's the S&P 500 at today?", the model might produce
3840
+ * `tool_use` content blocks in the response like this:
3841
+ *
3842
+ * ```json
3843
+ * [
3844
+ * {
3845
+ * "type": "tool_use",
3846
+ * "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
3847
+ * "name": "get_stock_price",
3848
+ * "input": { "ticker": "^GSPC" }
3849
+ * }
3850
+ * ]
3851
+ * ```
3852
+ *
3853
+ * You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
3854
+ * input, and return the following back to the model in a subsequent `user`
3855
+ * message:
3856
+ *
3857
+ * ```json
3858
+ * [
3859
+ * {
3860
+ * "type": "tool_result",
3861
+ * "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
3862
+ * "content": "259.75 USD"
3863
+ * }
3864
+ * ]
3865
+ * ```
3866
+ *
3867
+ * Tools can be used for workflows that include running client-side tools and
3868
+ * functions, or more generally whenever you want the model to produce a particular
3869
+ * JSON structure of output.
3870
+ *
3871
+ * See our
3872
+ * [guide](https://platform.puku.com/docs/en/agents-and-tools/tool-use/overview)
3873
+ * for more details.
3874
+ */
3875
+ tools?: Array<MessageCountTokensTool>;
3876
+ /**
3877
+ * Header param: The user profile ID to attribute this request to. Use when acting
3878
+ * on behalf of a party other than your organization. Requires the `user-profiles`
3879
+ * beta header.
3880
+ */
3881
+ user_profile_id?: string;
3882
+ }
3883
+ export declare namespace Messages {
3884
+ 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 BrowserCloseTabConfig as BrowserCloseTabConfig, type BrowserDoubleClickConfig as BrowserDoubleClickConfig, type BrowserFileUploadConfig as BrowserFileUploadConfig, type BrowserFindConfig as BrowserFindConfig, type BrowserFormInputConfig as BrowserFormInputConfig, type BrowserGetPageTextConfig as BrowserGetPageTextConfig, type BrowserHoldKeyConfig as BrowserHoldKeyConfig, type BrowserHoverConfig as BrowserHoverConfig, type BrowserJavascriptExecConfig as BrowserJavascriptExecConfig, type BrowserKeyConfig as BrowserKeyConfig, type BrowserLeftClickConfig as BrowserLeftClickConfig, type BrowserLeftClickDragConfig as BrowserLeftClickDragConfig, type BrowserLeftMouseDownConfig as BrowserLeftMouseDownConfig, type BrowserLeftMouseUpConfig as BrowserLeftMouseUpConfig, type BrowserListTabsConfig as BrowserListTabsConfig, type BrowserMiddleClickConfig as BrowserMiddleClickConfig, type BrowserMouseMoveConfig as BrowserMouseMoveConfig, type BrowserNavigateConfig as BrowserNavigateConfig, type BrowserNewTabConfig as BrowserNewTabConfig, type BrowserReadConsoleConfig as BrowserReadConsoleConfig, type BrowserReadNetworkConfig as BrowserReadNetworkConfig, type BrowserReadPageConfig as BrowserReadPageConfig, type BrowserRightClickConfig as BrowserRightClickConfig, type BrowserScreenshotConfig as BrowserScreenshotConfig, type BrowserScrollConfig as BrowserScrollConfig, type BrowserScrollToConfig as BrowserScrollToConfig, type BrowserStateBlockParam as BrowserStateBlockParam, type BrowserStateChange as BrowserStateChange, type BrowserStateChangeDownloadCompleted as BrowserStateChangeDownloadCompleted, type BrowserStateChangeDownloadFailed as BrowserStateChangeDownloadFailed, type BrowserStateChangeDownloadStarted as BrowserStateChangeDownloadStarted, type BrowserStateChangeTabOpened as BrowserStateChangeTabOpened, type BrowserStateTabEntry as BrowserStateTabEntry, type BrowserSwitchTabConfig as BrowserSwitchTabConfig, type BrowserToolset20260801 as BrowserToolset20260801, type BrowserToolsetConfigs as BrowserToolsetConfigs, type BrowserTripleClickConfig as BrowserTripleClickConfig, type BrowserTypeConfig as BrowserTypeConfig, type BrowserWaitConfig as BrowserWaitConfig, type BrowserZoomConfig as BrowserZoomConfig, 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 CodeExecutionTool20260521 as CodeExecutionTool20260521, 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 ComputerCursorPositionConfig as ComputerCursorPositionConfig, type ComputerDoubleClickConfig as ComputerDoubleClickConfig, type ComputerHoldKeyConfig as ComputerHoldKeyConfig, type ComputerKeyConfig as ComputerKeyConfig, type ComputerLeftClickConfig as ComputerLeftClickConfig, type ComputerLeftClickDragConfig as ComputerLeftClickDragConfig, type ComputerLeftMouseDownConfig as ComputerLeftMouseDownConfig, type ComputerLeftMouseUpConfig as ComputerLeftMouseUpConfig, type ComputerMiddleClickConfig as ComputerMiddleClickConfig, type ComputerMouseMoveConfig as ComputerMouseMoveConfig, type ComputerRightClickConfig as ComputerRightClickConfig, type ComputerScreenshotConfig as ComputerScreenshotConfig, type ComputerScrollConfig as ComputerScrollConfig, type ComputerToolset20260801 as ComputerToolset20260801, type ComputerToolsetConfigs as ComputerToolsetConfigs, type ComputerTripleClickConfig as ComputerTripleClickConfig, type ComputerTypeConfig as ComputerTypeConfig, type ComputerWaitConfig as ComputerWaitConfig, type ComputerZoomConfig as ComputerZoomConfig, type Container as Container, type ContainerParams as ContainerParams, type ContainerSkill as ContainerSkill, 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 FileDocumentSource as FileDocumentSource, type FileImageSource as FileImageSource, type ImageBlockParam as ImageBlockParam, type ImageTransformationsParam as ImageTransformationsParam, type InputJSONDelta as InputJSONDelta, type JSONOutputFormat as JSONOutputFormat, type MemoryTool20250818 as MemoryTool20250818, type Message as Message, type MessageCountTokensTool as MessageCountTokensTool, type MessageCreateParamsContainer as MessageCreateParamsContainer, 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 OutputTokensDetails as OutputTokensDetails, 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 RefusalStopDetails as RefusalStopDetails, 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 SkillParams as SkillParams, 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 WebFetchTool20260318 as WebFetchTool20260318, 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 WebSearchTool20260318 as WebSearchTool20260318, 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, };
3885
+ 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, };
3886
+ }