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

# Modal

> Connect Modal workspaces to track organization-wide compute spend and monthly billing

Connect Modal to see how much your organization spends on Modal compute, including training and
non-training workloads. Weave keeps granular metered usage separate from Modal's monthly billed
total, so credits, reservations, and adjustments remain visible rather than being allocated to the
wrong app or day.

## Prerequisites

* A Modal **Team or Enterprise** workspace. Modal's programmatic billing reports are not available on other plans.
* Permission in Modal to create a workspace token.
* Permission in Weave to manage data connections.

## Setup

<Steps>
  <Step title="Create a Modal workspace token">
    In your Modal workspace settings, [create a workspace token](https://modal.com/docs/reference/cli/token). Keep the token ID and token secret
    available while you complete the next step. Weave needs both values and does not support a
    billing-only token scope because Modal does not publish one.
  </Step>

  <Step title="Connect the workspace in Weave">
    In Weave, open **Data** → **Compute** → **Modal compute**, then enter the token ID and secret.
    You can add an optional label such as “Model training”. Weave verifies workspace identity and
    access to both daily reports and monthly summaries before saving the connection.
  </Step>

  <Step title="Wait for billing history">
    Weave queues the previous three months immediately. The normal collector runs every three hours
    and refreshes recent complete UTC days. Modal can report usage late, so recent totals can change.
  </Step>
</Steps>

You can connect more than one Modal workspace. Connecting another token for a workspace already in
Weave does not create a second spend source; use **Rotate** on the existing workspace instead.

## What's tracked

* Exact metered cost by UTC day
* Modal workspace
* App or billed object and its description
* Environment name
* Resource-cost breakdowns returned by Modal
* Modal tag key/value pairs
* Monthly metered and billed totals, including adjustment categories returned by Modal

Modal's report does not provide a reliable user, engineer, run, function, GPU-hour, or training-job
identity. Weave therefore reports this spend at the organization level and does not allocate it to
people or teams.

## Isolating training workloads

Weave includes all Modal spend by default: training, inference, storage, and other billed objects.
Use app, environment, or Modal tags to isolate training when your workspace already carries that
metadata. For example, add a Modal tag such as `workload=training` to training apps and select that
tag in the Modal compute card.

Weave does not guess whether a workload is training. A filtered metered view narrows the daily
report, but the monthly billed total remains workspace-wide and is labeled that way.

## Metered versus billed cost

These values answer different questions:

* **Metered cost** is granular usage before workspace-level credits, reservations, and other billing adjustments. It powers the time series and app, environment, resource, and tag breakdowns.
* **Billed cost** is Modal's workspace-wide monthly summary after its adjustments. It appears only in the monthly billing table.

Weave never adds these values together. The current month is provisional. Older rows are labeled
with the time Weave fetched Modal's reported total; they are not presented as payment or invoice
status.

## Coverage and freshness

Only complete UTC daily buckets are collected. The report shows the latest included date, successful
coverage, and any gaps. A successfully fetched day with no rows is \$0. A day that was never fetched
is unknown and is not zero-filled. If a refresh fails, Weave keeps the last successful values and
shows the workspace as stale or requiring action.

Disconnecting stops future collection and erases the stored token pair. Historical spend remains in
the report. Disconnecting in Weave does not revoke the token in Modal; revoke it separately in Modal
if needed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.