---
name: api.relai.fi
description: api.relai.fi is a paid relay API that provides on-chain data and agent task infrastructure across major EVM chains and Solana. It covers token discovery, DEX enumeration, gas pricing, MEV detection, and A2A agent task execution, with payments settled via x402 (USDC on Avalanche C-Chain or chain-specific). It also exposes a content editing endpoint for the Logos by Readia publishing platform.
host: api.relai.fi
---

# api.relai.fi

Relai is a multi-chain data and relay host primarily serving DeFi agents that need pre-trade intelligence: token lists, DEX directories, gas estimates, new pair discovery, and MEV risk signals. It is not a swap execution or price-streaming service; it sits in the research and routing-preparation layer of an agent's workflow. A secondary, unrelated capability covers editing published articles on the Logos platform, scoped to the article's owning wallet.

## When to use this host

Use api.relai.fi when an agent needs pre-trade reference data (token lists, DEX directories, gas prices), new pair discovery with AI analysis, or historical MEV risk signals on Base, Ethereum, BSC, Arbitrum, Polygon, Optimism, or Solana. Also use it for Logos article editing if the calling wallet is the article owner, or for single A2A task retrieval via the Relai relay. Do not use this host for real-time price streaming or swap quotes — use a dedicated DEX aggregator or price feed API (e.g. 0x, 1inch, CoinGecko) instead. Do not use it for mempool monitoring or real-time MEV alerts; MEV detection here is a historical point-in-time query only. For bulk task listing or task creation, this host is not suitable.

## Capabilities

### Chain Infrastructure Lookup

Provides the foundational reference data an agent needs before constructing any on-chain transaction: supported tokens with live USD prices, available DEXes, and current gas price tiers.

- **`fetch-relai-token-list`** — Returns a curated list of tokens for a specified blockchain chain, including contract address, symbol, decimals, icon URL, and current USD price for each token.
- **`fetch-dex-list`** — Returns a list of decentralized exchanges and their metadata (index, code, name) available on a specified blockchain via the Relai routing API.
- **`fetch-gas-price`** — Returns current gas price estimates (standard, fast, instant) for a specified blockchain chain via Relai's paid relay endpoint.

### Market Discovery

Surfaces newly created on-chain token pairs with liquidity pool metrics and AI-generated analysis, enabling agents to monitor emerging markets on supported chains.

- **`fetch-latest-token-pairs`** — Fetches the most recently created on-chain token pairs with liquidity pool data and AI-generated analysis for a specified blockchain.

### MEV Risk Intelligence

Detects sandwich attacks, front-running, and toxic MEV flows over a specified historical time window, supporting trade timing decisions and protocol health assessment.

- **`detect-mev-activity`** — Detects sandwich attacks, front-running, and toxic MEV flows across major EVM chains and Solana using AI-powered on-chain analysis.

### A2A Agent Task Relay

Fetches or executes a specific Relai A2A task by agent and task ID, enabling agent-to-agent coordination through Relai's paid relay infrastructure.

- **`fetch-relai-agent-task`** — Retrieves or executes a specific A2A agent task via the Relai paid relay, with payment settled in USDC on Avalanche C-Chain.

### Logos Content Management

Allows the owning wallet to update an existing Logos by Readia article's title, content, price, or categories on-chain.

- **`edit-logos-article`** — Updates an existing Logos by Readia article's title, content, price, or categories; the calling wallet must be the article's owner.

## Workflows

### Pre-Trade Chain Readiness Check

*Use when an agent needs to prepare a swap or transaction on a given chain and must validate available tokens, confirm which DEXes are active, and select an appropriate gas tier before constructing the transaction.*

1. **`fetch-relai-token-list`** — Enumerate supported tokens on the target chain to confirm the input and output tokens are available and retrieve their contract addresses and decimals.
2. **`fetch-dex-list`** — List available DEXes on the same chain to select or validate the routing protocol for the swap.
3. **`fetch-gas-price`** — Retrieve current gas price tiers (standard, fast, instant) to set an appropriate gas limit for the pending transaction.

### New Pair MEV Risk Assessment

*Use when an agent needs to evaluate whether a newly discovered token pair on a chain is operating in a high-MEV environment before committing capital.*

1. **`fetch-latest-token-pairs`** — Retrieve recently created token pairs and their liquidity pool data on the target chain to identify candidates of interest.
2. **`detect-mev-activity`** — Run a historical MEV scan on the same chain over a relevant time window to assess sandwich attack and front-running risk around those pairs.

## Skill reference

### `fetch-latest-token-pairs`

**PairPulse AI – Latest Token Pairs** — Fetches the most recently created on-chain token pairs with liquidity pool data and AI-generated analysis for a specified blockchain.

*Use when:* Use when an agent needs to discover newly listed token pairs and their liquidity pool metrics on a specific chain (Base, Ethereum, BSC, Arbitrum, Polygon, Optimism, or Solana), optionally with AI-driven insights.

*Not for:* Do not use for historical pair data over a custom time range, token price lookups, or swap execution — use a dedicated price or swap API instead.

**Inputs:**

- `chain` (string, required) — Blockchain to query. Must be one of: base, ethereum, bsc, arbitrum, polygon, optimism, solana.
- `limit` (string) — Maximum number of token pair results to return. Default is 10, maximum is 500.

**Returns:** Returns a status string, a result object with latest token pairs and liquidity pool data for the specified chain, an AI analysis object with insights, and a payment receipt object.

**Example:** `{"chain": "base", "limit": "10"}`

---

### `detect-mev-activity`

**MEV Sentinel** — Detects sandwich attacks, front-running, and toxic MEV flows across major EVM chains and Solana using AI-powered on-chain analysis.

*Use when:* Use when an agent needs to identify and analyze MEV activity (sandwich attacks, front-running, toxic flows) on a specific blockchain over a defined time window, such as for risk assessment, trade timing, or protocol health monitoring.

*Not for:* Do not use for real-time streaming MEV alerts or mempool monitoring; this is a single-shot historical query over a fixed time period.

**Inputs:**

- `chain` (string, required) — Blockchain to query. Must be one of: base, ethereum, bsc, arbitrum, polygon, optimism, solana.
- `timeperiod` (string, required) — Time period for analysis. Must be one of: 1h, 4h, 24h, 7d, 30d.
- `limit` (string) — Maximum number of results to return. Default is 10, maximum is 500.

**Returns:** Returns a status string, a result object with detected MEV events on the queried chain, an AI-generated analysis object with insights on sandwich attacks and front-running patterns, and a payment receipt object.

**Example:** `{"chain": "base", "timeperiod": "24h", "limit": "25"}`

---

### `fetch-relai-token-list`

**Relai Token List** — Returns a curated list of tokens for a specified blockchain chain, including contract address, symbol, decimals, icon URL, and current USD price for each token.

*Use when:* Use when an agent needs to enumerate supported tokens on a specific blockchain (e.g. base, ethereum) with their contract addresses, decimals, symbols, and live USD prices for display, routing, or token selection purposes.

*Not for:* Do not use for real-time price streaming or swap quotes; use a dedicated price feed or DEX quote API instead. Not suitable for cross-chain bridge token discovery.

**Inputs:**

- `chain` (string, required) — Blockchain identifier to fetch the token list for, supplied as a path parameter in the URL (e.g. 'base', 'ethereum').

**Returns:** Returns a JSON object with code 200 and a data array of token records, each containing id, name, symbol, contract address, decimals, icon URL, chain, creation timestamp, and current USD price.

**Example:** `GET https://api.relai.fi/relay/1772442473781/v4/base/tokenList`

---

### `edit-logos-article`

**Logos Article Editor** — Updates an existing Logos by Readia article's title, content, price, or categories; the calling wallet must be the article's owner.

*Use when:* Use when an agent needs to modify a previously published Logos article — changing its title, body content, price (USD), or category tags — and the payer wallet matches the article author.

*Not for:* Do not use to create new articles or to edit articles owned by a different wallet; ownership is enforced server-side and the payment will be rejected if the payer does not match the author.

**Inputs:**

- `articleId` (number, required) — Numeric ID of the article to edit. The payer wallet must be the article's owner.
- `title` (string) — New title to replace the existing article title.
- `content` (string) — New body content for the article. HTML markup is supported.
- `price` (number) — New reader price in USD. Must be between 0.01 and 1.00.
- `categories` (array) — Replacement categories array for the article.

**Returns:** Returns success=true with a data object containing the blockchain txHash, a success message, and the updated article fields (id, title, price, categories, updatedAt).

**Example:** `{"articleId": 4821, "title": "Understanding DeFi Liquidity Pools", "content": "<p>Liquidity pools are smart contracts...</p>", "price": 0.25, "categories": ["tech", "crypto"]}`

---

### `fetch-relai-agent-task`

**Relai Agent Task Relay** — Retrieves or executes a specific A2A agent task via the Relai paid relay, with payment settled in USDC on Avalanche C-Chain.

*Use when:* Use when an agent needs to fetch or execute a specific Relai A2A task by agentId and taskId, and is prepared to pay 0.01 USDC per request on Avalanche C-Chain via the x402 relay.

*Not for:* Do not use for bulk task listing or task creation; this endpoint targets a single specific task by ID. Not suitable for non-Avalanche payment contexts.

**Inputs:**

- `agentId` (string, required) — The unique identifier of the A2A agent whose task is being retrieved or executed.
- `taskId` (string, required) — The unique identifier of the specific task to retrieve or execute under the given agent.

**Returns:** Returns the task object for the specified agentId and taskId as processed by the Relai A2A relay after USDC payment is verified.

**Example:** `GET https://api.relai.fi/relay/1769254081272/a2a/agent-abc123/v1/tasks/task-xyz789`

---

### `fetch-dex-list`

**Relai DEX Directory** — Returns a list of decentralized exchanges and their metadata (index, code, name) available on a specified blockchain via the Relai routing API.

*Use when:* Use when an agent needs to enumerate supported DEXes on a given chain, for example to populate a DEX selector, validate a DEX code before routing a swap, or audit which protocols are available for a specific network.

*Not for:* Do not use to fetch swap quotes, token prices, or liquidity data; use a dedicated quote or price endpoint instead.

**Inputs:**

- `chain` (string, required) — Blockchain identifier used as a path parameter to scope the DEX list to a specific network.

**Returns:** Returns a JSON object with code=200 and a data array of DEX entries, each containing an integer index, a code string, and a name string (e.g. UniswapV3, Aerodrome, Curve).

**Example:** `GET https://api.relai.fi/relay/1772442473781/v4/base/dexList`

---

### `fetch-gas-price`

**Relai Gas Price API** — Returns current gas price estimates (standard, fast, instant) for a specified blockchain chain via Relai's paid relay endpoint.

*Use when:* Use when an agent needs current gas price tiers for a specific blockchain before constructing, estimating, or submitting a transaction.

*Not for:* Do not use for historical gas price data or gas price predictions; this returns only the current point-in-time estimate.

**Inputs:**

- `chain` (string, required) — Blockchain chain identifier to query gas prices for, supplied as a path parameter in the URL.

**Returns:** Returns a JSON object with code 200, a data object containing standard/fast/instant gas prices in atomic units, and a without_decimals object with the same tiers as human-readable decimals.

**Example:** `GET https://api.relai.fi/relay/1772442473781/v4/ethereum/gasPrice`

---
