> ## 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.

# Thinking Usage • Rust AI Agent SDK

> ThinkingUsage: Usage statistics for a single thinking session.

# ThinkingUsage

> Defined in the [**thinking**](../modules/thinking) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Usage statistics for a single thinking session.

## Fields

| Name            | Type                    | Description                             |
| --------------- | ----------------------- | --------------------------------------- |
| `tokens_used`   | `usize`                 | Tokens used in this session             |
| `time_seconds`  | `f64`                   | Time taken in seconds                   |
| `budget_tokens` | `usize`                 | Token budget for this session           |
| `budget_time`   | `Option&lt;f64&gt;`     | Time budget for this session (optional) |
| `complexity`    | `f64`                   | Task complexity (0.0 to 1.0)            |
| `started_at`    | `Option&lt;Instant&gt;` | When the session started                |
| `ended_at`      | `Option&lt;Instant&gt;` | When the session ended                  |

## Methods

### `tokens_remaining`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn tokens_remaining(&self) -> usize
```

Get remaining token budget.

### `time_remaining`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn time_remaining(&self) -> Option<f64>
```

Get remaining time budget.

### `token_utilization`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn token_utilization(&self) -> f64
```

Get token utilization percentage.

### `is_over_budget`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_over_budget(&self) -> bool
```

Check if over token budget.

### `is_over_time`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn is_over_time(&self) -> bool
```

Check if over time budget.

### `to_map`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn to_map(&self) -> HashMap<String, serde_json::Value>
```

Convert to HashMap for serialization.

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/thinking/mod.rs#L301">
  `praisonai/src/thinking/mod.rs` at line 301
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Thinking" icon="lightbulb" href="/docs/rust/thinking" />

  <Card title="Rust Reasoning" icon="brain" href="/docs/rust/reasoning" />
</CardGroup>
