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

# Modal

> Learn how to integrate Vantage with Modal to track serverless compute costs.

Vantage integrates with your Modal account using a token ID and token secret to ingest cost data through Modal's [billing report](https://modal.com/docs/reference/cli/billing). Vantage retrieves workspace billing data broken down by Modal object (for example, Apps), environment, compute resource (such as CPU, Memory, or a GPU type), and any tags associated with those objects.

## Modal Permissions

Vantage uses your Modal token ID and token secret to read workspace billing data only. Vantage cannot deploy functions, trigger executions, or perform any actions that incur costs in your Modal account.

It's best practice to create a dedicated Modal token for Vantage and rotate it according to your organization's security policy.

## Connect Your Modal Account

### Prerequisites

* You must have a Vantage **Organization Owner** or **Integration Owner** role to add or remove this integration. See the [Role-Based Access Control](/rbac) documentation for details.
* You need access to a Modal workspace that can create API tokens.
* [Create a free Vantage account](https://console.vantage.sh/signup), then follow the steps below to integrate Modal costs.

### Create the Connection

<Steps>
  <Step>
    Navigate to your [Modal token settings](https://modal.com/settings/tokens).
  </Step>

  <Step>
    Create a new token, then copy the generated **Token ID** and **Token Secret**.

    <Warning>
      Modal only shows the token secret once. Save it securely before closing the dialog.
    </Warning>
  </Step>

  <Step>
    From the top navigation in Vantage, click **Settings**.
  </Step>

  <Step>
    On the left navigation, select **Integrations** > **Modal**.
  </Step>

  <Step>
    The Modal integrations page is displayed. Ensure you are on the **Connect** tab.
  </Step>

  <Step>
    Click **Add Token** and complete the integration form:

    * **Token ID**: Paste the Modal token ID.
    * **Token Secret**: Paste the Modal token secret.
    * **Description**: Enter a label to identify this Modal workspace in Vantage. This value is used as the **Billing Account** dimension in Cost Report filters.
  </Step>

  <Step>
    Click **Connect Account**.
  </Step>
</Steps>

After clicking **Connect Account**, you will see the status of your integration change to **Importing** within the Vantage console. This status indicates that Vantage is actively importing your Modal cost data. Vantage backfills up to six months of historical cost data upon initial connection. Ongoing retention follows your Vantage data retention settings. See the [Integration Status](/vantage_account#integration-status) documentation for details on integration statuses. You can connect multiple Modal workspaces, each with its own token, as separate integrations in Vantage.

<Info>
  As soon as costs are processed, they will be available on your **All Resources** Cost Report. If you decide to remove your Modal integration from Vantage, all costs associated with that Modal token will be removed from the Vantage console.
</Info>

### Next Steps - Manage Workspace Access

Once the import is complete and the integration status changes to **Stable**, you can select which workspaces this integration is associated with. See the [Workspaces](/workspaces#manage-workspace-provider-integrations) documentation for information.

## Data Refresh

See the [provider data refresh documentation](/provider_data_refresh) for information on when data for each provider refreshes in Vantage. Modal data refreshes once daily.

## Modal Reporting Dimensions

On Modal [Cost Reports](/cost_reports), you can filter and group across several dimensions:

* Billing Account (the description you enter when connecting the integration; use **Billing Account** for filtering and grouping)
* Account (the Modal environment name, such as `main`)
* Service (for example, `App`)
* Category (the compute resource that generated the cost, such as `CPU`, `Memory`, or a GPU type, like `H100`, `B200`, etc.)
* Resource (the Modal App; shown as the App name while the App is active, or the Modal object ID such as `ap-...` once the App is no longer active)
* Charge Type (Usage)

In addition, Modal costs include the following tags, available for filtering and grouping alongside any [Virtual Tags](/tagging) you create:

| Tag                 | Description                                                                                                                         |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `modal:description` | Created by Vantage from the Modal object description in the billing report (for example, the App name)                              |
| `<tag_key>`         | Any tags you have applied to the Modal object in your workspace, passed through with their original key names (for example, `team`) |

## Active Resources

Vantage syncs your Modal Apps as [Active Resources](/active_resources), so you can view currently active Apps and their costs in Resource Reports. Each Modal App resource includes metadata such as its name, environment, and status, along with the tags applied to it in Modal. Active resources are synced at least once every 24 hours.

<Note>
  In Cost Reports, the **Resource** for a Modal App is displayed as the App's name while the App is active. Apps that are no longer active aren't synced as Active Resources, so their costs show the raw Modal object ID (such as `ap-...`) instead.
</Note>
