IntelligenceX
Class

ChatGptUsageService

Namespace IntelligenceX.OpenAI.Usage
Assembly IntelligenceX
Implements
IDisposable
Modifiers sealed

Retrieves ChatGPT usage, rate limits, and credit usage events.

Inheritance

  • Object
  • ChatGptUsageService

Constructors

public ChatGptUsageService(OpenAINativeOptions options) #

Initializes a new usage service using native auth options.

Parameters

options IntelligenceX.OpenAI.Native.OpenAINativeOptions
Native options used for authentication and endpoints.

Methods

public virtual Void Dispose() #
Returns: Void

Disposes the underlying usage client.

public Task<IReadOnlyList<ChatGptCreditUsageEvent>> GetCreditUsageEventsAsync(CancellationToken cancellationToken = null) #
Returns: Task<IReadOnlyList<ChatGptCreditUsageEvent>>

Retrieves recent credit usage events.

Parameters

cancellationToken System.Threading.CancellationToken = null
Cancellation token.
public async Task<ChatGptUsageReport> GetReportAsync(Boolean includeEvents, CancellationToken cancellationToken = null) #
Returns: Task<ChatGptUsageReport>

Retrieves a combined usage report.

Parameters

includeEvents System.Boolean
Whether to include credit usage events.
cancellationToken System.Threading.CancellationToken = null
Cancellation token.
public Task<ChatGptUsageSnapshot> GetUsageSnapshotAsync(CancellationToken cancellationToken = null) #
Returns: Task<ChatGptUsageSnapshot>

Retrieves the current usage snapshot.

Parameters

cancellationToken System.Threading.CancellationToken = null
Cancellation token.