> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# total • AI Agent SDK

> total: Total tokens across all segments.

# total

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**ContextLedger**](../classes/ContextLedger) class in the [**models**](../modules/models) module.

Total tokens across all segments.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def total() -> int
```

### Returns

<ResponseField name="Returns" type="int">
  The result of the operation.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/context/models.py#L47">
  `praisonaiagents/context/models.py` at line 47
</Card>
