# Fee

When initiating a cross-chain message, a fee is charged to cover the gas consumption of transactions on other chains. We support payment using various tokens or the source chain token.

Below, we will explain our calculation method in detail:

* Users can choose the gas limit for executing messages on the target chain.
* During the cross-chain message process, we will go through the relay chain, which also incurs some gas consumption. To avoid affecting the execution of messages on the target chain, we also have a base gas limit.
* The gas consumed on the target chain and the diversity of payment methods on the source chain will have different gas prices for calculation.

Finally, we can calculate the exact amount of tokens needed to be paid using the following formula:

```
(gasLimit + baseGasLimit) * gasPrice
```

For ease of use, you can use the following interface to get the base gas limit and gas price for the target chain:

```
function getFeeInfo(
uint256 _chainId,
address _feeToken
) external view override returns (uint256 _base, uint256 _gasPrice, address _receiverAddress);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.butternetwork.io/butter-omnichain-messaging-integration/omnichain-fee.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
