Skip to contents

This function extracts the usage data from the parsed HTTP response of an API call to the OpenAI chat completions endpoint.

Usage

usage(response)

Arguments

response

a list object representing the HTTP response

Value

a data frame with the usage statistics of the API call (how many tokens used)