File tree 2 files changed +54
-0
lines changed
src/resources/beta/threads/runs
2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -264,6 +264,12 @@ export interface Run {
264
264
* this run.
265
265
*/
266
266
tools : Array < Run . AssistantToolsCode | Run . AssistantToolsRetrieval | Run . AssistantToolsFunction > ;
267
+
268
+ /**
269
+ * Usage statistics related to the run. This value will be `null` if the run is not
270
+ * in a terminal state (i.e. `in_progress`, `queued`, etc.).
271
+ */
272
+ usage : Run . Usage | null ;
267
273
}
268
274
269
275
export namespace Run {
@@ -332,6 +338,27 @@ export namespace Run {
332
338
*/
333
339
type : 'function' ;
334
340
}
341
+
342
+ /**
343
+ * Usage statistics related to the run. This value will be `null` if the run is not
344
+ * in a terminal state (i.e. `in_progress`, `queued`, etc.).
345
+ */
346
+ export interface Usage {
347
+ /**
348
+ * Number of completion tokens used over the course of the run.
349
+ */
350
+ completion_tokens : number ;
351
+
352
+ /**
353
+ * Number of prompt tokens used over the course of the run.
354
+ */
355
+ prompt_tokens : number ;
356
+
357
+ /**
358
+ * Total number of tokens used (prompt + completion).
359
+ */
360
+ total_tokens : number ;
361
+ }
335
362
}
336
363
337
364
export interface RunCreateParams {
Original file line number Diff line number Diff line change @@ -300,6 +300,12 @@ export interface RunStep {
300
300
* The type of run step, which can be either `message_creation` or `tool_calls`.
301
301
*/
302
302
type : 'message_creation' | 'tool_calls' ;
303
+
304
+ /**
305
+ * Usage statistics related to the run step. This value will be `null` while the
306
+ * run step's status is `in_progress`.
307
+ */
308
+ usage : RunStep . Usage | null ;
303
309
}
304
310
305
311
export namespace RunStep {
@@ -318,6 +324,27 @@ export namespace RunStep {
318
324
*/
319
325
message : string ;
320
326
}
327
+
328
+ /**
329
+ * Usage statistics related to the run step. This value will be `null` while the
330
+ * run step's status is `in_progress`.
331
+ */
332
+ export interface Usage {
333
+ /**
334
+ * Number of completion tokens used over the course of the run step.
335
+ */
336
+ completion_tokens : number ;
337
+
338
+ /**
339
+ * Number of prompt tokens used over the course of the run step.
340
+ */
341
+ prompt_tokens : number ;
342
+
343
+ /**
344
+ * Total number of tokens used (prompt + completion).
345
+ */
346
+ total_tokens : number ;
347
+ }
321
348
}
322
349
323
350
/**
You can’t perform that action at this time.
0 commit comments