> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# `l2.getL1BaseFee`

Returns the current L1 base fee reported by the OP Stack gas price oracle on L2.

## Usage

Read the L1 base fee from the Chain's configured gas price oracle.

:::code-group
```ts twoslash [example.ts]
import { client } from './viem.config'

const baseFee = await client.fee.getL1BaseFee() // [!code focus]
// @log: 35229945916n
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/op-stack/l2.config.ts:setup]
```
:::

### Standalone Action

Call `Actions.l2.getL1BaseFee` directly by passing the Client as the first argument.

:::code-group
```ts twoslash [example.ts]
import { Actions } from 'viem/op-stack'
import { client } from './viem.config'

const baseFee = await Actions.l2.getL1BaseFee(client) // [!code focus]
// @log: 35229945916n
```

```ts twoslash [viem.config.ts] filename="viem.config.ts"
// [!include ~/snippets/op-stack/l2.config.ts:setup]
```
:::

## Return Value

`bigint`

The L1 base fee in wei.

## Parameters

### chain

* **Type:** `Chain | null`
* **Default:** `client.chain`

The L2 Chain used to resolve the gas price oracle.

### gasPriceOracleAddress

* **Type:** `Address`

An override for the OP Stack gas price oracle address.
