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

# End Session • Rust AI Agent SDK

> end_session: End a thinking session. # Arguments * `session_idx` - Index of the session to end * `tokens_used` - Actual tokens used * `time_seconds` - Actual time...

# end\_session

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

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

End a thinking session. # Arguments \* `session_idx` - Index of the session to end \* `tokens_used` - Actual tokens used \* `time_seconds` - Actual time taken

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def end_session(&mut self, session_idx: usize, tokens_used: usize, time_seconds: f64) -> ()
```

## Parameters

<ParamField query="session_idx" type="usize" required={true}>
  No description available.
</ParamField>

<ParamField query="tokens_used" type="usize" required={true}>
  No description available.
</ParamField>

<ParamField query="time_seconds" type="f64" required={true}>
  No description available.
</ParamField>

### Returns

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Sessions" icon="clock" href="/docs/rust/sessions" />

  <Card title="Rust Memory" icon="database" href="/docs/rust/memory" />
</CardGroup>
