---
title: "oz0 usage export"
description: "Exports a tenant's metered usage recorded from --from up to --to."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0/usage/export"
---
# oz0 usage export

> Exports a tenant's metered usage recorded from --from up to --to.

For: Operators and developers looking up a command.

Exports a tenant's metered usage recorded from --from up to --to. These are UTC days by the database's clock when management took each row; --to is the day after the last.

The stable schema has one row per model call or plugin report and unit kind (input, output, cache read and cache write tokens, web searches, compute seconds, a plugin's units), and per day of outside spend. Each row includes:

- A row ID that is the same in every export, and the schema version.
- The provider, model and region; the tenant, its team and tags; the job and agent.
- The quantity, list cost, effective cost and currency.
- The source, the pool member that served a call and the plugin whose tool asked for it.

Exporting a period that has passed again gives the same rows. Rows written before the export's attributes were recorded leave region, team, tags and list cost empty rather than guess them. Under works-council mode a team shows only where its figures may be shown; no column names a person. The tenant's admins may; --all-tenants needs a cluster admin. Each export is audited.

## Usage

```bash
oz0 usage export [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --all-tenants
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      every tenant (cluster admins)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --format
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        csv
      </code>
    </td>
    
    <td>
      csv or jsonl
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --from
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the first UTC day, such as 2026-10-01
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --out
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      write to this file instead of standard output (created with mode 0600)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --tenant
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        default
      </code>
    </td>
    
    <td>
      tenant
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --timeout
      </code>
    </td>
    
    <td>
      duration
    </td>
    
    <td>
      <code>
        1h0m0s
      </code>
    </td>
    
    <td>
      give up when the whole export takes longer than this (0 for no limit)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --to
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      
    </td>
    
    <td>
      the day after the last, such as 2026-11-01 (at most 400 days after --from)
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --context
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        $OZ0_CONTEXT or &lt;config dir>/orchestrator-zero/context.json
      </code>
    </td>
    
    <td>
      CLI context file written by server init
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0` commands](https://docs.oz0.ai/reference/cli/oz0) and the [global flags](https://docs.oz0.ai/reference/cli/oz0#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
