> ## Documentation Index
> Fetch the complete documentation index at: https://growthx-chore-remove-output-wrapper.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# v0.2.0 → v0.3.0

> Upgrading Output.ai projects from v0.2.0 to v0.3.0: New LLM cost payload format and cost event name change.

This release has two breaking changes:

1. The `llm:call_cost` hook event was renamed to `cost:llm:request`;
2. The `cost` object in events and LLM responses has a new format.

## Migration steps

### Event renaming

Update each hook that listens for `llm:call_cost` to use `cost:llm:request`:

#### Before

```js theme={null}
import { on } from '@outputai/core/hooks';

on( 'llm:call_cost', async ( { modelId, cost, usage } ) => {
  ...
} );
```

#### After

```js theme={null}
import { on } from '@outputai/core/hooks';

on( 'cost:llm:request', async ( { modelId, cost, usage } ) => {
  ...
} );
```

### Cost payload

On the `@outputai/llm` module, the `cost` field in both the `.generateText()` response and the `cost:llm:request` event has a new format:

#### Before

```json theme={null}
{
  "total": 0.002341,
  "components": {
    "input": { "value": 0.001302 },
    "cachedInput": { "value": 0 },
    "output": { "value": 0.001039 },
    "reasoning": { "value": 0.00027 }
  }
}
```

#### After

```json theme={null}
{
  "total": 0.002341,
  "components": [
    { "name": "input_tokens", "value": 0.001302 },
    { "name": "input_cached_tokens", "value": 0 },
    { "name": "output_tokens", "value": 0.001039 },
    { "name": "reasoning_tokens", "value": 0.00027 }
  ]
}
```

**Note:** `components` used to be an object; it is now an array.
