@@ -71,6 +71,29 @@ export class InferencePipelines extends APIResource {
7171 headers : buildHeaders ( [ { Accept : '*/*' } , options ?. headers ] ) ,
7272 } ) ;
7373 }
74+
75+ /**
76+ * Get aggregated user data for an inference pipeline with pagination and metadata.
77+ *
78+ * Returns a list of users who have interacted with the inference pipeline,
79+ * including their activity statistics such as session counts, record counts, token
80+ * usage, and costs.
81+ *
82+ * @example
83+ * ```ts
84+ * const response =
85+ * await client.inferencePipelines.retrieveUsers(
86+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
87+ * );
88+ * ```
89+ */
90+ retrieveUsers (
91+ inferencePipelineID : string ,
92+ query : InferencePipelineRetrieveUsersParams | null | undefined = { } ,
93+ options ?: RequestOptions ,
94+ ) : APIPromise < InferencePipelineRetrieveUsersResponse > {
95+ return this . _client . get ( path `/inference-pipelines/${ inferencePipelineID } /users` , { query, ...options } ) ;
96+ }
7497}
7598
7699export interface InferencePipelineRetrieveResponse {
@@ -809,6 +832,52 @@ export namespace InferencePipelineUpdateResponse {
809832 }
810833}
811834
835+ export interface InferencePipelineRetrieveUsersResponse {
836+ /**
837+ * Array of user aggregation data
838+ */
839+ items : Array < InferencePipelineRetrieveUsersResponse . Item > ;
840+ }
841+
842+ export namespace InferencePipelineRetrieveUsersResponse {
843+ export interface Item {
844+ /**
845+ * The unique user identifier
846+ */
847+ id : string ;
848+
849+ /**
850+ * Total cost for this user
851+ */
852+ cost : number ;
853+
854+ /**
855+ * Timestamp of the user's first event/trace
856+ */
857+ dateOfFirstRecord : string ;
858+
859+ /**
860+ * Timestamp of the user's last event/trace
861+ */
862+ dateOfLastRecord : string ;
863+
864+ /**
865+ * Total number of traces/rows for this user
866+ */
867+ records : number ;
868+
869+ /**
870+ * Count of unique sessions for this user
871+ */
872+ sessions : number ;
873+
874+ /**
875+ * Total token count for this user
876+ */
877+ tokens : number ;
878+ }
879+ }
880+
812881export interface InferencePipelineRetrieveParams {
813882 /**
814883 * Expand specific nested objects.
@@ -834,6 +903,18 @@ export interface InferencePipelineUpdateParams {
834903 referenceDatasetUri ?: string | null ;
835904}
836905
906+ export interface InferencePipelineRetrieveUsersParams {
907+ /**
908+ * The page to return in a paginated query.
909+ */
910+ page ?: number ;
911+
912+ /**
913+ * Maximum number of items to return per page.
914+ */
915+ perPage ?: number ;
916+ }
917+
837918InferencePipelines . Data = Data ;
838919InferencePipelines . Rows = Rows ;
839920InferencePipelines . TestResults = TestResults ;
@@ -842,8 +923,10 @@ export declare namespace InferencePipelines {
842923 export {
843924 type InferencePipelineRetrieveResponse as InferencePipelineRetrieveResponse ,
844925 type InferencePipelineUpdateResponse as InferencePipelineUpdateResponse ,
926+ type InferencePipelineRetrieveUsersResponse as InferencePipelineRetrieveUsersResponse ,
845927 type InferencePipelineRetrieveParams as InferencePipelineRetrieveParams ,
846928 type InferencePipelineUpdateParams as InferencePipelineUpdateParams ,
929+ type InferencePipelineRetrieveUsersParams as InferencePipelineRetrieveUsersParams ,
847930 } ;
848931
849932 export {
0 commit comments