# Headless Usage

This section covers running AugeLab Studio **without the desktop UI** via the public API class `studio.StudioScenario`.

Headless API gives huge performance boosts compared to the desktop UI, especially when running on servers without GPUs. It also allows easy integration into other Python apps/services. { % endhint %}

***

## Flows to Code

Your visiually programmed scenarios (`.pmod` files) can be run headlessly via Python code:

<figure><img src="/files/BkVglmr2mW48jSQVmiR5" alt="Flows to Code" width="400"><figcaption></figcaption></figure>

Flows to Code

```python
from studio import StudioScenario
scenario = StudioScenario(verification_code="YOUR_CODE_HERE")
scenario.load_scenario("your_scenario.pmod")

while True:
    try:
        scenario.run()
    except KeyboardInterrupt:
        break
scenario.cleanup()
```

Running the saved .pmod files with python scripts gives you several benefits:

* Implementing your own dashboards and UIs
* Integrating scenarios into larger applications
* Hooking into logging system in AugeLab runtime
* Running scenarios in Docker containers (CPU/CUDA)
* Batch processing multiple inputs
* Automating runs and scheduling

and many more!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/key-features/headless.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
