CompletionUsage

data class CompletionUsage(val promptTokens: Int, val completionTokens: Int, val totalTokens: Int)

Holds how many tokens that were used by your API request. Use these tokens to calculate how much money you have spent on each request.

By monitoring your token usage, you can limit the amount of money charged for your requests. You can check the cost of the model you are using in OpenAI's billing page.

Parameters

promptTokens

How many tokens the input used.

completionTokens

How many tokens the output used.

totalTokens

How many tokens in total.

Constructors

Link copied to clipboard
constructor(promptTokens: Int, completionTokens: Int, totalTokens: Int)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard