IntelligenceX

API Reference

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 requiredposition: 0
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 optionalposition: 0
Cancellation token.
public Task<ChatGptDailyTokenUsageBreakdown> GetDailyTokenUsageBreakdownAsync(CancellationToken cancellationToken = null) #
Returns: Task<ChatGptDailyTokenUsageBreakdown>

Retrieves daily token usage breakdown by product surface.

Parameters

cancellationToken System.Threading.CancellationToken = null optionalposition: 0
GetReportAsync 2 overloads
public Task<ChatGptUsageReport> GetReportAsync(Boolean includeEvents, CancellationToken cancellationToken = null) #
Returns: Task<ChatGptUsageReport>

Retrieves a combined usage report.

Parameters

includeEvents System.Boolean requiredposition: 0
Whether to include credit usage events.
cancellationToken System.Threading.CancellationToken = null optionalposition: 1
Cancellation token.
public async Task<ChatGptUsageReport> GetReportAsync(Boolean includeEvents, Boolean includeDailyBreakdown = false, CancellationToken cancellationToken = null) #
Returns: Task<ChatGptUsageReport>

Retrieves a combined usage report.

Parameters

includeEvents System.Boolean requiredposition: 0
Whether to include credit usage events.
includeDailyBreakdown System.Boolean = false optionalposition: 1
Whether to include daily token usage breakdown.
cancellationToken System.Threading.CancellationToken = null optionalposition: 2
Cancellation token.
public Task<ChatGptUsageSnapshot> GetUsageSnapshotAsync(CancellationToken cancellationToken = null) #
Returns: Task<ChatGptUsageSnapshot>

Retrieves the current usage snapshot.

Parameters

cancellationToken System.Threading.CancellationToken = null optionalposition: 0
Cancellation token.