# Lago Configuration

The `lago` plugin reports gateway usage events to Lago for metered billing with subscription IDs, billable metrics, and custom properties.<!-- --> <!-- -->Configuration covers plugin parameters and plugin metadata.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* endpoint\_addrs

  array\[string]

  required

  valid value:

  one or more HTTP or HTTPS origins

  ***

  Lago API origins. One origin is selected randomly for each batch.

* endpoint\_uri

  string

  default: `/api/v1/events/batch`

  ***

  Lago batch-events API path appended to the selected origin.

* token

  string

  required

  ***

  Lago organization API key sent as a Bearer token. This field is marked for encrypted storage when gateway data encryption is enabled. Protect the plaintext value in declarative files and secret-delivery workflows.

* event\_transaction\_id

  string

  required

  ***

  Unique event identifier. Supports built-in-variable templates. The plugin reuses the same identifier and timestamp on retries. Lago deduplicates by transaction ID; ClickHouse-backed deployments also include the timestamp in the deduplication key.

* event\_subscription\_id

  string

  required

  ***

  External Lago subscription ID. Supports built-in-variable templates.

* event\_code

  string

  required

  ***

  Code of the Lago billable metric associated with the event.

* event\_properties

  object

  ***

  String-valued event properties. Values can contain built-in-variable templates.

* ssl\_verify

  boolean

  default: `true`

  ***

  If true, verify the Lago API TLS certificate.

* timeout

  integer

  default: `3000`

  valid value:

  between 1 and 60000 inclusive

  ***

  Lago request timeout in milliseconds.

* keepalive

  boolean

  default: `true`

  ***

  If true, reuse Lago API connections.

* keepalive\_timeout

  integer

  default: `60000`

  valid value:

  greater than or equal to 1000

  ***

  Idle keepalive timeout in milliseconds.

* keepalive\_pool

  integer

  default: `5`

  valid value:

  greater than or equal to 1

  ***

  Maximum connections in the keepalive pool.

* batch\_max\_size

  integer

  default: `100`

  valid value:

  greater than 0

  ***

  Maximum events in one Lago batch. Lago's batch API defaults to a limit of 100 events, but self-hosted deployments can override the limit.

* name

  string

  default: `lago logger`

  ***

  Batch-processor identifier exported in batch-processing metrics.

* inactive\_timeout

  integer

  default: `5`

  ***

  Seconds to wait for new events before sending the batch.

* buffer\_duration

  integer

  default: `60`

  ***

  Maximum seconds from the earliest event before sending the batch.

* max\_retry\_count

  integer

  ***

  Retry attempts after the initial failed delivery.

* retry\_delay

  integer

  default: `1`

  ***

  Seconds between delivery retries.

## Plugin Metadata[​](#plugin-metadata "Direct link to Plugin Metadata")

The following attributes configure shared Lago batch-processing behavior through [plugin metadata](https://docs.api7.ai/apisix/key-concepts/plugin-metadata.md).

* max\_pending\_entries

  integer

  default: `8192`

  ***

  Maximum queued events. New events are dropped when the backlog reaches this limit.
