> ## Documentation Index
> Fetch the complete documentation index at: https://otoyinc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Job Types

## Understanding Job Types

Jobs can be either [**BATCH**](/glossary) or **[PERSISTENT](/glossary).**

**BATCH Job:**

* **Lifecycle:** Runs until completion or timeout; automatically terminates.
* **Configuration:** Requires a valid `max_timeout_run_ms` value.
* **Interaction:** Non-interactive; operates solely on initial input arguments.
* **Billing:** Charged only for actual execution time.
* **Best For:** Rendering, data processing, or any finite task.

**PERSISTENT Job:**

* **Lifecycle:** Runs indefinitely until explicitly stopped by the user.
* **Configuration:** Requires `max_timeout_run_ms` to be set to `null`.
* **Interaction:** High; supports query-responsive servers and live developer/artist tools.
* **Billing:** Charged continuously on an hourly basis.
* **Best For:** SSH access, development environments, or long-running services.

Both job types support the `max_timeout_start_ms`. This property defines how long the system will wait for the job to initialize before declaring a failure. If a job does not successfully start within this window, it will fail automatically.

When setting the `max_timeout_start_ms`value, you **must account for image download time**. Large container images or custom environment setups require a higher `max_timeout_start_ms` to prevent the system from timing out and killing the job before it even begins running.

<Tabs>
  <Tab title="BATCH Jobs">
    [BATCH](/glossary) jobs run until completion or timeout. They are strictly non-interactive, "set-and-forget" workflows. They accept initial input parameters at launch, run independently in the background to process data or render assets, and automatically terminate upon completing the task or hitting a predefined time limit

    | Property             | Value                                          |
    | :------------------- | :--------------------------------------------- |
    | `task`               | `BATCH`                                        |
    | `max_timeout_run_ms` | **Required** — maximum runtime in milliseconds |
    | Billing              | Charged for actual execution time              |
    | Use cases            | Rendering, data processing, inference tasks    |

    **The job automatically stops when:**

    * Your container exits
    * The timeout is reached

    ```json theme={null}
    {
      "task": "BATCH",
      "max_timeout_run_ms": 3600000,
      "title": "Render Scene"
    }
    ```
  </Tab>

  <Tab title="PERSISTENT Jobs">
    [PERSISTENT](/glossary) jobs run indefinitely until you stop them. It is best suited for long-running servers that handle incoming queries, as well as interactive applications where developers and artists require real-time  responsiveness.

    | Property             | Value                                               |
    | :------------------- | :-------------------------------------------------- |
    | `task`               | `PERSISTENT`                                        |
    | `max_timeout_run_ms` | **Must be null**                                    |
    | Billing              | Charged hourly until stopped                        |
    | Use cases            | SSH access, dev environments, long-running services |

    <Warning>
      **Remember to stop PERSISTENT jobs** when finished. They continue billing until explicitly cancelled.
    </Warning>

    ```json theme={null}
    {
      "task": "PERSISTENT",
      "max_timeout_run_ms": null,
      "title": "SSH Development Environment"
    }
    ```
  </Tab>
</Tabs>
