---
title: getFeeForMessage
hideTableOfContents: true
h1: getFeeForMessage RPC Method
---

Get the fee the network will charge for a particular Message

<Callout type="warn" title={"Version Restriction"}>
  This method is only available in `solana-core` v1.9 or newer. Please use
  [getFees](/docs/rpc/deprecated/getfees) for `solana-core` v1.8 and below.
</Callout>

<DocSideBySide>

<DocLeftSide>

### Parameters

<Parameter type={"string"} required={true}>
  Base-64 encoded Message
</Parameter>

<Parameter type={"object"} optional={true}>

Configuration object containing the following fields:

<Field
  name="commitment"
  type="string"
  optional={true}
  href="/docs/rpc/index.mdx#configuring-state-commitment"
/>

<Field name="minContextSlot" type="number" optional={true}>
  The minimum slot that the request can be evaluated at
</Field>

</Parameter>

### Result

- `<u64|null>` - Fee corresponding to the message at the specified blockhash

</DocLeftSide>

<DocRightSide>

### Code sample

```shell
curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
{
  "id":1,
  "jsonrpc":"2.0",
  "method":"getFeeForMessage",
  "params":[
    "AQABAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQAA",
    {
      "commitment":"processed"
    }
  ]
}
'
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": { "context": { "slot": 5068 }, "value": 5000 },
  "id": 1
}
```

</DocRightSide>
</DocSideBySide>
