@anthropic-ai/sdk 0.117.1 → 0.119.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/client.d.mts +8 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +8 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -1
  9. package/client.mjs.map +1 -1
  10. package/core/api-promise.d.mts +1 -0
  11. package/core/api-promise.d.mts.map +1 -1
  12. package/core/api-promise.d.ts +1 -0
  13. package/core/api-promise.d.ts.map +1 -1
  14. package/core/api-promise.js +7 -2
  15. package/core/api-promise.js.map +1 -1
  16. package/core/api-promise.mjs +8 -3
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +1 -0
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +1 -0
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +1 -0
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +1 -0
  25. package/core/error.mjs.map +1 -1
  26. package/core/middleware.js +1 -1
  27. package/core/middleware.js.map +1 -1
  28. package/core/middleware.mjs +2 -2
  29. package/core/middleware.mjs.map +1 -1
  30. package/helpers/beta/zod.d.mts.map +1 -1
  31. package/helpers/beta/zod.d.ts.map +1 -1
  32. package/helpers/beta/zod.js +1 -2
  33. package/helpers/beta/zod.js.map +1 -1
  34. package/helpers/beta/zod.mjs +1 -2
  35. package/helpers/beta/zod.mjs.map +1 -1
  36. package/helpers/zod.d.mts.map +1 -1
  37. package/helpers/zod.d.ts.map +1 -1
  38. package/helpers/zod.js +1 -2
  39. package/helpers/zod.js.map +1 -1
  40. package/helpers/zod.mjs +1 -2
  41. package/helpers/zod.mjs.map +1 -1
  42. package/internal/parse.d.mts +2 -1
  43. package/internal/parse.d.mts.map +1 -1
  44. package/internal/parse.d.ts +2 -1
  45. package/internal/parse.d.ts.map +1 -1
  46. package/internal/parse.js +6 -6
  47. package/internal/parse.js.map +1 -1
  48. package/internal/parse.mjs +5 -5
  49. package/internal/parse.mjs.map +1 -1
  50. package/lib/BetaMessageStream.d.mts +2 -0
  51. package/lib/BetaMessageStream.d.mts.map +1 -1
  52. package/lib/BetaMessageStream.d.ts +2 -0
  53. package/lib/BetaMessageStream.d.ts.map +1 -1
  54. package/lib/BetaMessageStream.js +8 -2
  55. package/lib/BetaMessageStream.js.map +1 -1
  56. package/lib/BetaMessageStream.mjs +8 -2
  57. package/lib/BetaMessageStream.mjs.map +1 -1
  58. package/lib/MessageStream.d.mts +2 -0
  59. package/lib/MessageStream.d.mts.map +1 -1
  60. package/lib/MessageStream.d.ts +2 -0
  61. package/lib/MessageStream.d.ts.map +1 -1
  62. package/lib/MessageStream.js +8 -2
  63. package/lib/MessageStream.js.map +1 -1
  64. package/lib/MessageStream.mjs +8 -2
  65. package/lib/MessageStream.mjs.map +1 -1
  66. package/lib/environments/worker.d.mts +10 -6
  67. package/lib/environments/worker.d.mts.map +1 -1
  68. package/lib/environments/worker.d.ts +10 -6
  69. package/lib/environments/worker.d.ts.map +1 -1
  70. package/lib/environments/worker.js +22 -15
  71. package/lib/environments/worker.js.map +1 -1
  72. package/lib/environments/worker.mjs +22 -15
  73. package/lib/environments/worker.mjs.map +1 -1
  74. package/lib/tools/BetaRunnableTool.d.mts +21 -40
  75. package/lib/tools/BetaRunnableTool.d.mts.map +1 -1
  76. package/lib/tools/BetaRunnableTool.d.ts +21 -40
  77. package/lib/tools/BetaRunnableTool.d.ts.map +1 -1
  78. package/lib/tools/BetaRunnableTool.js +7 -16
  79. package/lib/tools/BetaRunnableTool.js.map +1 -1
  80. package/lib/tools/BetaRunnableTool.mjs +7 -16
  81. package/lib/tools/BetaRunnableTool.mjs.map +1 -1
  82. package/lib/tools/BetaToolRunner.d.mts.map +1 -1
  83. package/lib/tools/BetaToolRunner.d.ts.map +1 -1
  84. package/lib/tools/BetaToolRunner.js +3 -13
  85. package/lib/tools/BetaToolRunner.js.map +1 -1
  86. package/lib/tools/BetaToolRunner.mjs +3 -13
  87. package/lib/tools/BetaToolRunner.mjs.map +1 -1
  88. package/lib/tools/SessionToolRunner.d.mts +6 -0
  89. package/lib/tools/SessionToolRunner.d.mts.map +1 -1
  90. package/lib/tools/SessionToolRunner.d.ts +6 -0
  91. package/lib/tools/SessionToolRunner.d.ts.map +1 -1
  92. package/lib/tools/SessionToolRunner.js +37 -8
  93. package/lib/tools/SessionToolRunner.js.map +1 -1
  94. package/lib/tools/SessionToolRunner.mjs +38 -9
  95. package/lib/tools/SessionToolRunner.mjs.map +1 -1
  96. package/package.json +1 -1
  97. package/resources/beta/agents/agents.d.mts +3 -3
  98. package/resources/beta/agents/agents.d.ts +3 -3
  99. package/resources/beta/agents/agents.js +1 -1
  100. package/resources/beta/agents/agents.mjs +1 -1
  101. package/resources/beta/beta.d.mts +5 -5
  102. package/resources/beta/beta.d.mts.map +1 -1
  103. package/resources/beta/beta.d.ts +5 -5
  104. package/resources/beta/beta.d.ts.map +1 -1
  105. package/resources/beta/beta.js.map +1 -1
  106. package/resources/beta/beta.mjs.map +1 -1
  107. package/resources/beta/dreams.d.mts +2 -2
  108. package/resources/beta/dreams.d.ts +2 -2
  109. package/resources/beta/environments/environments.d.mts +4 -3
  110. package/resources/beta/environments/environments.d.mts.map +1 -1
  111. package/resources/beta/environments/environments.d.ts +4 -3
  112. package/resources/beta/environments/environments.d.ts.map +1 -1
  113. package/resources/beta/environments/environments.js.map +1 -1
  114. package/resources/beta/environments/environments.mjs.map +1 -1
  115. package/resources/beta/files.d.mts +22 -22
  116. package/resources/beta/files.d.mts.map +1 -1
  117. package/resources/beta/files.d.ts +22 -22
  118. package/resources/beta/files.d.ts.map +1 -1
  119. package/resources/beta/files.js +4 -4
  120. package/resources/beta/files.js.map +1 -1
  121. package/resources/beta/files.mjs +4 -4
  122. package/resources/beta/files.mjs.map +1 -1
  123. package/resources/beta/index.d.mts +2 -2
  124. package/resources/beta/index.d.mts.map +1 -1
  125. package/resources/beta/index.d.ts +2 -2
  126. package/resources/beta/index.d.ts.map +1 -1
  127. package/resources/beta/index.js.map +1 -1
  128. package/resources/beta/index.mjs.map +1 -1
  129. package/resources/beta/memory-stores/index.d.mts +1 -1
  130. package/resources/beta/memory-stores/index.d.mts.map +1 -1
  131. package/resources/beta/memory-stores/index.d.ts +1 -1
  132. package/resources/beta/memory-stores/index.d.ts.map +1 -1
  133. package/resources/beta/memory-stores/index.js.map +1 -1
  134. package/resources/beta/memory-stores/index.mjs.map +1 -1
  135. package/resources/beta/memory-stores/memory-stores.d.mts +2 -2
  136. package/resources/beta/memory-stores/memory-stores.d.mts.map +1 -1
  137. package/resources/beta/memory-stores/memory-stores.d.ts +2 -2
  138. package/resources/beta/memory-stores/memory-stores.d.ts.map +1 -1
  139. package/resources/beta/memory-stores/memory-stores.js.map +1 -1
  140. package/resources/beta/memory-stores/memory-stores.mjs.map +1 -1
  141. package/resources/beta/memory-stores/memory-versions.d.mts +17 -2
  142. package/resources/beta/memory-stores/memory-versions.d.mts.map +1 -1
  143. package/resources/beta/memory-stores/memory-versions.d.ts +17 -2
  144. package/resources/beta/memory-stores/memory-versions.d.ts.map +1 -1
  145. package/resources/beta/messages/batches.d.mts +1 -1
  146. package/resources/beta/messages/batches.d.ts +1 -1
  147. package/resources/beta/messages/batches.js +1 -1
  148. package/resources/beta/messages/batches.mjs +1 -1
  149. package/resources/beta/messages/index.d.mts +1 -1
  150. package/resources/beta/messages/index.d.mts.map +1 -1
  151. package/resources/beta/messages/index.d.ts +1 -1
  152. package/resources/beta/messages/index.d.ts.map +1 -1
  153. package/resources/beta/messages/index.js.map +1 -1
  154. package/resources/beta/messages/index.mjs.map +1 -1
  155. package/resources/beta/messages/messages.d.mts +1204 -25
  156. package/resources/beta/messages/messages.d.mts.map +1 -1
  157. package/resources/beta/messages/messages.d.ts +1204 -25
  158. package/resources/beta/messages/messages.d.ts.map +1 -1
  159. package/resources/beta/messages/messages.js +1 -1
  160. package/resources/beta/messages/messages.js.map +1 -1
  161. package/resources/beta/messages/messages.mjs +1 -1
  162. package/resources/beta/messages/messages.mjs.map +1 -1
  163. package/resources/beta/sessions/sessions.d.mts +1 -1
  164. package/resources/beta/sessions/sessions.d.ts +1 -1
  165. package/resources/beta/user-profiles.d.mts +35 -9
  166. package/resources/beta/user-profiles.d.mts.map +1 -1
  167. package/resources/beta/user-profiles.d.ts +35 -9
  168. package/resources/beta/user-profiles.d.ts.map +1 -1
  169. package/resources/beta/user-profiles.js +5 -5
  170. package/resources/beta/user-profiles.mjs +5 -5
  171. package/resources/files.d.mts +105 -0
  172. package/resources/files.d.mts.map +1 -0
  173. package/resources/files.d.ts +105 -0
  174. package/resources/files.d.ts.map +1 -0
  175. package/resources/files.js +52 -0
  176. package/resources/files.js.map +1 -0
  177. package/resources/files.mjs +48 -0
  178. package/resources/files.mjs.map +1 -0
  179. package/resources/index.d.mts +3 -1
  180. package/resources/index.d.mts.map +1 -1
  181. package/resources/index.d.ts +3 -1
  182. package/resources/index.d.ts.map +1 -1
  183. package/resources/index.js +5 -1
  184. package/resources/index.js.map +1 -1
  185. package/resources/index.mjs +2 -0
  186. package/resources/index.mjs.map +1 -1
  187. package/resources/messages/batches.d.mts +1 -1
  188. package/resources/messages/batches.d.ts +1 -1
  189. package/resources/messages/batches.js +1 -1
  190. package/resources/messages/batches.mjs +1 -1
  191. package/resources/messages/index.d.mts +1 -1
  192. package/resources/messages/index.d.mts.map +1 -1
  193. package/resources/messages/index.d.ts +1 -1
  194. package/resources/messages/index.d.ts.map +1 -1
  195. package/resources/messages/index.js.map +1 -1
  196. package/resources/messages/index.mjs.map +1 -1
  197. package/resources/messages/messages.d.mts +1270 -28
  198. package/resources/messages/messages.d.mts.map +1 -1
  199. package/resources/messages/messages.d.ts +1270 -28
  200. package/resources/messages/messages.d.ts.map +1 -1
  201. package/resources/messages/messages.js +1 -1
  202. package/resources/messages/messages.js.map +1 -1
  203. package/resources/messages/messages.mjs +1 -1
  204. package/resources/messages/messages.mjs.map +1 -1
  205. package/resources/skills/index.d.mts +3 -0
  206. package/resources/skills/index.d.mts.map +1 -0
  207. package/resources/skills/index.d.ts +3 -0
  208. package/resources/skills/index.d.ts.map +1 -0
  209. package/resources/skills/index.js +9 -0
  210. package/resources/skills/index.js.map +1 -0
  211. package/resources/skills/index.mjs +4 -0
  212. package/resources/skills/index.mjs.map +1 -0
  213. package/resources/skills/skills.d.mts +129 -0
  214. package/resources/skills/skills.d.mts.map +1 -0
  215. package/resources/skills/skills.d.ts +129 -0
  216. package/resources/skills/skills.d.ts.map +1 -0
  217. package/resources/skills/skills.js +44 -0
  218. package/resources/skills/skills.js.map +1 -0
  219. package/resources/skills/skills.mjs +39 -0
  220. package/resources/skills/skills.mjs.map +1 -0
  221. package/resources/skills/versions.d.mts +104 -0
  222. package/resources/skills/versions.d.mts.map +1 -0
  223. package/resources/skills/versions.d.ts +104 -0
  224. package/resources/skills/versions.d.ts.map +1 -0
  225. package/resources/skills/versions.js +41 -0
  226. package/resources/skills/versions.js.map +1 -0
  227. package/resources/skills/versions.mjs +37 -0
  228. package/resources/skills/versions.mjs.map +1 -0
  229. package/resources/skills.d.mts +2 -0
  230. package/resources/skills.d.mts.map +1 -0
  231. package/resources/skills.d.ts +2 -0
  232. package/resources/skills.d.ts.map +1 -0
  233. package/resources/skills.js +6 -0
  234. package/resources/skills.js.map +1 -0
  235. package/resources/skills.mjs +3 -0
  236. package/resources/skills.mjs.map +1 -0
  237. package/src/client.ts +173 -3
  238. package/src/core/api-promise.ts +14 -4
  239. package/src/core/error.ts +2 -0
  240. package/src/core/middleware.ts +2 -2
  241. package/src/helpers/beta/zod.ts +1 -3
  242. package/src/helpers/zod.ts +1 -3
  243. package/src/internal/parse.ts +6 -6
  244. package/src/lib/BetaMessageStream.ts +8 -0
  245. package/src/lib/MessageStream.ts +8 -0
  246. package/src/lib/environments/worker.ts +28 -14
  247. package/src/lib/tools/BetaRunnableTool.ts +26 -43
  248. package/src/lib/tools/BetaToolRunner.ts +6 -13
  249. package/src/lib/tools/SessionToolRunner.ts +39 -6
  250. package/src/resources/beta/agents/agents.ts +3 -3
  251. package/src/resources/beta/beta.ts +127 -8
  252. package/src/resources/beta/dreams.ts +2 -2
  253. package/src/resources/beta/environments/environments.ts +4 -3
  254. package/src/resources/beta/files.ts +27 -27
  255. package/src/resources/beta/index.ts +63 -4
  256. package/src/resources/beta/memory-stores/index.ts +1 -0
  257. package/src/resources/beta/memory-stores/memory-stores.ts +2 -0
  258. package/src/resources/beta/memory-stores/memory-versions.ts +21 -1
  259. package/src/resources/beta/messages/batches.ts +1 -1
  260. package/src/resources/beta/messages/index.ts +60 -1
  261. package/src/resources/beta/messages/messages.ts +1862 -435
  262. package/src/resources/beta/sessions/sessions.ts +1 -1
  263. package/src/resources/beta/user-profiles.ts +44 -15
  264. package/src/resources/files.ts +163 -0
  265. package/src/resources/index.ts +83 -1
  266. package/src/resources/messages/batches.ts +1 -1
  267. package/src/resources/messages/index.ts +66 -1
  268. package/src/resources/messages/messages.ts +1830 -320
  269. package/src/resources/skills/index.ts +21 -0
  270. package/src/resources/skills/skills.ts +194 -0
  271. package/src/resources/skills/versions.ts +160 -0
  272. package/src/resources/skills.ts +3 -0
  273. package/src/version.ts +1 -1
  274. package/version.d.mts +1 -1
  275. package/version.d.ts +1 -1
  276. package/version.js +1 -1
  277. package/version.mjs +1 -1
@@ -370,7 +370,7 @@ export interface BetaManagedAgentsAgentWithOverridesParams {
370
370
  mcp_servers?: Array<AgentsAPI.BetaManagedAgentsURLMCPServerParams>;
371
371
 
372
372
  /**
373
- * Replacement model. Accepts the model string, e.g. `claude-opus-4-6`, or a
373
+ * Replacement model. Accepts the model string, e.g. `claude-opus-5`, or a
374
374
  * `model_config` object. Omit to use the agent's model.
375
375
  */
376
376
  model?: AgentsAPI.BetaManagedAgentsModel | AgentsAPI.BetaManagedAgentsModelConfigParams;
@@ -24,7 +24,7 @@ export class UserProfiles extends APIResource {
24
24
  body,
25
25
  ...options,
26
26
  headers: buildHeaders([
27
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },
27
+ { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
28
28
  options?.headers,
29
29
  ]),
30
30
  });
@@ -50,7 +50,7 @@ export class UserProfiles extends APIResource {
50
50
  return this._client.get(path`/v1/user_profiles/${userProfileID}?beta=true`, {
51
51
  ...options,
52
52
  headers: buildHeaders([
53
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },
53
+ { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
54
54
  options?.headers,
55
55
  ]),
56
56
  });
@@ -77,7 +77,7 @@ export class UserProfiles extends APIResource {
77
77
  body,
78
78
  ...options,
79
79
  headers: buildHeaders([
80
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },
80
+ { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
81
81
  options?.headers,
82
82
  ]),
83
83
  });
@@ -103,7 +103,7 @@ export class UserProfiles extends APIResource {
103
103
  query,
104
104
  ...options,
105
105
  headers: buildHeaders([
106
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },
106
+ { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
107
107
  options?.headers,
108
108
  ]),
109
109
  });
@@ -129,7 +129,7 @@ export class UserProfiles extends APIResource {
129
129
  return this._client.post(path`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, {
130
130
  ...options,
131
131
  headers: buildHeaders([
132
- { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-03-24'].toString() },
132
+ { 'anthropic-beta': [...(betas ?? []), 'user-profiles-2026-08-18'].toString() },
133
133
  options?.headers,
134
134
  ]),
135
135
  });
@@ -155,13 +155,6 @@ export interface BetaUserProfile {
155
155
  */
156
156
  metadata: { [key: string]: string };
157
157
 
158
- /**
159
- * How the entity behind a user profile relates to the platform that owns the API
160
- * key. `external`: an individual end-user of the platform. `resold`: a company the
161
- * platform resells Claude access to. `internal`: the platform's own usage.
162
- */
163
- relationship: 'external' | 'resold' | 'internal';
164
-
165
158
  /**
166
159
  * Trust grants for this profile, keyed by grant name. Key omitted when no grant is
167
160
  * active or in flight.
@@ -178,6 +171,15 @@ export interface BetaUserProfile {
178
171
  */
179
172
  updated_at: string;
180
173
 
174
+ /**
175
+ * How the platform uses the API on behalf of the entity this profile represents.
176
+ * `application`: the platform sells a product that uses the API behind the scenes,
177
+ * and the profile represents an individual end-user of that product.
178
+ * `passthrough`: the platform resells raw inference, and the profile identifies
179
+ * the resold-to company.
180
+ */
181
+ access_type?: 'application' | 'passthrough';
182
+
181
183
  /**
182
184
  * Platform's own identifier for this user. Not enforced unique.
183
185
  */
@@ -185,9 +187,17 @@ export interface BetaUserProfile {
185
187
 
186
188
  /**
187
189
  * Real-world name of the entity this profile represents (company or individual).
188
- * For `resold` this is the resold-to company's name.
190
+ * For a resold-to company (`access_type` `passthrough`, or `relationship` `resold`
191
+ * under the `user-profiles-2026-03-24` header) this is that company's name.
189
192
  */
190
193
  name?: string | null;
194
+
195
+ /**
196
+ * How the entity behind a user profile relates to the platform that owns the API
197
+ * key. `external`: an individual end-user of the platform. `resold`: a company the
198
+ * platform resells Claude access to. `internal`: the platform's own usage.
199
+ */
200
+ relationship?: 'external' | 'resold' | 'internal';
191
201
  }
192
202
 
193
203
  export interface BetaUserProfileEnrollmentURL {
@@ -215,6 +225,15 @@ export interface BetaUserProfileTrustGrant {
215
225
  }
216
226
 
217
227
  export interface UserProfileCreateParams {
228
+ /**
229
+ * Body param: How the platform uses the API on behalf of the entity this profile
230
+ * represents. `application`: the platform sells a product that uses the API behind
231
+ * the scenes, and the profile represents an individual end-user of that product.
232
+ * `passthrough`: the platform resells raw inference, and the profile identifies
233
+ * the resold-to company.
234
+ */
235
+ access_type?: 'application' | 'passthrough';
236
+
218
237
  /**
219
238
  * Body param: Platform's own identifier for this user. Not enforced unique.
220
239
  * Maximum 255 characters.
@@ -230,8 +249,9 @@ export interface UserProfileCreateParams {
230
249
 
231
250
  /**
232
251
  * Body param: Optional for all profiles. Real-world name of the entity this
233
- * profile represents (company or individual); for `resold` profiles, the resold-to
234
- * company's name where known. Maximum 255 characters.
252
+ * profile represents (company or individual); for a resold-to company
253
+ * (`relationship` `resold` / `access_type` `passthrough`), that company's name
254
+ * where known. Maximum 255 characters.
235
255
  */
236
256
  name?: string | null;
237
257
 
@@ -257,6 +277,15 @@ export interface UserProfileRetrieveParams {
257
277
  }
258
278
 
259
279
  export interface UserProfileUpdateParams {
280
+ /**
281
+ * Body param: How the platform uses the API on behalf of the entity this profile
282
+ * represents. `application`: the platform sells a product that uses the API behind
283
+ * the scenes, and the profile represents an individual end-user of that product.
284
+ * `passthrough`: the platform resells raw inference, and the profile identifies
285
+ * the resold-to company.
286
+ */
287
+ access_type?: 'application' | 'passthrough' | null;
288
+
260
289
  /**
261
290
  * Body param: If present, replaces the stored external_id. Omit to leave
262
291
  * unchanged. Maximum 255 characters.
@@ -0,0 +1,163 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { PageCursor, type PageCursorParams, PagePromise } from '../core/pagination';
6
+ import { type Uploadable } from '../core/uploads';
7
+ import { buildHeaders } from '../internal/headers';
8
+ import { RequestOptions } from '../internal/request-options';
9
+ import { stainlessHelperHeaderFromFile } from '../internal/stainless-helper-header';
10
+ import { multipartFormRequestOptions } from '../internal/uploads';
11
+ import { path } from '../internal/utils/path';
12
+
13
+ export class Files extends APIResource {
14
+ /**
15
+ * List Files
16
+ */
17
+ list(
18
+ query: FileListParams | null | undefined = {},
19
+ options?: RequestOptions,
20
+ ): PagePromise<FileMetadataPageCursor, FileMetadata> {
21
+ return this._client.getAPIList('/v1/files', PageCursor<FileMetadata>, { query, ...options });
22
+ }
23
+
24
+ /**
25
+ * Delete File
26
+ */
27
+ delete(fileID: string, options?: RequestOptions): APIPromise<DeletedFile> {
28
+ return this._client.delete(path`/v1/files/${fileID}`, options);
29
+ }
30
+
31
+ /**
32
+ * Download File
33
+ */
34
+ download(fileID: string, options?: RequestOptions): APIPromise<Response> {
35
+ return this._client.get(path`/v1/files/${fileID}/content`, {
36
+ ...options,
37
+ headers: buildHeaders([{ Accept: 'application/binary' }, options?.headers]),
38
+ __binaryResponse: true,
39
+ });
40
+ }
41
+
42
+ /**
43
+ * Get File Metadata
44
+ */
45
+ retrieveMetadata(fileID: string, options?: RequestOptions): APIPromise<FileMetadata> {
46
+ return this._client.get(path`/v1/files/${fileID}`, options);
47
+ }
48
+
49
+ /**
50
+ * Upload File
51
+ */
52
+ upload(body: FileUploadParams, options?: RequestOptions): APIPromise<FileMetadata> {
53
+ return this._client.post(
54
+ '/v1/files',
55
+ multipartFormRequestOptions(
56
+ {
57
+ body,
58
+ ...options,
59
+ headers: buildHeaders([stainlessHelperHeaderFromFile(body.file), options?.headers]),
60
+ },
61
+ this._client,
62
+ ),
63
+ );
64
+ }
65
+ }
66
+
67
+ export type FileMetadataPageCursor = PageCursor<FileMetadata>;
68
+
69
+ export interface DeletedFile {
70
+ /**
71
+ * ID of the deleted file.
72
+ */
73
+ id: string;
74
+
75
+ /**
76
+ * Deleted object type.
77
+ *
78
+ * For file deletion, this is always `"file_deleted"`.
79
+ */
80
+ type?: 'file_deleted';
81
+ }
82
+
83
+ export interface FileMetadata {
84
+ /**
85
+ * Unique object identifier.
86
+ *
87
+ * The format and length of IDs may change over time.
88
+ */
89
+ id: string;
90
+
91
+ /**
92
+ * RFC 3339 datetime string representing when the file was created.
93
+ */
94
+ created_at: string;
95
+
96
+ /**
97
+ * Original filename of the uploaded file.
98
+ */
99
+ filename: string;
100
+
101
+ /**
102
+ * MIME type of the file.
103
+ */
104
+ mime_type: string;
105
+
106
+ /**
107
+ * Size of the file in bytes.
108
+ */
109
+ size_bytes: number;
110
+
111
+ /**
112
+ * Object type.
113
+ *
114
+ * For files, this is always `"file"`.
115
+ */
116
+ type: 'file';
117
+
118
+ /**
119
+ * Whether the file can be downloaded.
120
+ */
121
+ downloadable?: boolean;
122
+
123
+ /**
124
+ * RFC 3339 datetime string representing when the file will expire and become
125
+ * unavailable for download. Null if the file does not expire. For files uploaded
126
+ * with `expires_in_seconds`, this is the upload time plus that value.
127
+ */
128
+ expires_at?: string | null;
129
+ }
130
+
131
+ export interface FileListParams extends PageCursorParams {
132
+ /**
133
+ * Restrict the result set to Files whose `id` is in this list. At most 100 entries
134
+ * (after de-duplication). Mutually exclusive with `page` and `limit`. When
135
+ * supplied, the response is always a single page (`next_page` is null). IDs that
136
+ * do not resolve to a visible File — including deleted Files — are silently
137
+ * omitted.
138
+ */
139
+ ids?: Array<string> | null;
140
+ }
141
+
142
+ export interface FileUploadParams {
143
+ /**
144
+ * The file to upload
145
+ */
146
+ file: Uploadable;
147
+
148
+ /**
149
+ * Seconds from upload until the file expires and its bytes become permanently
150
+ * unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).
151
+ */
152
+ expires_in_seconds?: number;
153
+ }
154
+
155
+ export declare namespace Files {
156
+ export {
157
+ type DeletedFile as DeletedFile,
158
+ type FileMetadata as FileMetadata,
159
+ type FileMetadataPageCursor as FileMetadataPageCursor,
160
+ type FileListParams as FileListParams,
161
+ type FileUploadParams as FileUploadParams,
162
+ };
163
+ }
@@ -25,6 +25,14 @@ export {
25
25
  type CompletionCreateParamsNonStreaming,
26
26
  type CompletionCreateParamsStreaming,
27
27
  } from './completions';
28
+ export {
29
+ Files,
30
+ type DeletedFile,
31
+ type FileMetadata,
32
+ type FileListParams,
33
+ type FileUploadParams,
34
+ type FileMetadataPageCursor,
35
+ } from './files';
28
36
  export {
29
37
  Messages,
30
38
  type Base64ImageSource,
@@ -38,6 +46,46 @@ export {
38
46
  type BashCodeExecutionToolResultError,
39
47
  type BashCodeExecutionToolResultErrorCode,
40
48
  type BashCodeExecutionToolResultErrorParam,
49
+ type BrowserCloseTabConfig,
50
+ type BrowserDoubleClickConfig,
51
+ type BrowserFileUploadConfig,
52
+ type BrowserFindConfig,
53
+ type BrowserFormInputConfig,
54
+ type BrowserGetPageTextConfig,
55
+ type BrowserHoldKeyConfig,
56
+ type BrowserHoverConfig,
57
+ type BrowserJavascriptExecConfig,
58
+ type BrowserKeyConfig,
59
+ type BrowserLeftClickConfig,
60
+ type BrowserLeftClickDragConfig,
61
+ type BrowserLeftMouseDownConfig,
62
+ type BrowserLeftMouseUpConfig,
63
+ type BrowserListTabsConfig,
64
+ type BrowserMiddleClickConfig,
65
+ type BrowserMouseMoveConfig,
66
+ type BrowserNavigateConfig,
67
+ type BrowserNewTabConfig,
68
+ type BrowserReadConsoleConfig,
69
+ type BrowserReadNetworkConfig,
70
+ type BrowserReadPageConfig,
71
+ type BrowserRightClickConfig,
72
+ type BrowserScreenshotConfig,
73
+ type BrowserScrollConfig,
74
+ type BrowserScrollToConfig,
75
+ type BrowserStateBlockParam,
76
+ type BrowserStateChange,
77
+ type BrowserStateChangeDownloadCompleted,
78
+ type BrowserStateChangeDownloadFailed,
79
+ type BrowserStateChangeDownloadStarted,
80
+ type BrowserStateChangeTabOpened,
81
+ type BrowserStateTabEntry,
82
+ type BrowserSwitchTabConfig,
83
+ type BrowserToolset20260801,
84
+ type BrowserToolsetConfigs,
85
+ type BrowserTripleClickConfig,
86
+ type BrowserTypeConfig,
87
+ type BrowserWaitConfig,
88
+ type BrowserZoomConfig,
41
89
  type CacheControlEphemeral,
42
90
  type CacheCreation,
43
91
  type CitationCharLocation,
@@ -68,7 +116,28 @@ export {
68
116
  type CodeExecutionToolResultError,
69
117
  type CodeExecutionToolResultErrorCode,
70
118
  type CodeExecutionToolResultErrorParam,
119
+ type ComputerCursorPositionConfig,
120
+ type ComputerDoubleClickConfig,
121
+ type ComputerHoldKeyConfig,
122
+ type ComputerKeyConfig,
123
+ type ComputerLeftClickConfig,
124
+ type ComputerLeftClickDragConfig,
125
+ type ComputerLeftMouseDownConfig,
126
+ type ComputerLeftMouseUpConfig,
127
+ type ComputerMiddleClickConfig,
128
+ type ComputerMouseMoveConfig,
129
+ type ComputerRightClickConfig,
130
+ type ComputerScreenshotConfig,
131
+ type ComputerScrollConfig,
132
+ type ComputerToolset20260801,
133
+ type ComputerToolsetConfigs,
134
+ type ComputerTripleClickConfig,
135
+ type ComputerTypeConfig,
136
+ type ComputerWaitConfig,
137
+ type ComputerZoomConfig,
71
138
  type Container,
139
+ type ContainerParams,
140
+ type ContainerSkill,
72
141
  type ContainerUploadBlock,
73
142
  type ContainerUploadBlockParam,
74
143
  type ContentBlock,
@@ -82,19 +151,22 @@ export {
82
151
  type DocumentBlockParam,
83
152
  type EncryptedCodeExecutionResultBlock,
84
153
  type EncryptedCodeExecutionResultBlockParam,
154
+ type FileDocumentSource,
155
+ type FileImageSource,
85
156
  type ImageBlockParam,
157
+ type ImageTransformationsParam,
86
158
  type InputJSONDelta,
87
159
  type JSONOutputFormat,
88
160
  type MemoryTool20250818,
89
161
  type Message,
90
162
  type MessageCountTokensTool,
163
+ type MessageCreateParamsContainer,
91
164
  type MessageDeltaEvent,
92
165
  type MessageDeltaUsage,
93
166
  type MessageParam,
94
167
  type MessageStreamParams,
95
168
  type MessageTokensCount,
96
169
  type Metadata,
97
- type MidConversationSystemBlockParam,
98
170
  type Model,
99
171
  type OutputConfig,
100
172
  type OutputTokensDetails,
@@ -117,6 +189,7 @@ export {
117
189
  type ServerToolUseBlock,
118
190
  type ServerToolUseBlockParam,
119
191
  type SignatureDelta,
192
+ type SkillParams,
120
193
  type StopReason,
121
194
  type TextBlock,
122
195
  type TextBlockParam,
@@ -211,3 +284,12 @@ export {
211
284
  type ModelListParams,
212
285
  type ModelInfosPage,
213
286
  } from './models';
287
+ export {
288
+ Skills,
289
+ type DeletedSkill,
290
+ type Skill,
291
+ type SkillSource,
292
+ type SkillCreateParams,
293
+ type SkillListParams,
294
+ type SkillsPageCursor,
295
+ } from './skills/skills';
@@ -33,7 +33,7 @@ export class Batches extends APIResource {
33
33
  * messages: [
34
34
  * { content: 'Hello, world', role: 'user' },
35
35
  * ],
36
- * model: 'claude-opus-4-6',
36
+ * model: 'claude-opus-5',
37
37
  * },
38
38
  * },
39
39
  * ],
@@ -28,6 +28,46 @@ export {
28
28
  type BashCodeExecutionToolResultError,
29
29
  type BashCodeExecutionToolResultErrorCode,
30
30
  type BashCodeExecutionToolResultErrorParam,
31
+ type BrowserCloseTabConfig,
32
+ type BrowserDoubleClickConfig,
33
+ type BrowserFileUploadConfig,
34
+ type BrowserFindConfig,
35
+ type BrowserFormInputConfig,
36
+ type BrowserGetPageTextConfig,
37
+ type BrowserHoldKeyConfig,
38
+ type BrowserHoverConfig,
39
+ type BrowserJavascriptExecConfig,
40
+ type BrowserKeyConfig,
41
+ type BrowserLeftClickConfig,
42
+ type BrowserLeftClickDragConfig,
43
+ type BrowserLeftMouseDownConfig,
44
+ type BrowserLeftMouseUpConfig,
45
+ type BrowserListTabsConfig,
46
+ type BrowserMiddleClickConfig,
47
+ type BrowserMouseMoveConfig,
48
+ type BrowserNavigateConfig,
49
+ type BrowserNewTabConfig,
50
+ type BrowserReadConsoleConfig,
51
+ type BrowserReadNetworkConfig,
52
+ type BrowserReadPageConfig,
53
+ type BrowserRightClickConfig,
54
+ type BrowserScreenshotConfig,
55
+ type BrowserScrollConfig,
56
+ type BrowserScrollToConfig,
57
+ type BrowserStateBlockParam,
58
+ type BrowserStateChange,
59
+ type BrowserStateChangeDownloadCompleted,
60
+ type BrowserStateChangeDownloadFailed,
61
+ type BrowserStateChangeDownloadStarted,
62
+ type BrowserStateChangeTabOpened,
63
+ type BrowserStateTabEntry,
64
+ type BrowserSwitchTabConfig,
65
+ type BrowserToolset20260801,
66
+ type BrowserToolsetConfigs,
67
+ type BrowserTripleClickConfig,
68
+ type BrowserTypeConfig,
69
+ type BrowserWaitConfig,
70
+ type BrowserZoomConfig,
31
71
  type CacheControlEphemeral,
32
72
  type CacheCreation,
33
73
  type CitationCharLocation,
@@ -58,7 +98,28 @@ export {
58
98
  type CodeExecutionToolResultError,
59
99
  type CodeExecutionToolResultErrorCode,
60
100
  type CodeExecutionToolResultErrorParam,
101
+ type ComputerCursorPositionConfig,
102
+ type ComputerDoubleClickConfig,
103
+ type ComputerHoldKeyConfig,
104
+ type ComputerKeyConfig,
105
+ type ComputerLeftClickConfig,
106
+ type ComputerLeftClickDragConfig,
107
+ type ComputerLeftMouseDownConfig,
108
+ type ComputerLeftMouseUpConfig,
109
+ type ComputerMiddleClickConfig,
110
+ type ComputerMouseMoveConfig,
111
+ type ComputerRightClickConfig,
112
+ type ComputerScreenshotConfig,
113
+ type ComputerScrollConfig,
114
+ type ComputerToolset20260801,
115
+ type ComputerToolsetConfigs,
116
+ type ComputerTripleClickConfig,
117
+ type ComputerTypeConfig,
118
+ type ComputerWaitConfig,
119
+ type ComputerZoomConfig,
61
120
  type Container,
121
+ type ContainerParams,
122
+ type ContainerSkill,
62
123
  type ContainerUploadBlock,
63
124
  type ContainerUploadBlockParam,
64
125
  type ContentBlock,
@@ -72,18 +133,21 @@ export {
72
133
  type DocumentBlockParam,
73
134
  type EncryptedCodeExecutionResultBlock,
74
135
  type EncryptedCodeExecutionResultBlockParam,
136
+ type FileDocumentSource,
137
+ type FileImageSource,
75
138
  type ImageBlockParam,
139
+ type ImageTransformationsParam,
76
140
  type InputJSONDelta,
77
141
  type JSONOutputFormat,
78
142
  type MemoryTool20250818,
79
143
  type Message,
80
144
  type MessageCountTokensTool,
145
+ type MessageCreateParamsContainer,
81
146
  type MessageDeltaEvent,
82
147
  type MessageDeltaUsage,
83
148
  type MessageParam,
84
149
  type MessageTokensCount,
85
150
  type Metadata,
86
- type MidConversationSystemBlockParam,
87
151
  type Model,
88
152
  type OutputConfig,
89
153
  type OutputTokensDetails,
@@ -106,6 +170,7 @@ export {
106
170
  type ServerToolUseBlock,
107
171
  type ServerToolUseBlockParam,
108
172
  type SignatureDelta,
173
+ type SkillParams,
109
174
  type StopReason,
110
175
  type TextBlock,
111
176
  type TextBlockParam,