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

# starknet_estimateFee | Starknet

> Starknet API method that returns an estimate of the fee for Starknet transactions. starknet_estimateFee on Starknet via Chainstack.

> [!NOTE]
>
> **Starknet OpenRPC spec**
>
> For the latest version of the publicly maintained OpenRPC spec, see the [Starknet specs GitHub repo](https://github.com/starkware-libs/starknet-specs).

Starknet API method that returns an estimate of the fee for Starknet transactions.

It estimates the resources required by transactions when applied on a given state. A client or wallet can use this estimate to determine the appropriate amount of fee to include in a transaction to ensure that the network processes it.

## Parameters

* `request` — the list of transactions to estimate. Each transaction runs on the state left by the previous ones. JSON-RPC API version 0.9 accepts only version 3 transactions (`"version": "0x3"`), which set fee limits in `resource_bounds` and pay in FRI.
* `simulation_flags` — required; an empty list, or `["SKIP_VALIDATE"]` to skip the account's signature validation, for example to estimate a transaction before signing it. With `SKIP_VALIDATE`, the estimate leaves out the gas that validation uses.
* `block_id` — the hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.

## Response

* `result` — a list of fee estimates, one for each transaction in `request`:
  * `l1_gas_consumed` and `l1_gas_price` — the Ethereum gas the transaction uses and its price.
  * `l1_data_gas_consumed` and `l1_data_gas_price` — the Ethereum data gas the transaction uses and its price.
  * `l2_gas_consumed` and `l2_gas_price` — the Starknet gas the transaction uses and its price.
  * `overall_fee` — the total fee: the sum of each gas amount multiplied by its price.
  * `unit` — the fee unit, `FRI`.

## Use case

A practical use case for `starknet_estimateFee` is to calculate the fee required for a transaction that interacts with a contract on Starknet. The fee is an important factor in transactions, as it determines the amount of fees that need to be paid by the sender to the network for processing the transaction.


## OpenAPI

````yaml openapi/starknet_node_api/starknet_estimateFee.json POST /mt_c524ad9781ae5dccd9ac6f5b0370e
openapi: 3.0.0
info:
  title: starknet
  version: 1.0.0
  contact: {}
servers:
  - url: https://starknet-mainnet.core.chainstack.com
security: []
paths:
  /mt_c524ad9781ae5dccd9ac6f5b0370e:
    post:
      summary: starknet_estimateFee
      description: starknet_estimateFee
      operationId: starknetEstimateFee
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                jsonrpc:
                  type: string
                method:
                  type: string
                params:
                  type: object
                  properties:
                    request:
                      type: array
                      items:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - INVOKE
                          version:
                            type: string
                            enum:
                              - '0x3'
                          sender_address:
                            $ref: '#/components/schemas/FELT'
                          calldata:
                            type: array
                            items:
                              $ref: '#/components/schemas/FELT'
                          signature:
                            type: array
                            items:
                              $ref: '#/components/schemas/FELT'
                          nonce:
                            $ref: '#/components/schemas/FELT'
                          resource_bounds:
                            type: object
                            properties:
                              l1_gas:
                                type: object
                                properties:
                                  max_amount:
                                    type: string
                                  max_price_per_unit:
                                    type: string
                              l1_data_gas:
                                type: object
                                properties:
                                  max_amount:
                                    type: string
                                  max_price_per_unit:
                                    type: string
                              l2_gas:
                                type: object
                                properties:
                                  max_amount:
                                    type: string
                                  max_price_per_unit:
                                    type: string
                          tip:
                            type: string
                          paymaster_data:
                            type: array
                            items:
                              $ref: '#/components/schemas/FELT'
                          account_deployment_data:
                            type: array
                            items:
                              $ref: '#/components/schemas/FELT'
                          nonce_data_availability_mode:
                            type: string
                            enum:
                              - L1
                              - L2
                          fee_data_availability_mode:
                            type: string
                            enum:
                              - L1
                              - L2
                    simulation_flags:
                      type: array
                      items:
                        type: string
                        enum:
                          - SKIP_VALIDATE
                    block_id:
                      type: object
                      properties:
                        block_number:
                          type: integer
              default:
                id: 0
                jsonrpc: '2.0'
                method: starknet_estimateFee
                params:
                  request:
                    - type: INVOKE
                      version: '0x3'
                      sender_address: >-
                        0x76601136372fcdbbd914eea797082f7504f828e122288ad45748b0c8b0c9696
                      calldata:
                        - '0x1'
                        - >-
                          0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d
                        - >-
                          0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e
                        - '0x0'
                        - '0x3'
                        - '0x3'
                        - >-
                          0x253aec31b572ebca17e79e124b9baf03c660bbf6730e535cad3460ff08d255e
                        - '0x52949b84417d800'
                        - '0x0'
                      signature:
                        - >-
                          0x14b8f6bd001292f88acd544a70f3e2e44a66f28e3d2e1560a59900e613d72df
                        - >-
                          0x3b7adfd8815015a222f8739f3b6b67c213d3398ff9b7e230b5c723ca274cb5c
                      nonce: '0x20575'
                      resource_bounds:
                        l1_data_gas:
                          max_amount: '0x240'
                          max_price_per_unit: '0x57e4e3dbb8'
                        l1_gas:
                          max_amount: '0x0'
                          max_price_per_unit: '0xbd8b9d31c846'
                        l2_gas:
                          max_amount: '0x3deb40'
                          max_price_per_unit: '0x112607df3c'
                      tip: '0x0'
                      paymaster_data: []
                      account_deployment_data: []
                      nonce_data_availability_mode: L1
                      fee_data_availability_mode: L1
                  simulation_flags: []
                  block_id:
                    block_number: 17882614
      responses:
        '200':
          description: Successful response
components:
  schemas:
    FELT:
      type: string
      title: Field element
      description: A field element. represented by at most 63 hex digits
      pattern: ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$

````