---
title: CostReport
description: Per-phase attribution for one sandbox, measured or projected.
---

Per-phase attribution for one sandbox, measured or projected.

## Accessors

### complete

#### Get Signature

```ts
get complete(): boolean;
```

False whenever any phase has no published rate.

##### Returns

`boolean`

***

### fullyMeasured

#### Get Signature

```ts
get fullyMeasured(): boolean;
```

True only if every duration was timed. An estimate is never this.

##### Returns

`boolean`

***

### items

#### Get Signature

```ts
get items(): LineItem[];
```

##### Returns

[`LineItem`](/microvms-agentd/reference/typescript/classes/lineitem/)\[]

***

### label

#### Get Signature

```ts
get label(): string;
```

##### Returns

`string`

***

### priced

#### Get Signature

```ts
get priced(): LineItem[];
```

The line items with a published rate.

##### Returns

[`LineItem`](/microvms-agentd/reference/typescript/classes/lineitem/)\[]

***

### rates

#### Get Signature

```ts
get rates(): RateTable;
```

##### Returns

[`RateTable`](/microvms-agentd/reference/typescript/classes/ratetable/)

***

### size

#### Get Signature

```ts
get size(): SizeClass;
```

##### Returns

[`SizeClass`](/microvms-agentd/reference/typescript/classes/sizeclass/)

***

### staleness

#### Get Signature

```ts
get staleness(): string | null;
```

The staleness warning the table carried when this was computed.

##### Returns

`string` | `null`

***

### total

#### Get Signature

```ts
get total(): Total;
```

The total, which is a lower bound whenever anything is unpriced.

##### Returns

[`Total`](/microvms-agentd/reference/typescript/classes/total/)

***

### unpriced

#### Get Signature

```ts
get unpriced(): LineItem[];
```

The line items with no published rate.

##### Returns

[`LineItem`](/microvms-agentd/reference/typescript/classes/lineitem/)\[]

## Methods

### byPhase()

```ts
byPhase(phase: string): LineItem[];
```

The line items belonging to one phase.

The string is judged by the core's own \[`CostPhase::from_str`], which is where the
closed set lives. This file used to carry its own seven-element table for it, as did
`bindings/microvms-py/src/cost.rs` — two parallel lists over one enum, which would have gone
stale the first time a phase was added and would have disagreed with each other in
whichever direction was edited first.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `phase` | `string` |

#### Returns

[`LineItem`](/microvms-agentd/reference/typescript/classes/lineitem/)\[]

***

### render()

```ts
render(): string;
```

Plain text, leading with what the dollars are rather than with the dollars.

#### Returns

`string`

***

### toJson()

```ts
toJson(): string;
```

Core's JSON shape for a report, as a JSON **string**: the one `microvm cost --json`
and Python's `to_dict` emit (#255).

A string for the same reason \[`LineItem::to_json`] is: the unpriced line item omits
its `usd` key, which no typed return shape can express.

#### Returns

`string`

## Provenance

This page is generated from `bindings/microvms-js/index.d.ts` by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run dts`. `mise run dts:check` fails when the committed file no longer matches the source.