Hiro Fees API

Read-only endpoints to obtain fee details

Operations 3

POST /extended/v1/fee_rate/ Fetch fee rate #
POST /v2/fees/transaction Get approximate fees for the given transaction #
GET /v2/fees/transfer Get estimated fee #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hiro-fees-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hiro-fees-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hiro Fees API
  version: '1.0'
  description: 'Operations tagged Fees across 2 of this provider''s published API definitions: hiro-stacks-blockchain-api-openapi.yaml, hiro-stacks-node-rpc-api-openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.hiro.so/
  description: mainnet
- url: http://localhost:20443
  description: Local Stacks Node
tags:
- name: Fees
  description: Read-only endpoints to obtain fee details
paths:
  /extended/v1/fee_rate/:
    post:
      operationId: fetch_fee_rate
      summary: Fetch fee rate
      tags:
      - Fees
      description: '**NOTE:** This endpoint is deprecated in favor of Get approximate fees for a given transaction.


        Retrieves estimated fee rate.'
      requestBody:
        content:
          application/json:
            schema:
              title: FeeRateRequest
              description: Request to fetch fee for a transaction
              type: object
              properties:
                transaction:
                  description: A serialized transaction
                  type: string
              required:
              - transaction
        required: true
        description: Request to fetch fee for a transaction
      deprecated: true
      responses:
        '200':
          description: Get fee rate information.
          content:
            application/json:
              schema:
                title: FeeRate
                description: Get fee rate information.
                type: object
                properties:
                  fee_rate:
                    type: integer
                required:
                - fee_rate
        4XX:
          description: Default Response
          content:
            application/json:
              schema:
                title: Error Response
                additionalProperties: true
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
    servers:
    - url: https://api.hiro.so/
      description: mainnet
  /v2/fees/transaction:
    post:
      summary: Get approximate fees for the given transaction
      tags:
      - Fees
      security: []
      description: 'Get an estimated fee for the supplied transaction. This

        estimates the execution cost of the transaction, the current

        fee rate of the network, and returns estimates for fee

        amounts.


        * `transaction_payload` is a hex-encoded serialization of

        the TransactionPayload for the transaction.

        * `estimated_len` is an optional argument that provides the

        endpoint with an estimation of the final length (in bytes)

        of the transaction, including any post-conditions and

        signatures


        If the node cannot provide an estimate for the transaction

        (e.g., if the node has never seen a contract-call for the

        given contract and function) or if estimation is not

        configured on this node, a 400 response is returned.

        The 400 response will be a JSON error containing a `reason`

        field which can be one of the following:


        * `DatabaseError` - this Stacks node has had an internal

        database error while trying to estimate the costs of the

        supplied transaction.

        * `NoEstimateAvailable` - this Stacks node has not seen this

        kind of contract-call before, and it cannot provide an

        estimate yet.

        * `CostEstimationDisabled` - this Stacks node does not perform

        fee or cost estimation, and it cannot respond on this

        endpoint.


        The 200 response contains the following data:


        * `estimated_cost` - the estimated multi-dimensional cost of

        executing the Clarity VM on the provided transaction.

        * `estimated_cost_scalar` - a unitless integer that the Stacks

        node uses to compare how much of the block limit is consumed

        by different transactions. This value incorporates the

        estimated length of the transaction and the estimated

        execution cost of the transaction. The range of this integer

        may vary between different Stacks nodes. In order to compute

        an estimate of total fee amount for the transaction, this

        value is multiplied by the same Stacks node"s estimated fee

        rate.

        * `cost_scalar_change_by_byte` - a float value that indicates how

        much the `estimated_cost_scalar` value would increase for every

        additional byte in the final transaction.

        * `estimations` - an array of estimated fee rates and total fees to

        pay in microSTX for the transaction. This array provides a range of

        estimates (default: 3) that may be used. Each element of the array

        contains the following fields:

        * `fee_rate` - the estimated value for the current fee

        rates in the network

        * `fee` - the estimated value for the total fee in

        microSTX that the given transaction should pay. These

        values are the result of computing:

        `fee_rate` x `estimated_cost_scalar`.

        If the estimated fees are less than the minimum relay

        fee `(1 ustx x estimated_len)`, then that minimum relay

        fee will be returned here instead.


        Note: If the final transaction"s byte size is larger than

        supplied to `estimated_len`, then applications should increase

        this fee amount by:


        `fee_rate` x `cost_scalar_change_by_byte` x (`final_size` - `estimated_size`)'
      operationId: getFeeTransaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeeTransactionRequest'
            examples:
              fee-transaction-request:
                summary: Fee estimation request
                value:
                  estimated_len: 350
                  transaction_payload: 021af942874ce525e87f21bbe8c121b12fac831d02f4086765742d696e666f0b7570646174652d696e666f00000000
      responses:
        '200':
          description: Estimated fees for the transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeTransactionResponse'
              examples:
                fee-transaction-response:
                  $ref: ./components/examples/fee-transaction-response.example.json
        '400':
          description: Fee estimation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeTransactionError'
            text/plain:
              schema:
                type: string
              example: 'Failed to decode: Failed to parse JSON body'
        '500':
          $ref: '#/components/responses/InternalServerError'
    servers:
    - url: http://localhost:20443
      description: Local Stacks Node
  /v2/fees/transfer:
    get:
      summary: Get estimated fee
      tags:
      - Fees
      security: []
      operationId: getFeeTransfer
      description: 'Get an estimated fee rate for STX transfer transactions. This is a fee

        rate per byte, returned as a JSON integer (microSTX per byte).'
      responses:
        '200':
          description: Fee rate in microSTX per byte
          content:
            application/json:
              schema:
                type: integer
                minimum: 1
                description: Fee rate in microSTX per byte
              example: 3
        '500':
          $ref: '#/components/responses/InternalServerError'
    servers:
    - url: http://localhost:20443
      description: Local Stacks Node
components:
  schemas:
    FeeTransactionRequest:
      $ref: ./components/schemas/fee-transaction-request.schema.yaml
    FeeTransactionError:
      $ref: ./components/schemas/fee-transaction-error.schema.yaml
    FeeTransactionResponse:
      $ref: ./components/schemas/fee-transaction-response.schema.yaml
  responses:
    InternalServerError:
      description: Internal Server Error
      content:
        text/plain:
          schema:
            type: string
          example: Internal Server Error
  securitySchemes:
    rpcAuth:
      type: apiKey
      in: header
      name: authorization
      description: 'Plain-text secret value that must exactly equal the node''s

        configured password, which is set as `connection_options.auth_token`

        in the node''s configuration file.

        '
externalDocs:
  url: https://github.com/hirosystems/stacks-blockchain-api
  description: Source Repository
x-refined-from:
- hiro-stacks-blockchain-api-openapi.yaml
- hiro-stacks-node-rpc-api-openapi.yaml