> For the complete documentation index, see [llms.txt](https://docs.revenium.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.revenium.io/optimize-performance/export-cost-and-usage-data.md).

# Export Cost & Usage Data (FOCUS)

Revenium exports every AI transaction it records in the **FOCUS** format, the FinOps Open Cost and Usage Specification, so spreadsheets, FinOps platforms and cloud cost tools can load your AI spend in a standard format. Finance works in those tools, and until AI spend reaches them in a format they expect, it stays invisible to the people who allocate budgets and reconcile invoices.

There are two ways to get FOCUS data out, both in **Data > Logs** under the **Exports** tab: a one-off download for ad-hoc analysis, and a scheduled delivery straight to your own Amazon S3 bucket for pipelines that run without anyone in the loop. Table exports to CSV and analytics over the API are covered at the end of this page.

### <i class="fa-download">:download:</i> Download a FOCUS file on demand

The **FOCUS Export** card produces a file in your browser from whatever range and shape you choose. Three controls decide what comes out:

* **Date Range** - the window of transactions to include.
* **Rollup By** - the level of aggregation. Leave it at **Transaction-level** for one row per AI call, or roll the data up by **Agent**, **Squad**, or **Organization** to get one summarized row per dimension with cost and tokens already totaled.
* **Export Stream** - which shape of data to produce (see below).

Click **Download FOCUS CSV** and the file downloads directly. Very large ranges are capped per download; when a range exceeds the limit the export completes with a partial set and the confirmation tells you to narrow the date range to capture everything. Rows that are missing the timestamps FOCUS requires are skipped and counted in the same confirmation, so a short export is always explained rather than silent.

#### Export streams

The **Export Stream** setting tailors the output to where the data is going:

| Stream           | What it produces                                                     | Built for                                           |
| ---------------- | -------------------------------------------------------------------- | --------------------------------------------------- |
| **Unified**      | The full FOCUS v1.0 record set, every column                         | General FinOps ingestion                            |
| **Usage Only**   | Date, product, customer, usage quantity and unit - no dollar amounts | Usage-metering tools such as Cloudability           |
| **Revenue Only** | Date, service, customer, revenue amount                              | Revenue-tracking tools such as Apptio               |
| **Split**        | Both the Usage Only and Revenue Only files in one action             | Pipelines that consume usage and revenue separately |

### <i class="fa-cloud-arrow-up">:cloud-arrow-up:</i> Schedule exports to Amazon S3

The **Scheduled Exports** card removes the manual step entirely: Revenium writes FOCUS files to an S3 bucket you own, on a schedule, so a downstream pipeline can pick them up without anyone triggering a download. Each destination you add appears in the list with its bucket path, schedule, region, format, and the time and status of its last run.

Choose **Add Export Destination** and provide:

| Field                 | Required | Notes                                                                                  |
| --------------------- | -------- | -------------------------------------------------------------------------------------- |
| **Destination**       | Yes      | Amazon S3                                                                              |
| **Export Name**       | Yes      | A label for the destination, e.g. *Production FinOps Export*                           |
| **Bucket Name**       | Yes      | The S3 bucket name, without the `s3://` prefix                                         |
| **Path Prefix**       | No       | An optional folder path within the bucket, e.g. `revenium/focus/`                      |
| **Region**            | Yes      | The AWS region the bucket lives in                                                     |
| **Access Key ID**     | Yes      | An AWS access key ID (begins with `AKIA` or `ASIA`)                                    |
| **Secret Access Key** | Yes\*    | The matching secret. The IAM user needs `s3:PutObject` permission on the target bucket |
| **Schedule**          | Yes      | **Hourly**, **Daily**, or **Weekly**                                                   |
| **File Format**       | Yes      | **CSV** or **Parquet**                                                                 |
| **Rollup By**         | No       | Same aggregation choices as the on-demand download                                     |
| **Export Stream**     | No       | Same stream choices as the on-demand download                                          |

When you save a destination with credentials, Revenium tests the connection to the bucket before storing it, so a bad key or a missing permission surfaces immediately rather than at the first scheduled run.

{% hint style="info" %}
Credentials are write-only. When you edit an existing destination, the Secret Access Key field stays blank - leave it blank to keep the stored credential, or enter a new value to replace it.
{% endhint %}

Each saved destination gives you three actions:

* **Export Now** - trigger a delivery immediately instead of waiting for the schedule, useful for verifying the pipeline end to end.
* **Edit** - change any setting, including rotating the credentials.
* **Delete** - remove the destination and stop all scheduled exports to it.

### <i class="fa-table">:table:</i> What's in a FOCUS file

The **Unified** stream follows the FOCUS v1.0 specification: standard columns describe the charge (`BilledCost`, `EffectiveCost`, `ListCost`, `ListUnitPrice`, `BillingCurrency`), the period (`ChargePeriodStart`, `ChargePeriodEnd`, `BillingPeriodStart`, `BillingPeriodEnd`), and the provenance of each line (`Provider`, `PublisherName`, `ServiceCategory`, `ServiceName`, `SkuId`, `ResourceId`, `ResourceName`). AI usage is measured in the standard pricing fields - `PricingQuantity` carries the token count and `PricingUnit` is `Tokens`.

On top of the specification, Revenium adds AI-specific extension columns, each prefixed with `x_` as FOCUS requires for vendor extensions:

| Column                    | Meaning                                        |
| ------------------------- | ---------------------------------------------- |
| `x_ModelName`             | The model that produced the completion         |
| `x_AiInputTokens`         | Input (prompt) tokens                          |
| `x_AiOutputTokens`        | Output (completion) tokens                     |
| `x_AiCacheCreationTokens` | Tokens written to the provider's prompt cache  |
| `x_AiCacheReadTokens`     | Tokens served from the provider's prompt cache |

Attribution metadata - product, agent, squad, and region - travels in the standard FOCUS `Tags` column as structured data, so allocation survives the export. Amounts use your account's default billing currency. When you roll the export up by a dimension, each row aggregates the cost and tokens for that dimension over the period rather than listing individual calls, and the rows are ordered by cost so the largest contributors sit at the top.

### <i class="fa-file-csv">:file-csv:</i> Export a table as CSV

The tables you work in day to day also export to CSV, so the rows you are looking at can go straight into a spreadsheet. Under AI Assistants, the [By Employee](/track-and-control-costs/analyze-ai-tooling-spend.md#by-employee), Departments, [Tickets](/track-and-control-costs/analyze-ai-tooling-spend/tickets.md) and [PR Health](/track-and-control-costs/analyze-ai-tooling-spend/pr-health.md) tables have an **Export CSV** button, and Skills has a **Download** menu with CSV files. The workspace, API key and model views under Providers and the cost, performance and efficiency views under Traces export the same way. The file follows your current filters and grouping.

Long lists such as By Employee, Skills and Tickets export more than the rows loaded on screen. When a list holds more rows than one export can carry, the export says so rather than stopping silently: the file itself states that the export was capped and how many rows it holds, and Tickets also tells you on screen how many rows were exported out of how many. Narrow the filters or the date range to export the rest.

### <i class="fa-code">:code:</i> Pull analytics over the API

Cost and usage analytics are also available through Revenium's REST API, for teams that load them into their own reports, notebooks or data tools on a schedule. See the [Analytics API](https://revenium.readme.io/reference/get_cost_metric_by_agents) reference.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.revenium.io/optimize-performance/export-cost-and-usage-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
