---
title: "StopServerToolsWhenMaxTokensUsed"
---

Stop once cumulative token usage across the loop exceeds this threshold.


## Fields

| Field                                                                                                    | Type                                                                                                     | Required                                                                                                 | Description                                                                                              |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `max_tokens`                                                                                             | *int*                                                                                                    | :heavy_check_mark:                                                                                       | N/A                                                                                                      |
| `type`                                                                                                   | [components.StopServerToolsWhenMaxTokensUsedType](../components/stopservertoolswhenmaxtokensusedtype.mdx) | :heavy_check_mark:                                                                                       | N/A                                                                                                      |