# Crew AI Token Usage

**URL:** <https://community.crewai.com/t/crew-ai-token-usage/5128>\
**Category:** General\
**Created:** [April 3, 2025, 10:55am UTC](https://community.crewai.com/t/crew-ai-token-usage/5128 "2025-04-03T10:55:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manjunath\_Srinivas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/manjunath_srinivas/32/3106_2.png) [@Manjunath\_Srinivas](https://community.crewai.com/u/Manjunath_Srinivas)\
**Post date:** [April 3, 2025, 10:55am UTC](https://community.crewai.com/t/crew-ai-token-usage/5128/1 "2025-04-03T10:55:09Z")

</div>

Hi team.

I have created a sample project with using this command

crewai create crew \<project\_name\>

This is how the run function looks like in main.py

```
def run():
    """
    Run the crew.
    """
    inputs = {
        'topic': 'AI LLMs',
        'current_year': str(datetime.now().year)
    }
    
    try:
        Manju().crew().kickoff(inputs=inputs)
    except Exception as e:
        raise Exception(f"An error occurred while running the crew: {e}")

```

How do I determine the total tokens utilised during execution?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![maxmoura](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/maxmoura/32/4206_2.png) [@maxmoura](https://community.crewai.com/u/maxmoura)\
**Post date:** [April 3, 2025, 11:46am UTC](https://community.crewai.com/t/crew-ai-token-usage/5128/2 "2025-04-03T11:46:41Z")

</div>

```python
def run():
    """
    Run the crew.
    """
    inputs = {
        'topic': 'AI LLMs',
        'current_year': str(datetime.now().year)
    }
    
    try:
        result = Manju().crew().kickoff(inputs=inputs)
    except Exception as e:
        raise Exception(f"An error occurred while running the crew: {e}")
    
    print(f"\nCrew Output:\n{result.raw}\n")
    print(f"\nToken Usage:\n{result.token_usage}\n")

```
