> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://openrouter.ai/docs/llms.txt.
> For full documentation content, see https://openrouter.ai/docs/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://openrouter.ai/docs/_mcp/server.

# TaskBudget - Python SDK

The Python SDK and docs are currently in beta.
Report issues on [GitHub](https://github.com/OpenRouterTeam/python-sdk/issues).

Task budget for an agentic turn. The model sees a countdown of remaining tokens and uses it to prioritize work and wind down gracefully. Advisory — does not enforce a hard cap.

## Fields

| Field       | Type                                                                 | Required             | Description |
| ----------- | -------------------------------------------------------------------- | -------------------- | ----------- |
| `remaining` | *OptionalNullable\[int]*                                             | :heavy\_minus\_sign: | N/A         |
| `total`     | *int*                                                                | :heavy\_check\_mark: | N/A         |
| `type`      | [components.TypeTokens](/docs/sdks/components/components/typetokens) | :heavy\_check\_mark: | N/A         |