LI.FI Gas API

The Gas API from LI.FI — 5 operation(s) for gas.

Operations 5

GET /v1/gas/status Get status information about a lifuel transaction
GET /v1/gas/refetch In case a transaction was missed by a relayer, this endpoint can be used to force a tx to be re-fetched.
GET /v1/gas/suggestion/{chain} Get a gas suggestion for the specified chain
GET /v1/gas/prices Get gas prices for enabled chains
GET /v1/gas/prices/{chainId} Get gas price for the specified chainId

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/lifi-gas-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 email required.

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

OpenAPI Specification

lifi-gas-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LI.FI Gas API
  version: 1.0.0
  description: LI.FI provides the best cross-chain swap across all liquidity pools and bridges.
servers:
- url: https://li.quest
  description: LI.FI Production Environment
- url: https://staging.li.quest
  description: LI.FI Staging Environment
tags:
- name: Gas
paths:
  /v1/gas/status:
    get:
      parameters:
      - example: '0x74546ce8aac58d33c212474293dcfeeadecef115847da75131a2ff6692e03b96'
        name: txHash
        description: The transaction hash that started the gas refilling process
        schema:
          type: string
        in: query
        required: true
      - name: x-lifi-api-key
        description: Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.
        schema:
          type: string
        in: header
      responses:
        '200':
          $ref: '#/components/responses/LIFuelStatusResponse'
      summary: Get status information about a lifuel transaction
      tags:
      - Gas
  /v1/gas/refetch:
    get:
      parameters:
      - example: '0x74546ce8aac58d33c212474293dcfeeadecef115847da75131a2ff6692e03b96'
        name: txHash
        description: The transaction hash that started the gas refilling process
        schema:
          type: string
        in: query
        required: true
      - example: POL
        name: chainId
        description: The chain where the deposit was originally made
        schema:
          type: string
        in: query
        required: true
      - name: x-lifi-api-key
        description: Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.
        schema:
          type: string
        in: header
      responses:
        '200':
          $ref: '#/components/responses/LIFuelStatusResponse'
      deprecated: true
      summary: In case a transaction was missed by a relayer, this endpoint can be used to force a tx to be re-fetched.
      tags:
      - Gas
  /v1/gas/suggestion/{chain}:
    get:
      parameters:
      - example: 137
        name: chain
        description: Chain from which gas prices should be shown (can be a chain id or a chain key)
        schema:
          type: string
        in: path
        required: true
      - example: 100
        name: fromChain
        description: If `fromChain` and `fromToken` are specified, the result will contain information about how much `fromToken` amount the user has to send to receive the suggested gas amount on the requested chain.
        schema:
          type: string
        in: query
      - example: xDai
        name: fromToken
        description: If `fromChain` and `fromToken` are specified, the result will contain information about how much `fromToken` amount the user has to send to receive the suggested gas amount on the requested chain.
        schema:
          type: string
        in: query
      - name: x-lifi-api-key
        description: Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.
        schema:
          type: string
        in: header
      responses:
        '200':
          $ref: '#/components/responses/GasSuggestionResponse'
      summary: Get a gas suggestion for the specified chain
      description: 'Endpoint to retrieve a suggestion on how much gas is needed on the requested chain. The suggestion is based on the average price of 10 approvals and 10 uniswap based swaps via LI.FI on the specified chain.

        If `fromChain` and `fromToken` are specified, the result will contain information about how much `fromToken` amount the user has to send to receive the suggested gas amount on the requested chain.'
      tags:
      - Gas
  /v1/gas/prices:
    get:
      tags:
      - Gas
      parameters:
      - name: x-lifi-api-key
        description: Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.
        schema:
          type: string
        in: header
      responses:
        '200':
          $ref: '#/components/responses/GasPricesResponse'
      summary: Get gas prices for enabled chains
      description: This endpoint can be used to get the most recent gas prices for the enabled chains in the server.
  /v1/gas/prices/{chainId}:
    get:
      tags:
      - Gas
      parameters:
      - example: 137
        name: chainId
        description: ChaindId from which gas prices should be shown
        schema:
          type: string
        in: path
        required: true
      - name: x-lifi-api-key
        description: Authentication header, register in the LI.FI Partner Portal (https://portal.li.fi/ ) to get your API Key.
        schema:
          type: string
        in: header
      responses:
        '200':
          $ref: '#/components/responses/GasPricesResponse'
        '400':
          $ref: '#/components/responses/InvalidRoutesRequest'
      summary: Get gas price for the specified chainId
      description: This endpoint can be used to get the most recent gas prices for the supplied chainId.
components:
  schemas:
    LIFuelStatus:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/LIFuelStatusStateEnum'
        sending:
          $ref: '#/components/schemas/TxInfo'
        receiving:
          $ref: '#/components/schemas/TxInfo'
    LIFuelStatusStateEnum:
      enum:
      - NOT_FOUND
      - PENDING
      - DONE
    TxInfo:
      type: object
      properties:
        txHash:
          type: string
          example: '0x74546ce8aac58d33c212474293dcfeeadecef115847da75131a2ff6692e03b96'
        txLink:
          type: string
          example: https://polygonscan.com/tx/0x74546ce8aac58d33c212474293dcfeeadecef115847da75131a2ff6692e03b96
        amount:
          description: The amount of token that will be / has been relayed
          type: string
          example: '10000'
        token:
          $ref: '#/components/schemas/Token'
        chainId:
          type: number
          example: 137
        block:
          type: number
          example: 39397739
    Token:
      title: Root Type for Token
      description: Representation of a Token
      required:
      - address
      - chainId
      - decimals
      - name
      - symbol
      type: object
      properties:
        address:
          description: Address of the token
          type: string
        decimals:
          format: number
          description: Number of decimals the token uses
          type: number
        symbol:
          description: Symbol of the token
          type: string
        chainId:
          format: number
          description: Id of the token's chain
          type: number
        coinKey:
          description: Identifier for the token
          type: string
        name:
          description: Name of the token
          type: string
        logoURI:
          description: Logo of the token
          type: string
        priceUSD:
          description: Token price in USD
          type: string
      example:
        address: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063'
        symbol: DAI
        decimals: 18
        chainId: 137
        name: (PoS) Dai Stablecoin
        coinKey: DAI
        priceUSD: '1'
        logoURI: https://static.debank.com/image/matic_token/logo_url/0x8f3cf7ad23cd3cadbd9735aff958023239c6a063/549c4205dbb199f1b8b03af783f35e71.png
    GasPrice:
      type: object
      properties:
        standard:
          type: number
        fast:
          type: number
        fastest:
          type: number
        lastUpdated:
          type: number
  responses:
    LIFuelStatusResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LIFuelStatus'
      description: The status of a lifuel operation
    GasSuggestionResponse:
      description: "{\n    \"available\": true,\n    \"recommended\": {\n        \"token\": {\n            \"address\": \"0x0000000000000000000000000000000000000000\",\n            \"chainId\": 137,\n            \"symbol\": \"MATIC\",\n            \"decimals\": 18,\n            \"name\": \"MATIC\",\n            \"priceUSD\": \"1.219821\",\n            \"logoURI\": \"https://static.debank.com/image/matic_token/logo_url/matic/6f5a6b6f0732a7a235131bd7804d357c.png\",\n            \"coinKey\": \"MATIC\"\n        },\n        \"amount\": \"190510922050970750\",\n        \"amountUsd\": \"0.23\"\n    },\n    \"limit\": {\n        \"token\": {\n            \"address\": \"0x0000000000000000000000000000000000000000\",\n            \"chainId\": 137,\n            \"symbol\": \"MATIC\",\n            \"decimals\": 18,\n            \"name\": \"MATIC\",\n            \"priceUSD\": \"1.219821\",\n            \"logoURI\": \"https://static.debank.com/image/matic_token/logo_url/matic/6f5a6b6f0732a7a235131bd7804d357c.png\",\n            \"coinKey\": \"MATIC\"\n        },\n        \"amount\": \"1639584824330782959\",\n        \"amountUsd\": \"2\"\n    },\n    \"fromToken\": {\n        \"address\": \"eth\",\n        \"symbol\": \"ETH\",\n        \"decimals\": 18,\n        \"chainId\": 1,\n        \"name\": \"ETH\",\n        \"coinKey\": \"ETH\",\n        \"priceUSD\": \"1622.39\",\n        \"logoURI\": \"https://static.debank.com/image/token/logo_url/eth/935ae4e4d1d12d59a99717a24f2540b5.png\"\n    },\n    \"fromAmount\": \"141766159801281\"\n}"
    GasPricesResponse:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GasPrice'
      description: Gas Prices for the supplied chainID
    InvalidRoutesRequest:
      description: Invalid Routes Request