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

# With Tokens • Rust AI Agent SDK

> with_tokens: Set token usage

# with\_tokens

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

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

Set token usage

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def with_tokens(mut self, tokens: u32) -> Self
```

## Parameters

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

### Returns

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Token Management" icon="coins" href="/docs/rust/token-management" />

  <Card title="Rust Budget" icon="wallet" href="/docs/rust/budget" />
</CardGroup>
