// ReSharper disable ClassNeverInstantiated.Global namespace AIStudio.Provider.OpenAI; /// /// What an OpenAI-compatible provider reports a chat completion cost. /// /// /// Every number is optional because this is somebody else's JSON: the block arrives only when the /// request asked for it, and the providers which follow the shape loosely leave fields out. Reading /// it is one thing, believing it another -- TokenUsage.OfReported decides that. /// public sealed record ChatCompletionUsage { /// /// What everything sent to the model cost. /// public int? PromptTokens { get; init; } /// /// What the model wrote in answer. /// public int? CompletionTokens { get; init; } /// /// What the provider says both of them add up to. Read but not relied upon: it is the sum of /// the other two wherever a provider fills all three, and this way a provider which sends only /// this one is not a reason to throw the other numbers away. /// public int? TotalTokens { get; init; } }