> ## Documentation Index
> Fetch the complete documentation index at: https://prod-mint.classiq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Execution Budget

Enrolled users can run quantum programs on multiple backends without needing to provide their own credentials, by using `run_via_classiq`.

When a job is submitted using `run_via_classiq`, it will only proceed if the estimated cost is within the remaining budget allocated for the chosen provider.

Additionally, we offer methods to monitor usage and set limits, helping you control and optimize your spending.

For example, to set up execution using `run_via_classiq` on the Amazon Braket SV1 simulator:

[comment]: DO_NOT_TEST

```python theme={null}
from classiq import *


@qfunc
def main(x: Output[QBit]):
    allocate(x)


qprog = synthesize(main)

exec_pref = ExecutionPreferences(
    backend_preferences=AwsBackendPreferences(
        backend_name="SV1",
        run_via_classiq=True,
    )
)

# Assuming you have a pre-defined quantum program "qprog"

with ExecutionSession(qprog, execution_preferences=exec_pref) as es:
    result = es.sample()
```

## Checking the Remaining Budget

To view your remaining execution budget, run the following command:

[comment]: DO_NOT_TEST

```python theme={null}
from classiq import *

budget = get_budget()
print(budget)
```

A table will be displayed:

<img src="https://mintcdn.com/classiq/xLAFEkBDpT-na34E/user-guide/resources/budget.png?fit=max&auto=format&n=xLAFEkBDpT-na34E&q=85&s=22d8fed389772695b75e5d8f7a6d08c1" alt="Budget" width="905" height="266" data-path="user-guide/resources/budget.png" />

## Setting a Custom Budget Limit

You can also define a custom spending limit to stay within a desired budget (lower than your total budget). For example:

[comment]: DO_NOT_TEST

```python theme={null}
from classiq import *

budget = set_budget_limit(
    provider=ProviderVendor.AMAZON_BRAKET,
    limit=90,  # Set a custom limit below the provider's remaining budget
)
```

To verify the updated limit, simply run `print(budget)` again. The output will now reflect the new budget cap:

<img src="https://mintcdn.com/classiq/xLAFEkBDpT-na34E/user-guide/resources/budget_with_limit.png?fit=max&auto=format&n=xLAFEkBDpT-na34E&q=85&s=bce63c6b99cbc1979c5fa64c294c48d0" alt="Budget_limited" width="906" height="245" data-path="user-guide/resources/budget_with_limit.png" />

To clear user-defined budget limits, run `clear_budget_limit("Amazon Braket")`.
