UsageMetadata
public struct UsageMetadata
extension GenerateContentResponse.UsageMetadata: Decodable
Token usage metadata for processing the generate content request.
-
The number of tokens in the request prompt.
Declaration
Swift
public let promptTokenCount: Int
-
The total number of tokens across the generated response candidates.
Declaration
Swift
public let candidatesTokenCount: Int
-
The total number of tokens in both the request and response.
Declaration
Swift
public let totalTokenCount: Int
-
Declaration
Swift
public init(from decoder: any Decoder) throws