openai 7.27.0 → 7.30.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 (335) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +3 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +3 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/helpers/standard-schema.d.mts +8 -3
  11. package/helpers/standard-schema.d.mts.map +1 -1
  12. package/helpers/standard-schema.d.ts +8 -3
  13. package/helpers/standard-schema.d.ts.map +1 -1
  14. package/helpers/standard-schema.js +1 -0
  15. package/helpers/standard-schema.js.map +1 -1
  16. package/helpers/standard-schema.mjs +1 -0
  17. package/helpers/standard-schema.mjs.map +1 -1
  18. package/helpers/zod.d.mts +2 -0
  19. package/helpers/zod.d.mts.map +1 -1
  20. package/helpers/zod.d.ts +2 -0
  21. package/helpers/zod.d.ts.map +1 -1
  22. package/helpers/zod.js +1 -0
  23. package/helpers/zod.js.map +1 -1
  24. package/helpers/zod.mjs +1 -0
  25. package/helpers/zod.mjs.map +1 -1
  26. package/lib/ChatCompletionStream.d.mts +2 -1
  27. package/lib/ChatCompletionStream.d.mts.map +1 -1
  28. package/lib/ChatCompletionStream.d.ts +2 -1
  29. package/lib/ChatCompletionStream.d.ts.map +1 -1
  30. package/lib/ChatCompletionStream.js +9 -2
  31. package/lib/ChatCompletionStream.js.map +1 -1
  32. package/lib/ChatCompletionStream.mjs +9 -2
  33. package/lib/ChatCompletionStream.mjs.map +1 -1
  34. package/lib/ResponsesParser.d.mts.map +1 -1
  35. package/lib/ResponsesParser.d.ts.map +1 -1
  36. package/lib/ResponsesParser.js +5 -0
  37. package/lib/ResponsesParser.js.map +1 -1
  38. package/lib/ResponsesParser.mjs +5 -0
  39. package/lib/ResponsesParser.mjs.map +1 -1
  40. package/lib/agents/agent-session-stream.d.mts +7 -0
  41. package/lib/agents/agent-session-stream.d.mts.map +1 -1
  42. package/lib/agents/agent-session-stream.d.ts +7 -0
  43. package/lib/agents/agent-session-stream.d.ts.map +1 -1
  44. package/lib/agents/agent-session-stream.js +8 -110
  45. package/lib/agents/agent-session-stream.js.map +1 -1
  46. package/lib/agents/agent-session-stream.mjs +9 -111
  47. package/lib/agents/agent-session-stream.mjs.map +1 -1
  48. package/lib/beta/agents/agent-session-create-stream.d.mts +41 -1
  49. package/lib/beta/agents/agent-session-create-stream.d.mts.map +1 -1
  50. package/lib/beta/agents/agent-session-create-stream.d.ts +41 -1
  51. package/lib/beta/agents/agent-session-create-stream.d.ts.map +1 -1
  52. package/lib/beta/agents/agent-session-create-stream.js +70 -2
  53. package/lib/beta/agents/agent-session-create-stream.js.map +1 -1
  54. package/lib/beta/agents/agent-session-create-stream.mjs +69 -2
  55. package/lib/beta/agents/agent-session-create-stream.mjs.map +1 -1
  56. package/lib/beta/agents/function-tool.d.mts.map +1 -1
  57. package/lib/beta/agents/function-tool.d.ts.map +1 -1
  58. package/lib/beta/agents/function-tool.js +22 -15
  59. package/lib/beta/agents/function-tool.js.map +1 -1
  60. package/lib/beta/agents/function-tool.mjs +22 -15
  61. package/lib/beta/agents/function-tool.mjs.map +1 -1
  62. package/lib/beta/agents/parse-result.d.mts +4 -2
  63. package/lib/beta/agents/parse-result.d.mts.map +1 -1
  64. package/lib/beta/agents/parse-result.d.ts +4 -2
  65. package/lib/beta/agents/parse-result.d.ts.map +1 -1
  66. package/lib/beta/agents/tool-dispatcher.d.mts +13 -0
  67. package/lib/beta/agents/tool-dispatcher.d.mts.map +1 -0
  68. package/lib/beta/agents/tool-dispatcher.d.ts +13 -0
  69. package/lib/beta/agents/tool-dispatcher.d.ts.map +1 -0
  70. package/lib/beta/agents/tool-dispatcher.js +185 -0
  71. package/lib/beta/agents/tool-dispatcher.js.map +1 -0
  72. package/lib/beta/agents/tool-dispatcher.mjs +181 -0
  73. package/lib/beta/agents/tool-dispatcher.mjs.map +1 -0
  74. package/lib/beta/agents/tool-error.d.mts +13 -0
  75. package/lib/beta/agents/tool-error.d.mts.map +1 -0
  76. package/lib/beta/agents/tool-error.d.ts +13 -0
  77. package/lib/beta/agents/tool-error.d.ts.map +1 -0
  78. package/lib/beta/agents/tool-error.js +3 -0
  79. package/lib/beta/agents/tool-error.js.map +1 -0
  80. package/lib/beta/agents/tool-error.mjs +2 -0
  81. package/lib/beta/agents/tool-error.mjs.map +1 -0
  82. package/lib/beta/agents/tool-stages.d.mts +12 -0
  83. package/lib/beta/agents/tool-stages.d.mts.map +1 -0
  84. package/lib/beta/agents/tool-stages.d.ts +12 -0
  85. package/lib/beta/agents/tool-stages.d.ts.map +1 -0
  86. package/lib/beta/agents/tool-stages.js +6 -0
  87. package/lib/beta/agents/tool-stages.js.map +1 -0
  88. package/lib/beta/agents/tool-stages.mjs +3 -0
  89. package/lib/beta/agents/tool-stages.mjs.map +1 -0
  90. package/lib/chat-completions/streaming.d.mts +11 -0
  91. package/lib/chat-completions/streaming.d.mts.map +1 -0
  92. package/lib/chat-completions/streaming.d.ts +11 -0
  93. package/lib/chat-completions/streaming.d.ts.map +1 -0
  94. package/lib/chat-completions/streaming.js +27 -0
  95. package/lib/chat-completions/streaming.js.map +1 -0
  96. package/lib/chat-completions/streaming.mjs +23 -0
  97. package/lib/chat-completions/streaming.mjs.map +1 -0
  98. package/package.json +1 -1
  99. package/resources/admin/organization/usage.d.mts +381 -20
  100. package/resources/admin/organization/usage.d.mts.map +1 -1
  101. package/resources/admin/organization/usage.d.ts +381 -20
  102. package/resources/admin/organization/usage.d.ts.map +1 -1
  103. package/resources/audio/audio.d.mts +4 -0
  104. package/resources/audio/audio.d.mts.map +1 -1
  105. package/resources/audio/audio.d.ts +4 -0
  106. package/resources/audio/audio.d.ts.map +1 -1
  107. package/resources/audio/audio.js +4 -0
  108. package/resources/audio/audio.js.map +1 -1
  109. package/resources/audio/audio.mjs +4 -0
  110. package/resources/audio/audio.mjs.map +1 -1
  111. package/resources/audio/index.d.mts +1 -0
  112. package/resources/audio/index.d.mts.map +1 -1
  113. package/resources/audio/index.d.ts +1 -0
  114. package/resources/audio/index.d.ts.map +1 -1
  115. package/resources/audio/index.js +3 -1
  116. package/resources/audio/index.js.map +1 -1
  117. package/resources/audio/index.mjs +1 -0
  118. package/resources/audio/index.mjs.map +1 -1
  119. package/resources/audio/speech.d.mts +2 -0
  120. package/resources/audio/speech.d.mts.map +1 -1
  121. package/resources/audio/speech.d.ts +2 -0
  122. package/resources/audio/speech.d.ts.map +1 -1
  123. package/resources/audio/voices.d.mts +119 -0
  124. package/resources/audio/voices.d.mts.map +1 -0
  125. package/resources/audio/voices.d.ts +119 -0
  126. package/resources/audio/voices.d.ts.map +1 -0
  127. package/resources/audio/voices.js +41 -0
  128. package/resources/audio/voices.js.map +1 -0
  129. package/resources/audio/voices.mjs +37 -0
  130. package/resources/audio/voices.mjs.map +1 -0
  131. package/resources/beta/agents/agents.d.mts +14 -10
  132. package/resources/beta/agents/agents.d.mts.map +1 -1
  133. package/resources/beta/agents/agents.d.ts +14 -10
  134. package/resources/beta/agents/agents.d.ts.map +1 -1
  135. package/resources/beta/agents/agents.js.map +1 -1
  136. package/resources/beta/agents/agents.mjs.map +1 -1
  137. package/resources/beta/agents/environments/templates.d.mts +6 -8
  138. package/resources/beta/agents/environments/templates.d.mts.map +1 -1
  139. package/resources/beta/agents/environments/templates.d.ts +6 -8
  140. package/resources/beta/agents/environments/templates.d.ts.map +1 -1
  141. package/resources/beta/agents/sessions/index.d.mts +1 -1
  142. package/resources/beta/agents/sessions/index.d.mts.map +1 -1
  143. package/resources/beta/agents/sessions/index.d.ts +1 -1
  144. package/resources/beta/agents/sessions/index.d.ts.map +1 -1
  145. package/resources/beta/agents/sessions/index.js +2 -2
  146. package/resources/beta/agents/sessions/index.js.map +1 -1
  147. package/resources/beta/agents/sessions/index.mjs +1 -1
  148. package/resources/beta/agents/sessions/index.mjs.map +1 -1
  149. package/resources/beta/agents/sessions/sessions.d.mts +8 -7
  150. package/resources/beta/agents/sessions/sessions.d.mts.map +1 -1
  151. package/resources/beta/agents/sessions/sessions.d.ts +8 -7
  152. package/resources/beta/agents/sessions/sessions.d.ts.map +1 -1
  153. package/resources/beta/agents/sessions/sessions.js +7 -4
  154. package/resources/beta/agents/sessions/sessions.js.map +1 -1
  155. package/resources/beta/agents/sessions/sessions.mjs +8 -5
  156. package/resources/beta/agents/sessions/sessions.mjs.map +1 -1
  157. package/resources/beta/agents/sessions/subagents/turns/turns.d.mts +2 -2
  158. package/resources/beta/agents/sessions/subagents/turns/turns.d.mts.map +1 -1
  159. package/resources/beta/agents/sessions/subagents/turns/turns.d.ts +2 -2
  160. package/resources/beta/agents/sessions/subagents/turns/turns.d.ts.map +1 -1
  161. package/resources/beta/agents/sessions/turns/index.d.mts +3 -0
  162. package/resources/beta/agents/sessions/turns/index.d.mts.map +1 -0
  163. package/resources/beta/agents/sessions/turns/index.d.ts +3 -0
  164. package/resources/beta/agents/sessions/turns/index.d.ts.map +1 -0
  165. package/resources/beta/agents/sessions/turns/index.js +9 -0
  166. package/resources/beta/agents/sessions/turns/index.js.map +1 -0
  167. package/resources/beta/agents/sessions/turns/index.mjs +4 -0
  168. package/resources/beta/agents/sessions/turns/index.mjs.map +1 -0
  169. package/resources/beta/agents/sessions/turns/items.d.mts +43 -0
  170. package/resources/beta/agents/sessions/turns/items.d.mts.map +1 -0
  171. package/resources/beta/agents/sessions/turns/items.d.ts +43 -0
  172. package/resources/beta/agents/sessions/turns/items.d.ts.map +1 -0
  173. package/resources/beta/agents/sessions/turns/items.js +40 -0
  174. package/resources/beta/agents/sessions/turns/items.js.map +1 -0
  175. package/resources/beta/agents/sessions/turns/items.mjs +36 -0
  176. package/resources/beta/agents/sessions/turns/items.mjs.map +1 -0
  177. package/resources/beta/agents/sessions/turns/turns.d.mts +128 -0
  178. package/resources/beta/agents/sessions/turns/turns.d.mts.map +1 -0
  179. package/resources/beta/agents/sessions/turns/turns.d.ts +128 -0
  180. package/resources/beta/agents/sessions/turns/turns.d.ts.map +1 -0
  181. package/resources/beta/agents/sessions/turns/turns.js +111 -0
  182. package/resources/beta/agents/sessions/turns/turns.js.map +1 -0
  183. package/resources/beta/agents/sessions/turns/turns.mjs +106 -0
  184. package/resources/beta/agents/sessions/turns/turns.mjs.map +1 -0
  185. package/resources/beta/agents/sessions/turns.d.mts +1 -123
  186. package/resources/beta/agents/sessions/turns.d.mts.map +1 -1
  187. package/resources/beta/agents/sessions/turns.d.ts +1 -123
  188. package/resources/beta/agents/sessions/turns.d.ts.map +1 -1
  189. package/resources/beta/agents/sessions/turns.js +2 -99
  190. package/resources/beta/agents/sessions/turns.js.map +1 -1
  191. package/resources/beta/agents/sessions/turns.mjs +1 -97
  192. package/resources/beta/agents/sessions/turns.mjs.map +1 -1
  193. package/resources/beta/beta.d.mts +2 -2
  194. package/resources/beta/beta.d.mts.map +1 -1
  195. package/resources/beta/beta.d.ts +2 -2
  196. package/resources/beta/beta.d.ts.map +1 -1
  197. package/resources/beta/beta.js.map +1 -1
  198. package/resources/beta/beta.mjs.map +1 -1
  199. package/resources/beta/index.d.mts +1 -1
  200. package/resources/beta/index.d.mts.map +1 -1
  201. package/resources/beta/index.d.ts +1 -1
  202. package/resources/beta/index.d.ts.map +1 -1
  203. package/resources/beta/index.js.map +1 -1
  204. package/resources/beta/index.mjs.map +1 -1
  205. package/resources/beta/responses/index.d.mts +1 -1
  206. package/resources/beta/responses/index.d.mts.map +1 -1
  207. package/resources/beta/responses/index.d.ts +1 -1
  208. package/resources/beta/responses/index.d.ts.map +1 -1
  209. package/resources/beta/responses/index.js.map +1 -1
  210. package/resources/beta/responses/index.mjs.map +1 -1
  211. package/resources/beta/responses/responses.d.mts +379 -9
  212. package/resources/beta/responses/responses.d.mts.map +1 -1
  213. package/resources/beta/responses/responses.d.ts +379 -9
  214. package/resources/beta/responses/responses.d.ts.map +1 -1
  215. package/resources/beta/responses/responses.js.map +1 -1
  216. package/resources/beta/responses/responses.mjs.map +1 -1
  217. package/resources/chat/completions/completions.d.mts +44 -9
  218. package/resources/chat/completions/completions.d.mts.map +1 -1
  219. package/resources/chat/completions/completions.d.ts +44 -9
  220. package/resources/chat/completions/completions.d.ts.map +1 -1
  221. package/resources/chat/completions/completions.js +5 -2
  222. package/resources/chat/completions/completions.js.map +1 -1
  223. package/resources/chat/completions/completions.mjs +5 -2
  224. package/resources/chat/completions/completions.mjs.map +1 -1
  225. package/resources/completions.d.mts +1 -1
  226. package/resources/completions.d.mts.map +1 -1
  227. package/resources/completions.d.ts +1 -1
  228. package/resources/completions.d.ts.map +1 -1
  229. package/resources/decisions.d.mts +196 -0
  230. package/resources/decisions.d.mts.map +1 -0
  231. package/resources/decisions.d.ts +196 -0
  232. package/resources/decisions.d.ts.map +1 -0
  233. package/resources/decisions.js +32 -0
  234. package/resources/decisions.js.map +1 -0
  235. package/resources/decisions.mjs +28 -0
  236. package/resources/decisions.mjs.map +1 -0
  237. package/resources/fine-tuning/jobs/jobs.d.mts +7 -2
  238. package/resources/fine-tuning/jobs/jobs.d.mts.map +1 -1
  239. package/resources/fine-tuning/jobs/jobs.d.ts +7 -2
  240. package/resources/fine-tuning/jobs/jobs.d.ts.map +1 -1
  241. package/resources/fine-tuning/jobs/jobs.js.map +1 -1
  242. package/resources/fine-tuning/jobs/jobs.mjs.map +1 -1
  243. package/resources/graders/grader-models.d.mts +1 -1
  244. package/resources/graders/grader-models.d.ts +1 -1
  245. package/resources/images.d.mts +61 -75
  246. package/resources/images.d.mts.map +1 -1
  247. package/resources/images.d.ts +61 -75
  248. package/resources/images.d.ts.map +1 -1
  249. package/resources/images.js +4 -7
  250. package/resources/images.js.map +1 -1
  251. package/resources/images.mjs +4 -7
  252. package/resources/images.mjs.map +1 -1
  253. package/resources/index.d.mts +1 -0
  254. package/resources/index.d.mts.map +1 -1
  255. package/resources/index.d.ts +1 -0
  256. package/resources/index.d.ts.map +1 -1
  257. package/resources/index.js +3 -1
  258. package/resources/index.js.map +1 -1
  259. package/resources/index.mjs +1 -0
  260. package/resources/index.mjs.map +1 -1
  261. package/resources/realtime/realtime.d.mts +16 -4
  262. package/resources/realtime/realtime.d.mts.map +1 -1
  263. package/resources/realtime/realtime.d.ts +16 -4
  264. package/resources/realtime/realtime.d.ts.map +1 -1
  265. package/resources/realtime/realtime.js.map +1 -1
  266. package/resources/realtime/realtime.mjs.map +1 -1
  267. package/resources/responses/responses.d.mts +381 -9
  268. package/resources/responses/responses.d.mts.map +1 -1
  269. package/resources/responses/responses.d.ts +381 -9
  270. package/resources/responses/responses.d.ts.map +1 -1
  271. package/resources/responses/responses.js.map +1 -1
  272. package/resources/responses/responses.mjs.map +1 -1
  273. package/resources/shared.d.mts +69 -0
  274. package/resources/shared.d.mts.map +1 -1
  275. package/resources/shared.d.ts +69 -0
  276. package/resources/shared.d.ts.map +1 -1
  277. package/resources/videos.d.mts +5 -0
  278. package/resources/videos.d.mts.map +1 -1
  279. package/resources/videos.d.ts +5 -0
  280. package/resources/videos.d.ts.map +1 -1
  281. package/resources/webhooks/webhooks.d.mts +211 -6
  282. package/resources/webhooks/webhooks.d.mts.map +1 -1
  283. package/resources/webhooks/webhooks.d.ts +211 -6
  284. package/resources/webhooks/webhooks.d.ts.map +1 -1
  285. package/resources/webhooks/webhooks.js.map +1 -1
  286. package/resources/webhooks/webhooks.mjs.map +1 -1
  287. package/src/client.ts +21 -0
  288. package/src/helpers/standard-schema.ts +11 -4
  289. package/src/helpers/zod.ts +4 -0
  290. package/src/lib/ChatCompletionStream.ts +10 -3
  291. package/src/lib/ResponsesParser.ts +8 -0
  292. package/src/lib/agents/agent-session-stream.ts +20 -124
  293. package/src/lib/beta/agents/agent-session-create-stream.ts +87 -1
  294. package/src/lib/beta/agents/function-tool.ts +23 -15
  295. package/src/lib/beta/agents/tool-dispatcher.ts +226 -0
  296. package/src/lib/beta/agents/tool-error.ts +12 -0
  297. package/src/lib/beta/agents/tool-stages.ts +14 -0
  298. package/src/lib/chat-completions/streaming.ts +35 -0
  299. package/src/resources/admin/organization/usage.ts +438 -20
  300. package/src/resources/audio/audio.ts +6 -0
  301. package/src/resources/audio/index.ts +1 -0
  302. package/src/resources/audio/speech.ts +2 -0
  303. package/src/resources/audio/voices.ts +152 -0
  304. package/src/resources/beta/agents/agents.ts +16 -9
  305. package/src/resources/beta/agents/environments/templates.ts +6 -8
  306. package/src/resources/beta/agents/sessions/index.ts +7 -1
  307. package/src/resources/beta/agents/sessions/sessions.ts +18 -8
  308. package/src/resources/beta/agents/sessions/subagents/turns/turns.ts +2 -2
  309. package/src/resources/beta/agents/sessions/turns/index.ts +4 -0
  310. package/src/resources/beta/agents/sessions/turns/items.ts +79 -0
  311. package/src/resources/beta/agents/sessions/turns/turns.ts +383 -0
  312. package/src/resources/beta/agents/sessions/turns.ts +1 -373
  313. package/src/resources/beta/beta.ts +2 -0
  314. package/src/resources/beta/index.ts +1 -0
  315. package/src/resources/beta/responses/index.ts +1 -0
  316. package/src/resources/beta/responses/responses.ts +471 -8
  317. package/src/resources/chat/completions/completions.ts +67 -19
  318. package/src/resources/completions.ts +1 -1
  319. package/src/resources/decisions.ts +290 -0
  320. package/src/resources/fine-tuning/jobs/jobs.ts +7 -2
  321. package/src/resources/graders/grader-models.ts +1 -1
  322. package/src/resources/images.ts +62 -76
  323. package/src/resources/index.ts +9 -0
  324. package/src/resources/realtime/realtime.ts +16 -4
  325. package/src/resources/responses/api.md +1 -0
  326. package/src/resources/responses/responses.ts +473 -8
  327. package/src/resources/shared.ts +70 -0
  328. package/src/resources/videos.ts +6 -0
  329. package/src/resources/webhooks/api.md +5 -0
  330. package/src/resources/webhooks/webhooks.ts +273 -1
  331. package/src/version.ts +1 -1
  332. package/version.d.mts +1 -1
  333. package/version.d.ts +1 -1
  334. package/version.js +1 -1
  335. package/version.mjs +1 -1
@@ -354,6 +354,14 @@ export namespace UsageAudioSpeechesResponse {
354
354
  */
355
355
  api_key_id?: string | null;
356
356
 
357
+ /**
358
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
359
+ * activity and `unlabeled` includes all records without published source
360
+ * attribution, including historical and unknown origins. Unlabeled does not imply
361
+ * direct API usage. Without source grouping, this field is null.
362
+ */
363
+ api_source?: 'agents_api' | 'unlabeled' | null;
364
+
357
365
  /**
358
366
  * When `group_by=batch`, this field tells whether the grouped usage result is
359
367
  * batch or not.
@@ -366,7 +374,14 @@ export namespace UsageAudioSpeechesResponse {
366
374
  input_audio_tokens?: number;
367
375
 
368
376
  /**
369
- * The aggregated number of input tokens written to the cache.
377
+ * The aggregated number of input tokens written to the cache with a 12-hour
378
+ * retention period.
379
+ */
380
+ input_cache_write_12h_tokens?: number;
381
+
382
+ /**
383
+ * The aggregated number of input tokens written to the cache with a 30-minute
384
+ * retention period.
370
385
  */
371
386
  input_cache_write_tokens?: number;
372
387
 
@@ -760,6 +775,14 @@ export namespace UsageAudioSpeechesResponse {
760
775
  */
761
776
  api_key_id?: string | null;
762
777
 
778
+ /**
779
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
780
+ * activity and `unlabeled` includes all records without published source
781
+ * attribution, including historical and unknown origins. Unlabeled does not imply
782
+ * direct API usage. Without source grouping, this field is null.
783
+ */
784
+ api_source?: 'agents_api' | 'unlabeled' | null;
785
+
763
786
  /**
764
787
  * When `group_by=context_level`, this field provides the search context size of
765
788
  * the grouped usage result.
@@ -802,6 +825,14 @@ export namespace UsageAudioSpeechesResponse {
802
825
  */
803
826
  api_key_id?: string | null;
804
827
 
828
+ /**
829
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
830
+ * activity and `unlabeled` includes all records without published source
831
+ * attribution, including historical and unknown origins. Unlabeled does not imply
832
+ * direct API usage. Without source grouping, this field is null.
833
+ */
834
+ api_source?: 'agents_api' | 'unlabeled' | null;
835
+
805
836
  /**
806
837
  * When `group_by=line_item`, this field provides the line item of the grouped
807
838
  * costs result.
@@ -825,6 +856,12 @@ export namespace UsageAudioSpeechesResponse {
825
856
  * result, this field is `null`.
826
857
  */
827
858
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
859
+
860
+ /**
861
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
862
+ * result.
863
+ */
864
+ user_id?: string | null;
828
865
  }
829
866
 
830
867
  export namespace OrganizationCostsResult {
@@ -911,6 +948,14 @@ export namespace UsageAudioTranscriptionsResponse {
911
948
  */
912
949
  api_key_id?: string | null;
913
950
 
951
+ /**
952
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
953
+ * activity and `unlabeled` includes all records without published source
954
+ * attribution, including historical and unknown origins. Unlabeled does not imply
955
+ * direct API usage. Without source grouping, this field is null.
956
+ */
957
+ api_source?: 'agents_api' | 'unlabeled' | null;
958
+
914
959
  /**
915
960
  * When `group_by=batch`, this field tells whether the grouped usage result is
916
961
  * batch or not.
@@ -923,7 +968,14 @@ export namespace UsageAudioTranscriptionsResponse {
923
968
  input_audio_tokens?: number;
924
969
 
925
970
  /**
926
- * The aggregated number of input tokens written to the cache.
971
+ * The aggregated number of input tokens written to the cache with a 12-hour
972
+ * retention period.
973
+ */
974
+ input_cache_write_12h_tokens?: number;
975
+
976
+ /**
977
+ * The aggregated number of input tokens written to the cache with a 30-minute
978
+ * retention period.
927
979
  */
928
980
  input_cache_write_tokens?: number;
929
981
 
@@ -1317,6 +1369,14 @@ export namespace UsageAudioTranscriptionsResponse {
1317
1369
  */
1318
1370
  api_key_id?: string | null;
1319
1371
 
1372
+ /**
1373
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1374
+ * activity and `unlabeled` includes all records without published source
1375
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1376
+ * direct API usage. Without source grouping, this field is null.
1377
+ */
1378
+ api_source?: 'agents_api' | 'unlabeled' | null;
1379
+
1320
1380
  /**
1321
1381
  * When `group_by=context_level`, this field provides the search context size of
1322
1382
  * the grouped usage result.
@@ -1359,6 +1419,14 @@ export namespace UsageAudioTranscriptionsResponse {
1359
1419
  */
1360
1420
  api_key_id?: string | null;
1361
1421
 
1422
+ /**
1423
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1424
+ * activity and `unlabeled` includes all records without published source
1425
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1426
+ * direct API usage. Without source grouping, this field is null.
1427
+ */
1428
+ api_source?: 'agents_api' | 'unlabeled' | null;
1429
+
1362
1430
  /**
1363
1431
  * When `group_by=line_item`, this field provides the line item of the grouped
1364
1432
  * costs result.
@@ -1382,6 +1450,12 @@ export namespace UsageAudioTranscriptionsResponse {
1382
1450
  * result, this field is `null`.
1383
1451
  */
1384
1452
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
1453
+
1454
+ /**
1455
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
1456
+ * result.
1457
+ */
1458
+ user_id?: string | null;
1385
1459
  }
1386
1460
 
1387
1461
  export namespace OrganizationCostsResult {
@@ -1468,6 +1542,14 @@ export namespace UsageCodeInterpreterSessionsResponse {
1468
1542
  */
1469
1543
  api_key_id?: string | null;
1470
1544
 
1545
+ /**
1546
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1547
+ * activity and `unlabeled` includes all records without published source
1548
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1549
+ * direct API usage. Without source grouping, this field is null.
1550
+ */
1551
+ api_source?: 'agents_api' | 'unlabeled' | null;
1552
+
1471
1553
  /**
1472
1554
  * When `group_by=batch`, this field tells whether the grouped usage result is
1473
1555
  * batch or not.
@@ -1480,7 +1562,14 @@ export namespace UsageCodeInterpreterSessionsResponse {
1480
1562
  input_audio_tokens?: number;
1481
1563
 
1482
1564
  /**
1483
- * The aggregated number of input tokens written to the cache.
1565
+ * The aggregated number of input tokens written to the cache with a 12-hour
1566
+ * retention period.
1567
+ */
1568
+ input_cache_write_12h_tokens?: number;
1569
+
1570
+ /**
1571
+ * The aggregated number of input tokens written to the cache with a 30-minute
1572
+ * retention period.
1484
1573
  */
1485
1574
  input_cache_write_tokens?: number;
1486
1575
 
@@ -1874,6 +1963,14 @@ export namespace UsageCodeInterpreterSessionsResponse {
1874
1963
  */
1875
1964
  api_key_id?: string | null;
1876
1965
 
1966
+ /**
1967
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1968
+ * activity and `unlabeled` includes all records without published source
1969
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1970
+ * direct API usage. Without source grouping, this field is null.
1971
+ */
1972
+ api_source?: 'agents_api' | 'unlabeled' | null;
1973
+
1877
1974
  /**
1878
1975
  * When `group_by=context_level`, this field provides the search context size of
1879
1976
  * the grouped usage result.
@@ -1916,6 +2013,14 @@ export namespace UsageCodeInterpreterSessionsResponse {
1916
2013
  */
1917
2014
  api_key_id?: string | null;
1918
2015
 
2016
+ /**
2017
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2018
+ * activity and `unlabeled` includes all records without published source
2019
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2020
+ * direct API usage. Without source grouping, this field is null.
2021
+ */
2022
+ api_source?: 'agents_api' | 'unlabeled' | null;
2023
+
1919
2024
  /**
1920
2025
  * When `group_by=line_item`, this field provides the line item of the grouped
1921
2026
  * costs result.
@@ -1939,6 +2044,12 @@ export namespace UsageCodeInterpreterSessionsResponse {
1939
2044
  * result, this field is `null`.
1940
2045
  */
1941
2046
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
2047
+
2048
+ /**
2049
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
2050
+ * result.
2051
+ */
2052
+ user_id?: string | null;
1942
2053
  }
1943
2054
 
1944
2055
  export namespace OrganizationCostsResult {
@@ -2025,6 +2136,14 @@ export namespace UsageCompletionsResponse {
2025
2136
  */
2026
2137
  api_key_id?: string | null;
2027
2138
 
2139
+ /**
2140
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2141
+ * activity and `unlabeled` includes all records without published source
2142
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2143
+ * direct API usage. Without source grouping, this field is null.
2144
+ */
2145
+ api_source?: 'agents_api' | 'unlabeled' | null;
2146
+
2028
2147
  /**
2029
2148
  * When `group_by=batch`, this field tells whether the grouped usage result is
2030
2149
  * batch or not.
@@ -2037,7 +2156,14 @@ export namespace UsageCompletionsResponse {
2037
2156
  input_audio_tokens?: number;
2038
2157
 
2039
2158
  /**
2040
- * The aggregated number of input tokens written to the cache.
2159
+ * The aggregated number of input tokens written to the cache with a 12-hour
2160
+ * retention period.
2161
+ */
2162
+ input_cache_write_12h_tokens?: number;
2163
+
2164
+ /**
2165
+ * The aggregated number of input tokens written to the cache with a 30-minute
2166
+ * retention period.
2041
2167
  */
2042
2168
  input_cache_write_tokens?: number;
2043
2169
 
@@ -2431,6 +2557,14 @@ export namespace UsageCompletionsResponse {
2431
2557
  */
2432
2558
  api_key_id?: string | null;
2433
2559
 
2560
+ /**
2561
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2562
+ * activity and `unlabeled` includes all records without published source
2563
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2564
+ * direct API usage. Without source grouping, this field is null.
2565
+ */
2566
+ api_source?: 'agents_api' | 'unlabeled' | null;
2567
+
2434
2568
  /**
2435
2569
  * When `group_by=context_level`, this field provides the search context size of
2436
2570
  * the grouped usage result.
@@ -2473,6 +2607,14 @@ export namespace UsageCompletionsResponse {
2473
2607
  */
2474
2608
  api_key_id?: string | null;
2475
2609
 
2610
+ /**
2611
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2612
+ * activity and `unlabeled` includes all records without published source
2613
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2614
+ * direct API usage. Without source grouping, this field is null.
2615
+ */
2616
+ api_source?: 'agents_api' | 'unlabeled' | null;
2617
+
2476
2618
  /**
2477
2619
  * When `group_by=line_item`, this field provides the line item of the grouped
2478
2620
  * costs result.
@@ -2496,6 +2638,12 @@ export namespace UsageCompletionsResponse {
2496
2638
  * result, this field is `null`.
2497
2639
  */
2498
2640
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
2641
+
2642
+ /**
2643
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
2644
+ * result.
2645
+ */
2646
+ user_id?: string | null;
2499
2647
  }
2500
2648
 
2501
2649
  export namespace OrganizationCostsResult {
@@ -2582,6 +2730,14 @@ export namespace UsageCostsResponse {
2582
2730
  */
2583
2731
  api_key_id?: string | null;
2584
2732
 
2733
+ /**
2734
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2735
+ * activity and `unlabeled` includes all records without published source
2736
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2737
+ * direct API usage. Without source grouping, this field is null.
2738
+ */
2739
+ api_source?: 'agents_api' | 'unlabeled' | null;
2740
+
2585
2741
  /**
2586
2742
  * When `group_by=batch`, this field tells whether the grouped usage result is
2587
2743
  * batch or not.
@@ -2594,7 +2750,14 @@ export namespace UsageCostsResponse {
2594
2750
  input_audio_tokens?: number;
2595
2751
 
2596
2752
  /**
2597
- * The aggregated number of input tokens written to the cache.
2753
+ * The aggregated number of input tokens written to the cache with a 12-hour
2754
+ * retention period.
2755
+ */
2756
+ input_cache_write_12h_tokens?: number;
2757
+
2758
+ /**
2759
+ * The aggregated number of input tokens written to the cache with a 30-minute
2760
+ * retention period.
2598
2761
  */
2599
2762
  input_cache_write_tokens?: number;
2600
2763
 
@@ -2988,6 +3151,14 @@ export namespace UsageCostsResponse {
2988
3151
  */
2989
3152
  api_key_id?: string | null;
2990
3153
 
3154
+ /**
3155
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3156
+ * activity and `unlabeled` includes all records without published source
3157
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3158
+ * direct API usage. Without source grouping, this field is null.
3159
+ */
3160
+ api_source?: 'agents_api' | 'unlabeled' | null;
3161
+
2991
3162
  /**
2992
3163
  * When `group_by=context_level`, this field provides the search context size of
2993
3164
  * the grouped usage result.
@@ -3030,6 +3201,14 @@ export namespace UsageCostsResponse {
3030
3201
  */
3031
3202
  api_key_id?: string | null;
3032
3203
 
3204
+ /**
3205
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3206
+ * activity and `unlabeled` includes all records without published source
3207
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3208
+ * direct API usage. Without source grouping, this field is null.
3209
+ */
3210
+ api_source?: 'agents_api' | 'unlabeled' | null;
3211
+
3033
3212
  /**
3034
3213
  * When `group_by=line_item`, this field provides the line item of the grouped
3035
3214
  * costs result.
@@ -3053,6 +3232,12 @@ export namespace UsageCostsResponse {
3053
3232
  * result, this field is `null`.
3054
3233
  */
3055
3234
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
3235
+
3236
+ /**
3237
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
3238
+ * result.
3239
+ */
3240
+ user_id?: string | null;
3056
3241
  }
3057
3242
 
3058
3243
  export namespace OrganizationCostsResult {
@@ -3139,6 +3324,14 @@ export namespace UsageEmbeddingsResponse {
3139
3324
  */
3140
3325
  api_key_id?: string | null;
3141
3326
 
3327
+ /**
3328
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3329
+ * activity and `unlabeled` includes all records without published source
3330
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3331
+ * direct API usage. Without source grouping, this field is null.
3332
+ */
3333
+ api_source?: 'agents_api' | 'unlabeled' | null;
3334
+
3142
3335
  /**
3143
3336
  * When `group_by=batch`, this field tells whether the grouped usage result is
3144
3337
  * batch or not.
@@ -3151,7 +3344,14 @@ export namespace UsageEmbeddingsResponse {
3151
3344
  input_audio_tokens?: number;
3152
3345
 
3153
3346
  /**
3154
- * The aggregated number of input tokens written to the cache.
3347
+ * The aggregated number of input tokens written to the cache with a 12-hour
3348
+ * retention period.
3349
+ */
3350
+ input_cache_write_12h_tokens?: number;
3351
+
3352
+ /**
3353
+ * The aggregated number of input tokens written to the cache with a 30-minute
3354
+ * retention period.
3155
3355
  */
3156
3356
  input_cache_write_tokens?: number;
3157
3357
 
@@ -3545,6 +3745,14 @@ export namespace UsageEmbeddingsResponse {
3545
3745
  */
3546
3746
  api_key_id?: string | null;
3547
3747
 
3748
+ /**
3749
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3750
+ * activity and `unlabeled` includes all records without published source
3751
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3752
+ * direct API usage. Without source grouping, this field is null.
3753
+ */
3754
+ api_source?: 'agents_api' | 'unlabeled' | null;
3755
+
3548
3756
  /**
3549
3757
  * When `group_by=context_level`, this field provides the search context size of
3550
3758
  * the grouped usage result.
@@ -3587,6 +3795,14 @@ export namespace UsageEmbeddingsResponse {
3587
3795
  */
3588
3796
  api_key_id?: string | null;
3589
3797
 
3798
+ /**
3799
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3800
+ * activity and `unlabeled` includes all records without published source
3801
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3802
+ * direct API usage. Without source grouping, this field is null.
3803
+ */
3804
+ api_source?: 'agents_api' | 'unlabeled' | null;
3805
+
3590
3806
  /**
3591
3807
  * When `group_by=line_item`, this field provides the line item of the grouped
3592
3808
  * costs result.
@@ -3610,6 +3826,12 @@ export namespace UsageEmbeddingsResponse {
3610
3826
  * result, this field is `null`.
3611
3827
  */
3612
3828
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
3829
+
3830
+ /**
3831
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
3832
+ * result.
3833
+ */
3834
+ user_id?: string | null;
3613
3835
  }
3614
3836
 
3615
3837
  export namespace OrganizationCostsResult {
@@ -3696,6 +3918,14 @@ export namespace UsageFileSearchCallsResponse {
3696
3918
  */
3697
3919
  api_key_id?: string | null;
3698
3920
 
3921
+ /**
3922
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3923
+ * activity and `unlabeled` includes all records without published source
3924
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3925
+ * direct API usage. Without source grouping, this field is null.
3926
+ */
3927
+ api_source?: 'agents_api' | 'unlabeled' | null;
3928
+
3699
3929
  /**
3700
3930
  * When `group_by=batch`, this field tells whether the grouped usage result is
3701
3931
  * batch or not.
@@ -3708,7 +3938,14 @@ export namespace UsageFileSearchCallsResponse {
3708
3938
  input_audio_tokens?: number;
3709
3939
 
3710
3940
  /**
3711
- * The aggregated number of input tokens written to the cache.
3941
+ * The aggregated number of input tokens written to the cache with a 12-hour
3942
+ * retention period.
3943
+ */
3944
+ input_cache_write_12h_tokens?: number;
3945
+
3946
+ /**
3947
+ * The aggregated number of input tokens written to the cache with a 30-minute
3948
+ * retention period.
3712
3949
  */
3713
3950
  input_cache_write_tokens?: number;
3714
3951
 
@@ -4102,6 +4339,14 @@ export namespace UsageFileSearchCallsResponse {
4102
4339
  */
4103
4340
  api_key_id?: string | null;
4104
4341
 
4342
+ /**
4343
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4344
+ * activity and `unlabeled` includes all records without published source
4345
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4346
+ * direct API usage. Without source grouping, this field is null.
4347
+ */
4348
+ api_source?: 'agents_api' | 'unlabeled' | null;
4349
+
4105
4350
  /**
4106
4351
  * When `group_by=context_level`, this field provides the search context size of
4107
4352
  * the grouped usage result.
@@ -4144,6 +4389,14 @@ export namespace UsageFileSearchCallsResponse {
4144
4389
  */
4145
4390
  api_key_id?: string | null;
4146
4391
 
4392
+ /**
4393
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4394
+ * activity and `unlabeled` includes all records without published source
4395
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4396
+ * direct API usage. Without source grouping, this field is null.
4397
+ */
4398
+ api_source?: 'agents_api' | 'unlabeled' | null;
4399
+
4147
4400
  /**
4148
4401
  * When `group_by=line_item`, this field provides the line item of the grouped
4149
4402
  * costs result.
@@ -4167,6 +4420,12 @@ export namespace UsageFileSearchCallsResponse {
4167
4420
  * result, this field is `null`.
4168
4421
  */
4169
4422
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
4423
+
4424
+ /**
4425
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
4426
+ * result.
4427
+ */
4428
+ user_id?: string | null;
4170
4429
  }
4171
4430
 
4172
4431
  export namespace OrganizationCostsResult {
@@ -4253,6 +4512,14 @@ export namespace UsageImagesResponse {
4253
4512
  */
4254
4513
  api_key_id?: string | null;
4255
4514
 
4515
+ /**
4516
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4517
+ * activity and `unlabeled` includes all records without published source
4518
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4519
+ * direct API usage. Without source grouping, this field is null.
4520
+ */
4521
+ api_source?: 'agents_api' | 'unlabeled' | null;
4522
+
4256
4523
  /**
4257
4524
  * When `group_by=batch`, this field tells whether the grouped usage result is
4258
4525
  * batch or not.
@@ -4265,7 +4532,14 @@ export namespace UsageImagesResponse {
4265
4532
  input_audio_tokens?: number;
4266
4533
 
4267
4534
  /**
4268
- * The aggregated number of input tokens written to the cache.
4535
+ * The aggregated number of input tokens written to the cache with a 12-hour
4536
+ * retention period.
4537
+ */
4538
+ input_cache_write_12h_tokens?: number;
4539
+
4540
+ /**
4541
+ * The aggregated number of input tokens written to the cache with a 30-minute
4542
+ * retention period.
4269
4543
  */
4270
4544
  input_cache_write_tokens?: number;
4271
4545
 
@@ -4659,6 +4933,14 @@ export namespace UsageImagesResponse {
4659
4933
  */
4660
4934
  api_key_id?: string | null;
4661
4935
 
4936
+ /**
4937
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4938
+ * activity and `unlabeled` includes all records without published source
4939
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4940
+ * direct API usage. Without source grouping, this field is null.
4941
+ */
4942
+ api_source?: 'agents_api' | 'unlabeled' | null;
4943
+
4662
4944
  /**
4663
4945
  * When `group_by=context_level`, this field provides the search context size of
4664
4946
  * the grouped usage result.
@@ -4701,6 +4983,14 @@ export namespace UsageImagesResponse {
4701
4983
  */
4702
4984
  api_key_id?: string | null;
4703
4985
 
4986
+ /**
4987
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4988
+ * activity and `unlabeled` includes all records without published source
4989
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4990
+ * direct API usage. Without source grouping, this field is null.
4991
+ */
4992
+ api_source?: 'agents_api' | 'unlabeled' | null;
4993
+
4704
4994
  /**
4705
4995
  * When `group_by=line_item`, this field provides the line item of the grouped
4706
4996
  * costs result.
@@ -4724,6 +5014,12 @@ export namespace UsageImagesResponse {
4724
5014
  * result, this field is `null`.
4725
5015
  */
4726
5016
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
5017
+
5018
+ /**
5019
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
5020
+ * result.
5021
+ */
5022
+ user_id?: string | null;
4727
5023
  }
4728
5024
 
4729
5025
  export namespace OrganizationCostsResult {
@@ -4810,6 +5106,14 @@ export namespace UsageModerationsResponse {
4810
5106
  */
4811
5107
  api_key_id?: string | null;
4812
5108
 
5109
+ /**
5110
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
5111
+ * activity and `unlabeled` includes all records without published source
5112
+ * attribution, including historical and unknown origins. Unlabeled does not imply
5113
+ * direct API usage. Without source grouping, this field is null.
5114
+ */
5115
+ api_source?: 'agents_api' | 'unlabeled' | null;
5116
+
4813
5117
  /**
4814
5118
  * When `group_by=batch`, this field tells whether the grouped usage result is
4815
5119
  * batch or not.
@@ -4822,7 +5126,14 @@ export namespace UsageModerationsResponse {
4822
5126
  input_audio_tokens?: number;
4823
5127
 
4824
5128
  /**
4825
- * The aggregated number of input tokens written to the cache.
5129
+ * The aggregated number of input tokens written to the cache with a 12-hour
5130
+ * retention period.
5131
+ */
5132
+ input_cache_write_12h_tokens?: number;
5133
+
5134
+ /**
5135
+ * The aggregated number of input tokens written to the cache with a 30-minute
5136
+ * retention period.
4826
5137
  */
4827
5138
  input_cache_write_tokens?: number;
4828
5139
 
@@ -5216,6 +5527,14 @@ export namespace UsageModerationsResponse {
5216
5527
  */
5217
5528
  api_key_id?: string | null;
5218
5529
 
5530
+ /**
5531
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
5532
+ * activity and `unlabeled` includes all records without published source
5533
+ * attribution, including historical and unknown origins. Unlabeled does not imply
5534
+ * direct API usage. Without source grouping, this field is null.
5535
+ */
5536
+ api_source?: 'agents_api' | 'unlabeled' | null;
5537
+
5219
5538
  /**
5220
5539
  * When `group_by=context_level`, this field provides the search context size of
5221
5540
  * the grouped usage result.
@@ -5258,6 +5577,14 @@ export namespace UsageModerationsResponse {
5258
5577
  */
5259
5578
  api_key_id?: string | null;
5260
5579
 
5580
+ /**
5581
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
5582
+ * activity and `unlabeled` includes all records without published source
5583
+ * attribution, including historical and unknown origins. Unlabeled does not imply
5584
+ * direct API usage. Without source grouping, this field is null.
5585
+ */
5586
+ api_source?: 'agents_api' | 'unlabeled' | null;
5587
+
5261
5588
  /**
5262
5589
  * When `group_by=line_item`, this field provides the line item of the grouped
5263
5590
  * costs result.
@@ -5281,6 +5608,12 @@ export namespace UsageModerationsResponse {
5281
5608
  * result, this field is `null`.
5282
5609
  */
5283
5610
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
5611
+
5612
+ /**
5613
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
5614
+ * result.
5615
+ */
5616
+ user_id?: string | null;
5284
5617
  }
5285
5618
 
5286
5619
  export namespace OrganizationCostsResult {
@@ -5367,6 +5700,14 @@ export namespace UsageVectorStoresResponse {
5367
5700
  */
5368
5701
  api_key_id?: string | null;
5369
5702
 
5703
+ /**
5704
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
5705
+ * activity and `unlabeled` includes all records without published source
5706
+ * attribution, including historical and unknown origins. Unlabeled does not imply
5707
+ * direct API usage. Without source grouping, this field is null.
5708
+ */
5709
+ api_source?: 'agents_api' | 'unlabeled' | null;
5710
+
5370
5711
  /**
5371
5712
  * When `group_by=batch`, this field tells whether the grouped usage result is
5372
5713
  * batch or not.
@@ -5379,7 +5720,14 @@ export namespace UsageVectorStoresResponse {
5379
5720
  input_audio_tokens?: number;
5380
5721
 
5381
5722
  /**
5382
- * The aggregated number of input tokens written to the cache.
5723
+ * The aggregated number of input tokens written to the cache with a 12-hour
5724
+ * retention period.
5725
+ */
5726
+ input_cache_write_12h_tokens?: number;
5727
+
5728
+ /**
5729
+ * The aggregated number of input tokens written to the cache with a 30-minute
5730
+ * retention period.
5383
5731
  */
5384
5732
  input_cache_write_tokens?: number;
5385
5733
 
@@ -5773,6 +6121,14 @@ export namespace UsageVectorStoresResponse {
5773
6121
  */
5774
6122
  api_key_id?: string | null;
5775
6123
 
6124
+ /**
6125
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
6126
+ * activity and `unlabeled` includes all records without published source
6127
+ * attribution, including historical and unknown origins. Unlabeled does not imply
6128
+ * direct API usage. Without source grouping, this field is null.
6129
+ */
6130
+ api_source?: 'agents_api' | 'unlabeled' | null;
6131
+
5776
6132
  /**
5777
6133
  * When `group_by=context_level`, this field provides the search context size of
5778
6134
  * the grouped usage result.
@@ -5815,6 +6171,14 @@ export namespace UsageVectorStoresResponse {
5815
6171
  */
5816
6172
  api_key_id?: string | null;
5817
6173
 
6174
+ /**
6175
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
6176
+ * activity and `unlabeled` includes all records without published source
6177
+ * attribution, including historical and unknown origins. Unlabeled does not imply
6178
+ * direct API usage. Without source grouping, this field is null.
6179
+ */
6180
+ api_source?: 'agents_api' | 'unlabeled' | null;
6181
+
5818
6182
  /**
5819
6183
  * When `group_by=line_item`, this field provides the line item of the grouped
5820
6184
  * costs result.
@@ -5838,6 +6202,12 @@ export namespace UsageVectorStoresResponse {
5838
6202
  * result, this field is `null`.
5839
6203
  */
5840
6204
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
6205
+
6206
+ /**
6207
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
6208
+ * result.
6209
+ */
6210
+ user_id?: string | null;
5841
6211
  }
5842
6212
 
5843
6213
  export namespace OrganizationCostsResult {
@@ -5924,6 +6294,14 @@ export namespace UsageWebSearchCallsResponse {
5924
6294
  */
5925
6295
  api_key_id?: string | null;
5926
6296
 
6297
+ /**
6298
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
6299
+ * activity and `unlabeled` includes all records without published source
6300
+ * attribution, including historical and unknown origins. Unlabeled does not imply
6301
+ * direct API usage. Without source grouping, this field is null.
6302
+ */
6303
+ api_source?: 'agents_api' | 'unlabeled' | null;
6304
+
5927
6305
  /**
5928
6306
  * When `group_by=batch`, this field tells whether the grouped usage result is
5929
6307
  * batch or not.
@@ -5936,7 +6314,14 @@ export namespace UsageWebSearchCallsResponse {
5936
6314
  input_audio_tokens?: number;
5937
6315
 
5938
6316
  /**
5939
- * The aggregated number of input tokens written to the cache.
6317
+ * The aggregated number of input tokens written to the cache with a 12-hour
6318
+ * retention period.
6319
+ */
6320
+ input_cache_write_12h_tokens?: number;
6321
+
6322
+ /**
6323
+ * The aggregated number of input tokens written to the cache with a 30-minute
6324
+ * retention period.
5940
6325
  */
5941
6326
  input_cache_write_tokens?: number;
5942
6327
 
@@ -6330,6 +6715,14 @@ export namespace UsageWebSearchCallsResponse {
6330
6715
  */
6331
6716
  api_key_id?: string | null;
6332
6717
 
6718
+ /**
6719
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
6720
+ * activity and `unlabeled` includes all records without published source
6721
+ * attribution, including historical and unknown origins. Unlabeled does not imply
6722
+ * direct API usage. Without source grouping, this field is null.
6723
+ */
6724
+ api_source?: 'agents_api' | 'unlabeled' | null;
6725
+
6333
6726
  /**
6334
6727
  * When `group_by=context_level`, this field provides the search context size of
6335
6728
  * the grouped usage result.
@@ -6372,6 +6765,14 @@ export namespace UsageWebSearchCallsResponse {
6372
6765
  */
6373
6766
  api_key_id?: string | null;
6374
6767
 
6768
+ /**
6769
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
6770
+ * activity and `unlabeled` includes all records without published source
6771
+ * attribution, including historical and unknown origins. Unlabeled does not imply
6772
+ * direct API usage. Without source grouping, this field is null.
6773
+ */
6774
+ api_source?: 'agents_api' | 'unlabeled' | null;
6775
+
6375
6776
  /**
6376
6777
  * When `group_by=line_item`, this field provides the line item of the grouped
6377
6778
  * costs result.
@@ -6395,6 +6796,12 @@ export namespace UsageWebSearchCallsResponse {
6395
6796
  * result, this field is `null`.
6396
6797
  */
6397
6798
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
6799
+
6800
+ /**
6801
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
6802
+ * result.
6803
+ */
6804
+ user_id?: string | null;
6398
6805
  }
6399
6806
 
6400
6807
  export namespace OrganizationCostsResult {
@@ -6608,10 +7015,14 @@ export interface UsageCompletionsParams {
6608
7015
 
6609
7016
  /**
6610
7017
  * Group the usage data by the specified fields. Support fields include
6611
- * `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier` or any
6612
- * combination of them.
7018
+ * `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
7019
+ * `api_source` or any combination of them. When grouped by `api_source`, results
7020
+ * use `agents_api` for attributed Agents API activity and `unlabeled` for all
7021
+ * other activity. Without source grouping, `api_source` is null.
6613
7022
  */
6614
- group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch' | 'service_tier'>;
7023
+ group_by?: Array<
7024
+ 'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch' | 'service_tier' | 'api_source'
7025
+ >;
6615
7026
 
6616
7027
  /**
6617
7028
  * Specifies the number of buckets to return.
@@ -6667,10 +7078,15 @@ export interface UsageCostsParams {
6667
7078
  end_time?: number;
6668
7079
 
6669
7080
  /**
6670
- * Group the costs by the specified fields. Support fields include `project_id`,
6671
- * `line_item`, `api_key_id` and any combination of them.
7081
+ * Group the costs by the specified fields. Supported fields include `project_id`,
7082
+ * `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
7083
+ * `user_id` with `project_id` grouping or the `project_ids` filter depends on the
7084
+ * organization and requested time range. Unsupported combinations return HTTP 400.
7085
+ * When grouped by `api_source`, results use `agents_api` for attributed Agents API
7086
+ * activity and `unlabeled` for all other activity. Without source grouping,
7087
+ * `api_source` is null.
6672
7088
  */
6673
- group_by?: Array<'project_id' | 'line_item' | 'api_key_id'>;
7089
+ group_by?: Array<'project_id' | 'user_id' | 'line_item' | 'api_key_id' | 'api_source'>;
6674
7090
 
6675
7091
  /**
6676
7092
  * A limit on the number of buckets to be returned. Limit can range between 1 and
@@ -7019,10 +7435,12 @@ export interface UsageWebSearchCallsParams {
7019
7435
 
7020
7436
  /**
7021
7437
  * Group the usage data by the specified fields. Support fields include
7022
- * `project_id`, `user_id`, `api_key_id`, `model`, `context_level` or any
7023
- * combination of them.
7438
+ * `project_id`, `user_id`, `api_key_id`, `model`, `context_level`, `api_source` or
7439
+ * any combination of them. When grouped by `api_source`, results use `agents_api`
7440
+ * for attributed Agents API activity and `unlabeled` for all other activity.
7441
+ * Without source grouping, `api_source` is null.
7024
7442
  */
7025
- group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'context_level'>;
7443
+ group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'context_level' | 'api_source'>;
7026
7444
 
7027
7445
  /**
7028
7446
  * Specifies the number of buckets to return.