> ## Documentation Index
> Fetch the complete documentation index at: https://narev.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateLagoDestination

[**@ai-billing/lago**](../index)

***

[@ai-billing/lago](/docs/sdk/ai-billing/reference/lago/typedoc/index) / createLagoDestination

# Function: createLagoDestination()

> **createLagoDestination**\<`TTags`>(`options`): `Destination`\<`TTags`>

Defined in: [lago-destination.ts:73](https://github.com/narevai/ai-billing/blob/main/packages/lago/src/destination/lago-destination.ts#L73)

Creates a Destination that ingests billing events into Lago.

Identity is extracted from tags (Lago `external_customer_id`). If no identity is present, the event is
skipped to avoid ingesting anonymous data.

**Cost:** Each event must include BillingEvent.cost. The payload always includes `cost_nanos`
and `currency` derived from `event.cost` using non-null assertion; omitting `cost` causes undefined
runtime behavior (typically a throw in costToNumber or when reading `currency`).

## Type Parameters

### TTags

`TTags` *extends* `JSONObject` = `JSONObject`

The shape of the tags object, extending DefaultTags.

## Parameters

### options

[`LagoDestinationOptions`](/docs/sdk/ai-billing/reference/lago/typedoc/interfaces/LagoDestinationOptions)\<`TTags`>

Destination configuration; see [LagoDestinationOptions](/docs/sdk/ai-billing/reference/lago/typedoc/interfaces/LagoDestinationOptions).

## Returns

`Destination`\<`TTags`>

A destination function that sends events to Lago.
