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
@@ -181,6 +181,13 @@ export declare namespace UsageAudioSpeechesResponse {
181
181
  * usage result.
182
182
  */
183
183
  api_key_id?: string | null;
184
+ /**
185
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
186
+ * activity and `unlabeled` includes all records without published source
187
+ * attribution, including historical and unknown origins. Unlabeled does not imply
188
+ * direct API usage. Without source grouping, this field is null.
189
+ */
190
+ api_source?: 'agents_api' | 'unlabeled' | null;
184
191
  /**
185
192
  * When `group_by=batch`, this field tells whether the grouped usage result is
186
193
  * batch or not.
@@ -191,7 +198,13 @@ export declare namespace UsageAudioSpeechesResponse {
191
198
  */
192
199
  input_audio_tokens?: number;
193
200
  /**
194
- * The aggregated number of input tokens written to the cache.
201
+ * The aggregated number of input tokens written to the cache with a 12-hour
202
+ * retention period.
203
+ */
204
+ input_cache_write_12h_tokens?: number;
205
+ /**
206
+ * The aggregated number of input tokens written to the cache with a 30-minute
207
+ * retention period.
195
208
  */
196
209
  input_cache_write_tokens?: number;
197
210
  /**
@@ -517,6 +530,13 @@ export declare namespace UsageAudioSpeechesResponse {
517
530
  * usage result.
518
531
  */
519
532
  api_key_id?: string | null;
533
+ /**
534
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
535
+ * activity and `unlabeled` includes all records without published source
536
+ * attribution, including historical and unknown origins. Unlabeled does not imply
537
+ * direct API usage. Without source grouping, this field is null.
538
+ */
539
+ api_source?: 'agents_api' | 'unlabeled' | null;
520
540
  /**
521
541
  * When `group_by=context_level`, this field provides the search context size of
522
542
  * the grouped usage result.
@@ -552,6 +572,13 @@ export declare namespace UsageAudioSpeechesResponse {
552
572
  * costs result.
553
573
  */
554
574
  api_key_id?: string | null;
575
+ /**
576
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
577
+ * activity and `unlabeled` includes all records without published source
578
+ * attribution, including historical and unknown origins. Unlabeled does not imply
579
+ * direct API usage. Without source grouping, this field is null.
580
+ */
581
+ api_source?: 'agents_api' | 'unlabeled' | null;
555
582
  /**
556
583
  * When `group_by=line_item`, this field provides the line item of the grouped
557
584
  * costs result.
@@ -572,6 +599,11 @@ export declare namespace UsageAudioSpeechesResponse {
572
599
  * result, this field is `null`.
573
600
  */
574
601
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
602
+ /**
603
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
604
+ * result.
605
+ */
606
+ user_id?: string | null;
575
607
  }
576
608
  namespace OrganizationCostsResult {
577
609
  /**
@@ -630,6 +662,13 @@ export declare namespace UsageAudioTranscriptionsResponse {
630
662
  * usage result.
631
663
  */
632
664
  api_key_id?: string | null;
665
+ /**
666
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
667
+ * activity and `unlabeled` includes all records without published source
668
+ * attribution, including historical and unknown origins. Unlabeled does not imply
669
+ * direct API usage. Without source grouping, this field is null.
670
+ */
671
+ api_source?: 'agents_api' | 'unlabeled' | null;
633
672
  /**
634
673
  * When `group_by=batch`, this field tells whether the grouped usage result is
635
674
  * batch or not.
@@ -640,7 +679,13 @@ export declare namespace UsageAudioTranscriptionsResponse {
640
679
  */
641
680
  input_audio_tokens?: number;
642
681
  /**
643
- * The aggregated number of input tokens written to the cache.
682
+ * The aggregated number of input tokens written to the cache with a 12-hour
683
+ * retention period.
684
+ */
685
+ input_cache_write_12h_tokens?: number;
686
+ /**
687
+ * The aggregated number of input tokens written to the cache with a 30-minute
688
+ * retention period.
644
689
  */
645
690
  input_cache_write_tokens?: number;
646
691
  /**
@@ -966,6 +1011,13 @@ export declare namespace UsageAudioTranscriptionsResponse {
966
1011
  * usage result.
967
1012
  */
968
1013
  api_key_id?: string | null;
1014
+ /**
1015
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1016
+ * activity and `unlabeled` includes all records without published source
1017
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1018
+ * direct API usage. Without source grouping, this field is null.
1019
+ */
1020
+ api_source?: 'agents_api' | 'unlabeled' | null;
969
1021
  /**
970
1022
  * When `group_by=context_level`, this field provides the search context size of
971
1023
  * the grouped usage result.
@@ -1001,6 +1053,13 @@ export declare namespace UsageAudioTranscriptionsResponse {
1001
1053
  * costs result.
1002
1054
  */
1003
1055
  api_key_id?: string | null;
1056
+ /**
1057
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1058
+ * activity and `unlabeled` includes all records without published source
1059
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1060
+ * direct API usage. Without source grouping, this field is null.
1061
+ */
1062
+ api_source?: 'agents_api' | 'unlabeled' | null;
1004
1063
  /**
1005
1064
  * When `group_by=line_item`, this field provides the line item of the grouped
1006
1065
  * costs result.
@@ -1021,6 +1080,11 @@ export declare namespace UsageAudioTranscriptionsResponse {
1021
1080
  * result, this field is `null`.
1022
1081
  */
1023
1082
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
1083
+ /**
1084
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
1085
+ * result.
1086
+ */
1087
+ user_id?: string | null;
1024
1088
  }
1025
1089
  namespace OrganizationCostsResult {
1026
1090
  /**
@@ -1079,6 +1143,13 @@ export declare namespace UsageCodeInterpreterSessionsResponse {
1079
1143
  * usage result.
1080
1144
  */
1081
1145
  api_key_id?: string | null;
1146
+ /**
1147
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1148
+ * activity and `unlabeled` includes all records without published source
1149
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1150
+ * direct API usage. Without source grouping, this field is null.
1151
+ */
1152
+ api_source?: 'agents_api' | 'unlabeled' | null;
1082
1153
  /**
1083
1154
  * When `group_by=batch`, this field tells whether the grouped usage result is
1084
1155
  * batch or not.
@@ -1089,7 +1160,13 @@ export declare namespace UsageCodeInterpreterSessionsResponse {
1089
1160
  */
1090
1161
  input_audio_tokens?: number;
1091
1162
  /**
1092
- * The aggregated number of input tokens written to the cache.
1163
+ * The aggregated number of input tokens written to the cache with a 12-hour
1164
+ * retention period.
1165
+ */
1166
+ input_cache_write_12h_tokens?: number;
1167
+ /**
1168
+ * The aggregated number of input tokens written to the cache with a 30-minute
1169
+ * retention period.
1093
1170
  */
1094
1171
  input_cache_write_tokens?: number;
1095
1172
  /**
@@ -1415,6 +1492,13 @@ export declare namespace UsageCodeInterpreterSessionsResponse {
1415
1492
  * usage result.
1416
1493
  */
1417
1494
  api_key_id?: string | null;
1495
+ /**
1496
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1497
+ * activity and `unlabeled` includes all records without published source
1498
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1499
+ * direct API usage. Without source grouping, this field is null.
1500
+ */
1501
+ api_source?: 'agents_api' | 'unlabeled' | null;
1418
1502
  /**
1419
1503
  * When `group_by=context_level`, this field provides the search context size of
1420
1504
  * the grouped usage result.
@@ -1450,6 +1534,13 @@ export declare namespace UsageCodeInterpreterSessionsResponse {
1450
1534
  * costs result.
1451
1535
  */
1452
1536
  api_key_id?: string | null;
1537
+ /**
1538
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1539
+ * activity and `unlabeled` includes all records without published source
1540
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1541
+ * direct API usage. Without source grouping, this field is null.
1542
+ */
1543
+ api_source?: 'agents_api' | 'unlabeled' | null;
1453
1544
  /**
1454
1545
  * When `group_by=line_item`, this field provides the line item of the grouped
1455
1546
  * costs result.
@@ -1470,6 +1561,11 @@ export declare namespace UsageCodeInterpreterSessionsResponse {
1470
1561
  * result, this field is `null`.
1471
1562
  */
1472
1563
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
1564
+ /**
1565
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
1566
+ * result.
1567
+ */
1568
+ user_id?: string | null;
1473
1569
  }
1474
1570
  namespace OrganizationCostsResult {
1475
1571
  /**
@@ -1528,6 +1624,13 @@ export declare namespace UsageCompletionsResponse {
1528
1624
  * usage result.
1529
1625
  */
1530
1626
  api_key_id?: string | null;
1627
+ /**
1628
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1629
+ * activity and `unlabeled` includes all records without published source
1630
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1631
+ * direct API usage. Without source grouping, this field is null.
1632
+ */
1633
+ api_source?: 'agents_api' | 'unlabeled' | null;
1531
1634
  /**
1532
1635
  * When `group_by=batch`, this field tells whether the grouped usage result is
1533
1636
  * batch or not.
@@ -1538,7 +1641,13 @@ export declare namespace UsageCompletionsResponse {
1538
1641
  */
1539
1642
  input_audio_tokens?: number;
1540
1643
  /**
1541
- * The aggregated number of input tokens written to the cache.
1644
+ * The aggregated number of input tokens written to the cache with a 12-hour
1645
+ * retention period.
1646
+ */
1647
+ input_cache_write_12h_tokens?: number;
1648
+ /**
1649
+ * The aggregated number of input tokens written to the cache with a 30-minute
1650
+ * retention period.
1542
1651
  */
1543
1652
  input_cache_write_tokens?: number;
1544
1653
  /**
@@ -1864,6 +1973,13 @@ export declare namespace UsageCompletionsResponse {
1864
1973
  * usage result.
1865
1974
  */
1866
1975
  api_key_id?: string | null;
1976
+ /**
1977
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
1978
+ * activity and `unlabeled` includes all records without published source
1979
+ * attribution, including historical and unknown origins. Unlabeled does not imply
1980
+ * direct API usage. Without source grouping, this field is null.
1981
+ */
1982
+ api_source?: 'agents_api' | 'unlabeled' | null;
1867
1983
  /**
1868
1984
  * When `group_by=context_level`, this field provides the search context size of
1869
1985
  * the grouped usage result.
@@ -1899,6 +2015,13 @@ export declare namespace UsageCompletionsResponse {
1899
2015
  * costs result.
1900
2016
  */
1901
2017
  api_key_id?: string | null;
2018
+ /**
2019
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2020
+ * activity and `unlabeled` includes all records without published source
2021
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2022
+ * direct API usage. Without source grouping, this field is null.
2023
+ */
2024
+ api_source?: 'agents_api' | 'unlabeled' | null;
1902
2025
  /**
1903
2026
  * When `group_by=line_item`, this field provides the line item of the grouped
1904
2027
  * costs result.
@@ -1919,6 +2042,11 @@ export declare namespace UsageCompletionsResponse {
1919
2042
  * result, this field is `null`.
1920
2043
  */
1921
2044
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
2045
+ /**
2046
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
2047
+ * result.
2048
+ */
2049
+ user_id?: string | null;
1922
2050
  }
1923
2051
  namespace OrganizationCostsResult {
1924
2052
  /**
@@ -1977,6 +2105,13 @@ export declare namespace UsageCostsResponse {
1977
2105
  * usage result.
1978
2106
  */
1979
2107
  api_key_id?: string | null;
2108
+ /**
2109
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2110
+ * activity and `unlabeled` includes all records without published source
2111
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2112
+ * direct API usage. Without source grouping, this field is null.
2113
+ */
2114
+ api_source?: 'agents_api' | 'unlabeled' | null;
1980
2115
  /**
1981
2116
  * When `group_by=batch`, this field tells whether the grouped usage result is
1982
2117
  * batch or not.
@@ -1987,7 +2122,13 @@ export declare namespace UsageCostsResponse {
1987
2122
  */
1988
2123
  input_audio_tokens?: number;
1989
2124
  /**
1990
- * The aggregated number of input tokens written to the cache.
2125
+ * The aggregated number of input tokens written to the cache with a 12-hour
2126
+ * retention period.
2127
+ */
2128
+ input_cache_write_12h_tokens?: number;
2129
+ /**
2130
+ * The aggregated number of input tokens written to the cache with a 30-minute
2131
+ * retention period.
1991
2132
  */
1992
2133
  input_cache_write_tokens?: number;
1993
2134
  /**
@@ -2313,6 +2454,13 @@ export declare namespace UsageCostsResponse {
2313
2454
  * usage result.
2314
2455
  */
2315
2456
  api_key_id?: string | null;
2457
+ /**
2458
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2459
+ * activity and `unlabeled` includes all records without published source
2460
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2461
+ * direct API usage. Without source grouping, this field is null.
2462
+ */
2463
+ api_source?: 'agents_api' | 'unlabeled' | null;
2316
2464
  /**
2317
2465
  * When `group_by=context_level`, this field provides the search context size of
2318
2466
  * the grouped usage result.
@@ -2348,6 +2496,13 @@ export declare namespace UsageCostsResponse {
2348
2496
  * costs result.
2349
2497
  */
2350
2498
  api_key_id?: string | null;
2499
+ /**
2500
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2501
+ * activity and `unlabeled` includes all records without published source
2502
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2503
+ * direct API usage. Without source grouping, this field is null.
2504
+ */
2505
+ api_source?: 'agents_api' | 'unlabeled' | null;
2351
2506
  /**
2352
2507
  * When `group_by=line_item`, this field provides the line item of the grouped
2353
2508
  * costs result.
@@ -2368,6 +2523,11 @@ export declare namespace UsageCostsResponse {
2368
2523
  * result, this field is `null`.
2369
2524
  */
2370
2525
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
2526
+ /**
2527
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
2528
+ * result.
2529
+ */
2530
+ user_id?: string | null;
2371
2531
  }
2372
2532
  namespace OrganizationCostsResult {
2373
2533
  /**
@@ -2426,6 +2586,13 @@ export declare namespace UsageEmbeddingsResponse {
2426
2586
  * usage result.
2427
2587
  */
2428
2588
  api_key_id?: string | null;
2589
+ /**
2590
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2591
+ * activity and `unlabeled` includes all records without published source
2592
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2593
+ * direct API usage. Without source grouping, this field is null.
2594
+ */
2595
+ api_source?: 'agents_api' | 'unlabeled' | null;
2429
2596
  /**
2430
2597
  * When `group_by=batch`, this field tells whether the grouped usage result is
2431
2598
  * batch or not.
@@ -2436,7 +2603,13 @@ export declare namespace UsageEmbeddingsResponse {
2436
2603
  */
2437
2604
  input_audio_tokens?: number;
2438
2605
  /**
2439
- * The aggregated number of input tokens written to the cache.
2606
+ * The aggregated number of input tokens written to the cache with a 12-hour
2607
+ * retention period.
2608
+ */
2609
+ input_cache_write_12h_tokens?: number;
2610
+ /**
2611
+ * The aggregated number of input tokens written to the cache with a 30-minute
2612
+ * retention period.
2440
2613
  */
2441
2614
  input_cache_write_tokens?: number;
2442
2615
  /**
@@ -2762,6 +2935,13 @@ export declare namespace UsageEmbeddingsResponse {
2762
2935
  * usage result.
2763
2936
  */
2764
2937
  api_key_id?: string | null;
2938
+ /**
2939
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2940
+ * activity and `unlabeled` includes all records without published source
2941
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2942
+ * direct API usage. Without source grouping, this field is null.
2943
+ */
2944
+ api_source?: 'agents_api' | 'unlabeled' | null;
2765
2945
  /**
2766
2946
  * When `group_by=context_level`, this field provides the search context size of
2767
2947
  * the grouped usage result.
@@ -2797,6 +2977,13 @@ export declare namespace UsageEmbeddingsResponse {
2797
2977
  * costs result.
2798
2978
  */
2799
2979
  api_key_id?: string | null;
2980
+ /**
2981
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
2982
+ * activity and `unlabeled` includes all records without published source
2983
+ * attribution, including historical and unknown origins. Unlabeled does not imply
2984
+ * direct API usage. Without source grouping, this field is null.
2985
+ */
2986
+ api_source?: 'agents_api' | 'unlabeled' | null;
2800
2987
  /**
2801
2988
  * When `group_by=line_item`, this field provides the line item of the grouped
2802
2989
  * costs result.
@@ -2817,6 +3004,11 @@ export declare namespace UsageEmbeddingsResponse {
2817
3004
  * result, this field is `null`.
2818
3005
  */
2819
3006
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
3007
+ /**
3008
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
3009
+ * result.
3010
+ */
3011
+ user_id?: string | null;
2820
3012
  }
2821
3013
  namespace OrganizationCostsResult {
2822
3014
  /**
@@ -2875,6 +3067,13 @@ export declare namespace UsageFileSearchCallsResponse {
2875
3067
  * usage result.
2876
3068
  */
2877
3069
  api_key_id?: string | null;
3070
+ /**
3071
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3072
+ * activity and `unlabeled` includes all records without published source
3073
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3074
+ * direct API usage. Without source grouping, this field is null.
3075
+ */
3076
+ api_source?: 'agents_api' | 'unlabeled' | null;
2878
3077
  /**
2879
3078
  * When `group_by=batch`, this field tells whether the grouped usage result is
2880
3079
  * batch or not.
@@ -2885,7 +3084,13 @@ export declare namespace UsageFileSearchCallsResponse {
2885
3084
  */
2886
3085
  input_audio_tokens?: number;
2887
3086
  /**
2888
- * The aggregated number of input tokens written to the cache.
3087
+ * The aggregated number of input tokens written to the cache with a 12-hour
3088
+ * retention period.
3089
+ */
3090
+ input_cache_write_12h_tokens?: number;
3091
+ /**
3092
+ * The aggregated number of input tokens written to the cache with a 30-minute
3093
+ * retention period.
2889
3094
  */
2890
3095
  input_cache_write_tokens?: number;
2891
3096
  /**
@@ -3211,6 +3416,13 @@ export declare namespace UsageFileSearchCallsResponse {
3211
3416
  * usage result.
3212
3417
  */
3213
3418
  api_key_id?: string | null;
3419
+ /**
3420
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3421
+ * activity and `unlabeled` includes all records without published source
3422
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3423
+ * direct API usage. Without source grouping, this field is null.
3424
+ */
3425
+ api_source?: 'agents_api' | 'unlabeled' | null;
3214
3426
  /**
3215
3427
  * When `group_by=context_level`, this field provides the search context size of
3216
3428
  * the grouped usage result.
@@ -3246,6 +3458,13 @@ export declare namespace UsageFileSearchCallsResponse {
3246
3458
  * costs result.
3247
3459
  */
3248
3460
  api_key_id?: string | null;
3461
+ /**
3462
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3463
+ * activity and `unlabeled` includes all records without published source
3464
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3465
+ * direct API usage. Without source grouping, this field is null.
3466
+ */
3467
+ api_source?: 'agents_api' | 'unlabeled' | null;
3249
3468
  /**
3250
3469
  * When `group_by=line_item`, this field provides the line item of the grouped
3251
3470
  * costs result.
@@ -3266,6 +3485,11 @@ export declare namespace UsageFileSearchCallsResponse {
3266
3485
  * result, this field is `null`.
3267
3486
  */
3268
3487
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
3488
+ /**
3489
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
3490
+ * result.
3491
+ */
3492
+ user_id?: string | null;
3269
3493
  }
3270
3494
  namespace OrganizationCostsResult {
3271
3495
  /**
@@ -3324,6 +3548,13 @@ export declare namespace UsageImagesResponse {
3324
3548
  * usage result.
3325
3549
  */
3326
3550
  api_key_id?: string | null;
3551
+ /**
3552
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3553
+ * activity and `unlabeled` includes all records without published source
3554
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3555
+ * direct API usage. Without source grouping, this field is null.
3556
+ */
3557
+ api_source?: 'agents_api' | 'unlabeled' | null;
3327
3558
  /**
3328
3559
  * When `group_by=batch`, this field tells whether the grouped usage result is
3329
3560
  * batch or not.
@@ -3334,7 +3565,13 @@ export declare namespace UsageImagesResponse {
3334
3565
  */
3335
3566
  input_audio_tokens?: number;
3336
3567
  /**
3337
- * The aggregated number of input tokens written to the cache.
3568
+ * The aggregated number of input tokens written to the cache with a 12-hour
3569
+ * retention period.
3570
+ */
3571
+ input_cache_write_12h_tokens?: number;
3572
+ /**
3573
+ * The aggregated number of input tokens written to the cache with a 30-minute
3574
+ * retention period.
3338
3575
  */
3339
3576
  input_cache_write_tokens?: number;
3340
3577
  /**
@@ -3660,6 +3897,13 @@ export declare namespace UsageImagesResponse {
3660
3897
  * usage result.
3661
3898
  */
3662
3899
  api_key_id?: string | null;
3900
+ /**
3901
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3902
+ * activity and `unlabeled` includes all records without published source
3903
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3904
+ * direct API usage. Without source grouping, this field is null.
3905
+ */
3906
+ api_source?: 'agents_api' | 'unlabeled' | null;
3663
3907
  /**
3664
3908
  * When `group_by=context_level`, this field provides the search context size of
3665
3909
  * the grouped usage result.
@@ -3695,6 +3939,13 @@ export declare namespace UsageImagesResponse {
3695
3939
  * costs result.
3696
3940
  */
3697
3941
  api_key_id?: string | null;
3942
+ /**
3943
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
3944
+ * activity and `unlabeled` includes all records without published source
3945
+ * attribution, including historical and unknown origins. Unlabeled does not imply
3946
+ * direct API usage. Without source grouping, this field is null.
3947
+ */
3948
+ api_source?: 'agents_api' | 'unlabeled' | null;
3698
3949
  /**
3699
3950
  * When `group_by=line_item`, this field provides the line item of the grouped
3700
3951
  * costs result.
@@ -3715,6 +3966,11 @@ export declare namespace UsageImagesResponse {
3715
3966
  * result, this field is `null`.
3716
3967
  */
3717
3968
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
3969
+ /**
3970
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
3971
+ * result.
3972
+ */
3973
+ user_id?: string | null;
3718
3974
  }
3719
3975
  namespace OrganizationCostsResult {
3720
3976
  /**
@@ -3773,6 +4029,13 @@ export declare namespace UsageModerationsResponse {
3773
4029
  * usage result.
3774
4030
  */
3775
4031
  api_key_id?: string | null;
4032
+ /**
4033
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4034
+ * activity and `unlabeled` includes all records without published source
4035
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4036
+ * direct API usage. Without source grouping, this field is null.
4037
+ */
4038
+ api_source?: 'agents_api' | 'unlabeled' | null;
3776
4039
  /**
3777
4040
  * When `group_by=batch`, this field tells whether the grouped usage result is
3778
4041
  * batch or not.
@@ -3783,7 +4046,13 @@ export declare namespace UsageModerationsResponse {
3783
4046
  */
3784
4047
  input_audio_tokens?: number;
3785
4048
  /**
3786
- * The aggregated number of input tokens written to the cache.
4049
+ * The aggregated number of input tokens written to the cache with a 12-hour
4050
+ * retention period.
4051
+ */
4052
+ input_cache_write_12h_tokens?: number;
4053
+ /**
4054
+ * The aggregated number of input tokens written to the cache with a 30-minute
4055
+ * retention period.
3787
4056
  */
3788
4057
  input_cache_write_tokens?: number;
3789
4058
  /**
@@ -4109,6 +4378,13 @@ export declare namespace UsageModerationsResponse {
4109
4378
  * usage result.
4110
4379
  */
4111
4380
  api_key_id?: string | null;
4381
+ /**
4382
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4383
+ * activity and `unlabeled` includes all records without published source
4384
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4385
+ * direct API usage. Without source grouping, this field is null.
4386
+ */
4387
+ api_source?: 'agents_api' | 'unlabeled' | null;
4112
4388
  /**
4113
4389
  * When `group_by=context_level`, this field provides the search context size of
4114
4390
  * the grouped usage result.
@@ -4144,6 +4420,13 @@ export declare namespace UsageModerationsResponse {
4144
4420
  * costs result.
4145
4421
  */
4146
4422
  api_key_id?: string | null;
4423
+ /**
4424
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4425
+ * activity and `unlabeled` includes all records without published source
4426
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4427
+ * direct API usage. Without source grouping, this field is null.
4428
+ */
4429
+ api_source?: 'agents_api' | 'unlabeled' | null;
4147
4430
  /**
4148
4431
  * When `group_by=line_item`, this field provides the line item of the grouped
4149
4432
  * costs result.
@@ -4164,6 +4447,11 @@ export declare namespace UsageModerationsResponse {
4164
4447
  * result, this field is `null`.
4165
4448
  */
4166
4449
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
4450
+ /**
4451
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
4452
+ * result.
4453
+ */
4454
+ user_id?: string | null;
4167
4455
  }
4168
4456
  namespace OrganizationCostsResult {
4169
4457
  /**
@@ -4222,6 +4510,13 @@ export declare namespace UsageVectorStoresResponse {
4222
4510
  * usage result.
4223
4511
  */
4224
4512
  api_key_id?: string | null;
4513
+ /**
4514
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4515
+ * activity and `unlabeled` includes all records without published source
4516
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4517
+ * direct API usage. Without source grouping, this field is null.
4518
+ */
4519
+ api_source?: 'agents_api' | 'unlabeled' | null;
4225
4520
  /**
4226
4521
  * When `group_by=batch`, this field tells whether the grouped usage result is
4227
4522
  * batch or not.
@@ -4232,7 +4527,13 @@ export declare namespace UsageVectorStoresResponse {
4232
4527
  */
4233
4528
  input_audio_tokens?: number;
4234
4529
  /**
4235
- * The aggregated number of input tokens written to the cache.
4530
+ * The aggregated number of input tokens written to the cache with a 12-hour
4531
+ * retention period.
4532
+ */
4533
+ input_cache_write_12h_tokens?: number;
4534
+ /**
4535
+ * The aggregated number of input tokens written to the cache with a 30-minute
4536
+ * retention period.
4236
4537
  */
4237
4538
  input_cache_write_tokens?: number;
4238
4539
  /**
@@ -4558,6 +4859,13 @@ export declare namespace UsageVectorStoresResponse {
4558
4859
  * usage result.
4559
4860
  */
4560
4861
  api_key_id?: string | null;
4862
+ /**
4863
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4864
+ * activity and `unlabeled` includes all records without published source
4865
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4866
+ * direct API usage. Without source grouping, this field is null.
4867
+ */
4868
+ api_source?: 'agents_api' | 'unlabeled' | null;
4561
4869
  /**
4562
4870
  * When `group_by=context_level`, this field provides the search context size of
4563
4871
  * the grouped usage result.
@@ -4593,6 +4901,13 @@ export declare namespace UsageVectorStoresResponse {
4593
4901
  * costs result.
4594
4902
  */
4595
4903
  api_key_id?: string | null;
4904
+ /**
4905
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4906
+ * activity and `unlabeled` includes all records without published source
4907
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4908
+ * direct API usage. Without source grouping, this field is null.
4909
+ */
4910
+ api_source?: 'agents_api' | 'unlabeled' | null;
4596
4911
  /**
4597
4912
  * When `group_by=line_item`, this field provides the line item of the grouped
4598
4913
  * costs result.
@@ -4613,6 +4928,11 @@ export declare namespace UsageVectorStoresResponse {
4613
4928
  * result, this field is `null`.
4614
4929
  */
4615
4930
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
4931
+ /**
4932
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
4933
+ * result.
4934
+ */
4935
+ user_id?: string | null;
4616
4936
  }
4617
4937
  namespace OrganizationCostsResult {
4618
4938
  /**
@@ -4671,6 +4991,13 @@ export declare namespace UsageWebSearchCallsResponse {
4671
4991
  * usage result.
4672
4992
  */
4673
4993
  api_key_id?: string | null;
4994
+ /**
4995
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
4996
+ * activity and `unlabeled` includes all records without published source
4997
+ * attribution, including historical and unknown origins. Unlabeled does not imply
4998
+ * direct API usage. Without source grouping, this field is null.
4999
+ */
5000
+ api_source?: 'agents_api' | 'unlabeled' | null;
4674
5001
  /**
4675
5002
  * When `group_by=batch`, this field tells whether the grouped usage result is
4676
5003
  * batch or not.
@@ -4681,7 +5008,13 @@ export declare namespace UsageWebSearchCallsResponse {
4681
5008
  */
4682
5009
  input_audio_tokens?: number;
4683
5010
  /**
4684
- * The aggregated number of input tokens written to the cache.
5011
+ * The aggregated number of input tokens written to the cache with a 12-hour
5012
+ * retention period.
5013
+ */
5014
+ input_cache_write_12h_tokens?: number;
5015
+ /**
5016
+ * The aggregated number of input tokens written to the cache with a 30-minute
5017
+ * retention period.
4685
5018
  */
4686
5019
  input_cache_write_tokens?: number;
4687
5020
  /**
@@ -5007,6 +5340,13 @@ export declare namespace UsageWebSearchCallsResponse {
5007
5340
  * usage result.
5008
5341
  */
5009
5342
  api_key_id?: string | null;
5343
+ /**
5344
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
5345
+ * activity and `unlabeled` includes all records without published source
5346
+ * attribution, including historical and unknown origins. Unlabeled does not imply
5347
+ * direct API usage. Without source grouping, this field is null.
5348
+ */
5349
+ api_source?: 'agents_api' | 'unlabeled' | null;
5010
5350
  /**
5011
5351
  * When `group_by=context_level`, this field provides the search context size of
5012
5352
  * the grouped usage result.
@@ -5042,6 +5382,13 @@ export declare namespace UsageWebSearchCallsResponse {
5042
5382
  * costs result.
5043
5383
  */
5044
5384
  api_key_id?: string | null;
5385
+ /**
5386
+ * When grouped by `api_source`, `agents_api` identifies attributed Agents API
5387
+ * activity and `unlabeled` includes all records without published source
5388
+ * attribution, including historical and unknown origins. Unlabeled does not imply
5389
+ * direct API usage. Without source grouping, this field is null.
5390
+ */
5391
+ api_source?: 'agents_api' | 'unlabeled' | null;
5045
5392
  /**
5046
5393
  * When `group_by=line_item`, this field provides the line item of the grouped
5047
5394
  * costs result.
@@ -5062,6 +5409,11 @@ export declare namespace UsageWebSearchCallsResponse {
5062
5409
  * result, this field is `null`.
5063
5410
  */
5064
5411
  quantity_unit?: UsageAPI.CostQuantityUnit | null;
5412
+ /**
5413
+ * When `group_by=user_id`, this field provides the user ID of the grouped costs
5414
+ * result.
5415
+ */
5416
+ user_id?: string | null;
5065
5417
  }
5066
5418
  namespace OrganizationCostsResult {
5067
5419
  /**
@@ -5240,10 +5592,12 @@ export interface UsageCompletionsParams {
5240
5592
  end_time?: number;
5241
5593
  /**
5242
5594
  * Group the usage data by the specified fields. Support fields include
5243
- * `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier` or any
5244
- * combination of them.
5595
+ * `project_id`, `user_id`, `api_key_id`, `model`, `batch`, `service_tier`,
5596
+ * `api_source` or any combination of them. When grouped by `api_source`, results
5597
+ * use `agents_api` for attributed Agents API activity and `unlabeled` for all
5598
+ * other activity. Without source grouping, `api_source` is null.
5245
5599
  */
5246
- group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch' | 'service_tier'>;
5600
+ group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch' | 'service_tier' | 'api_source'>;
5247
5601
  /**
5248
5602
  * Specifies the number of buckets to return.
5249
5603
  *
@@ -5289,10 +5643,15 @@ export interface UsageCostsParams {
5289
5643
  */
5290
5644
  end_time?: number;
5291
5645
  /**
5292
- * Group the costs by the specified fields. Support fields include `project_id`,
5293
- * `line_item`, `api_key_id` and any combination of them.
5646
+ * Group the costs by the specified fields. Supported fields include `project_id`,
5647
+ * `user_id`, `line_item`, `api_key_id`, and `api_source`. Support for combining
5648
+ * `user_id` with `project_id` grouping or the `project_ids` filter depends on the
5649
+ * organization and requested time range. Unsupported combinations return HTTP 400.
5650
+ * When grouped by `api_source`, results use `agents_api` for attributed Agents API
5651
+ * activity and `unlabeled` for all other activity. Without source grouping,
5652
+ * `api_source` is null.
5294
5653
  */
5295
- group_by?: Array<'project_id' | 'line_item' | 'api_key_id'>;
5654
+ group_by?: Array<'project_id' | 'user_id' | 'line_item' | 'api_key_id' | 'api_source'>;
5296
5655
  /**
5297
5656
  * A limit on the number of buckets to be returned. Limit can range between 1 and
5298
5657
  * 180, and the default is 7.
@@ -5582,10 +5941,12 @@ export interface UsageWebSearchCallsParams {
5582
5941
  end_time?: number;
5583
5942
  /**
5584
5943
  * Group the usage data by the specified fields. Support fields include
5585
- * `project_id`, `user_id`, `api_key_id`, `model`, `context_level` or any
5586
- * combination of them.
5944
+ * `project_id`, `user_id`, `api_key_id`, `model`, `context_level`, `api_source` or
5945
+ * any combination of them. When grouped by `api_source`, results use `agents_api`
5946
+ * for attributed Agents API activity and `unlabeled` for all other activity.
5947
+ * Without source grouping, `api_source` is null.
5587
5948
  */
5588
- group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'context_level'>;
5949
+ group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'context_level' | 'api_source'>;
5589
5950
  /**
5590
5951
  * Specifies the number of buckets to return.
5591
5952
  *