struct

OpenAI::Usage

Inherits JSON::Serializable / Struct / Value / Object

Usage statistics for the total token usage per completion request

Constructors

new(prompt_tokens : Int32, completion_tokens : Int32, total_tokens : Int32)
Source
new(pull : JSON::PullParser)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

completion_tokens

Number of tokens in the generated completion.

Source
prompt_tokens

Number of tokens in the prompt.

Source
total_tokens

Total number of tokens used in the request (prompt + completion).

Source