> 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)

Your AI cost data doesn't stay in Revenium. Finance runs on spreadsheets, FinOps platforms, and cloud cost tools that expect a standard shape - and until AI spend lands there in the same format as the rest of the bill, it stays invisible to the people who allocate budgets and reconcile invoices. Revenium exports every AI transaction in the **FOCUS** format - the FinOps Open Cost and Usage Specification - so AI usage sits alongside your cloud spend without a bespoke integration in between.

There are two ways to get the 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.

### <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.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
