IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python class

Usage

Usage

class max.pipelines.request.Usage(*, input_tokens, output_tokens, total_tokens, input_tokens_details=None, output_tokens_details=None)

source

Bases: BaseModel

Token usage statistics.

Image generation responses report generated pixels: output_tokens is the total pixel count of the generated images, and input_tokens is 0 (prompt text is not counted).

Parameters:

input_tokens

input_tokens: int

source

input_tokens_details

input_tokens_details: InputTokensDetails | None

source

model_config

model_config: ClassVar[ConfigDict] = {'frozen': True}

source

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

output_tokens

output_tokens: int

source

output_tokens_details

output_tokens_details: OutputTokensDetails | None

source

total_tokens

total_tokens: int

source