# LI.FI — Get a gas suggestion for the specified chain

Get LI.FI Gas Suggestion data via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Lifi, configure supported query parameters and filters, and retrieve structured data including available, recommendation status explanation, amount, reported gas amount limit, and source-token funding estimate for explain destination gas needs, and handle unavailable suggestions.

Documentation: https://openany.si/lifi/lifi-li-fi-get-a-gas-suggestion-for-the-specified-chain/90eb52d1-36a8-492d-ba4a-08166a82eb59/
API ID: 90eb52d1-36a8-492d-ba4a-08166a82eb59
Provider: lifi
Contract revision: 4
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/lifi/v1/gas/suggestion/{chain}
Page update time: 2026-12-03T02:43:27.511Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0 / call
The published contract currently has no usage charge. Authentication and service limits still apply.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:43:26.938Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "fixed",
  "priceMicroUsd": "0",
  "rounding": null,
  "unit": "call",
  "unitQuantity": null
}
```

## Usage and limits
## LI.FI Gas Suggestion API

The required chain path parameter accepts a chain ID or key. fromChain and fromToken together request a source-token funding estimate; available and message describe whether the suggestion is usable.

## What You Can Build

- **Explain destination gas needs**: Display recommendations only when available.
- **Handle unavailable suggestions**: Show the returned message rather than treating partial values as a successful result.

## Returned Data

| Field | Meaning |
| --- | --- |
| `available` | Whether a usable gas recommendation is available |
| `message` | Recommendation status explanation |
| `recommended.amount` | Recommended native-token amount in base units |
| `recommended.token` | Token metadata for the recommendation |
| `limit.amount` | Reported gas amount limit |
| `fromAmount` | Source-token funding estimate |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "LI.FI — Get a gas suggestion for the specified chain request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {
        "chain": {
          "type": "string",
          "description": "Chain from which gas prices should be shown (can be a chain id or a chain key)"
        }
      },
      "required": [
        "chain"
      ]
    },
    "query": {
      "type": "object",
      "properties": {
        "fromChain": {
          "type": "string",
          "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."
        },
        "fromToken": {
          "type": "string",
          "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."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "available": {
      "type": "boolean"
    },
    "fromAmount": {
      "type": "string"
    },
    "limit": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string"
        },
        "amountUsd": {
          "type": "string"
        },
        "token": {
          "type": "object",
          "properties": {
            "address": {
              "type": "string"
            },
            "chainId": {
              "type": "integer"
            },
            "coinKey": {
              "type": "string"
            },
            "decimals": {
              "type": "integer"
            },
            "logoURI": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "priceUSD": {
              "type": "string"
            },
            "symbol": {
              "type": "string"
            }
          }
        }
      }
    },
    "message": {
      "type": "string"
    },
    "recommended": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "string"
        },
        "amountUsd": {
          "type": "string"
        },
        "token": {
          "type": "object",
          "properties": {
            "address": {
              "type": "string"
            },
            "chainId": {
              "type": "integer"
            },
            "coinKey": {
              "type": "string"
            },
            "decimals": {
              "type": "integer"
            },
            "logoURI": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "priceUSD": {
              "type": "string"
            },
            "symbol": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
```

## Request example
Scenario: Documentation example
```bash
curl \
  'https://api.openany.si/v1/agent-apis/lifi/v1/gas/suggestion/10' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Published documentation example. Verify the actual response after an approved call.
Sample response · Documented HTTP 200
```json
{
  "available": false,
  "fromAmount": "0",
  "limit": {
    "amount": "22837202716713635",
    "amountUsd": "50.0000",
    "token": {
      "address": "0x0000000000000000000000000000000000000000",
      "chainId": 10,
      "coinKey": "ETH",
      "decimals": 18,
      "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
      "name": "ETH",
      "priceUSD": "2189.41",
      "symbol": "ETH"
    }
  },
  "message": "Failed to calculate gas recommendation",
  "recommended": {
    "amount": "9134881086685",
    "amountUsd": "0.0200",
    "token": {
      "address": "0x0000000000000000000000000000000000000000",
      "chainId": 10,
      "coinKey": "ETH",
      "decimals": 18,
      "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
      "name": "ETH",
      "priceUSD": "2189.41",
      "symbol": "ETH"
    }
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Which chain goes in the path?
Use the chain for which gas funding is being suggested.

### When should I provide fromChain and fromToken?
Provide both when requesting an estimate of the source token needed for the suggested gas amount.

### Can recommended contain values when available is false?
Yes. Check available and message before treating any recommendation as usable.

### Does this top up gas automatically?
No. It returns suggestion data rather than signing or sending a funding transaction.

### Are token amounts display amounts?
Read token decimals; base-unit amounts need precise conversion for display.

### Are network fees the OpenAny API call price?
No. Gas and transfer fee estimates describe the on-chain operation. Review the selected implementation pricing separately for the OpenAny request.

## Available implementations
- lifi: https://openany.si/lifi/lifi-li-fi-get-a-gas-suggestion-for-the-specified-chain/90eb52d1-36a8-492d-ba4a-08166a82eb59/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
