Skip to content

BatchUsage

Namespace: Vercel.AI.Operations

public sealed class BatchUsage

Usage returned to batch callers.

Inheritance: object

View source

BatchUsage(int?, int?, int?, int?, int?, int?, int?, int?, JsonElement?)

Section titled “BatchUsage(int?, int?, int?, int?, int?, int?, int?, int?, JsonElement?)”
public BatchUsage(int? inputTokens, int? noCacheTokens, int? cacheReadTokens, int? cacheWriteTokens, int? outputTokens, int? textTokens, int? reasoningTokens, int? totalTokens, JsonElement? raw)

Creates caller usage.

Parameters

Name Type Description
inputTokens int?
noCacheTokens int?
cacheReadTokens int?
cacheWriteTokens int?
outputTokens int?
textTokens int?
reasoningTokens int?
totalTokens int?
raw JsonElement?

View source

public int? CacheReadTokens { get; }

Cache-read tokens.

Value: int?

View source

public int? CacheWriteTokens { get; }

Cache-write tokens.

Value: int?

View source

public int? InputTokens { get; }

Input tokens.

Value: int?

View source

public int? NoCacheTokens { get; }

Uncached input tokens.

Value: int?

View source

public int? OutputTokens { get; }

Output tokens.

Value: int?

View source

public JsonElement? Raw { get; }

Raw usage.

Value: JsonElement?

View source

public int? ReasoningTokens { get; }

Reasoning tokens.

Value: int?

View source

public int? TextTokens { get; }

Text tokens.

Value: int?

View source

public int? TotalTokens { get; }

Input plus output when both totals are known.

Value: int?

View source

public static BatchUsage FromModel(BatchModelUsage usage)

Maps provider usage the way asLanguageModelUsage does.

Parameters

Name Type Description
usage BatchModelUsage

Returns: BatchUsage

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product