# RelAI MEV Detection

> RelAI MEV Detection is a paid API for AI agents from api.relai.fi, paid per call via x402, $1.15/call, status unknown (last checked 2026-09-14).

Detects and analyzes MEV activity including sandwich attacks, front-running, and toxic flow across major blockchains using AI-powered analysis.

## Facts

- Endpoint: POST https://api.relai.fi/relay/1769629274857/x402/bitquery/mevdetection
- Price: $1.15/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-relai-fi-8a0acd62
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_WDAPPC5W9jJyDoBsDndtw

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability api-relai-fi-8a0acd62 -d '<json body>'
```

Example prompt: Can you check this Ethereum transaction 0xabc123... for MEV activity — specifically whether it was sandwiched or front-run, and give me an AI-powered breakdown of any toxic flow involved?

## When to prefer this

Use this endpoint when you need AI-powered MEV detection with multi-chain support and detailed classification of attack types (sandwich, front-running, toxic flow). Prefer this over generic block explorers or raw Bitquery queries when you need an actionable, interpreted result rather than raw transaction data.

## Known failure modes

- Invalid transaction hash returns 400 error
- Unsupported chain returns error or empty result
- Transaction not yet indexed returns no data
- Rate limiting or payment failure returns 402 or 429
- Ambiguous input parameters return partial or empty analysis

## How this service works

Detect MEV (Maximal Extractable Value) attacks and sandwich trades. Supported chains: ethereum, base, bsc, arbitrum, polygon. Default chain: ethereum. Required params: none (chain/limit/timeperiod are optional and defaulted).

## Output

Returns a structured analysis report identifying detected MEV activity types (sandwich attack, front-running, toxic flow), confidence scores, involved addresses, and an AI-generated explanation of the malicious behavior observed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "enum": [
    "base",
    "ethereum",
    "bsc",
    "arbitrum",
    "polygon",
    "optimism",
    "solana"
   ],
   "type": "string",
   "description": "Blockchain to query (e.g., base, ethereum, bsc, solana)"
  },
  "limit": {
   "type": "string",
   "description": "Maximum number of results to return (default: 10, max: 500)"
  },
  "timeperiod": {
   "enum": [
    "1h",
    "4h",
    "24h",
    "7d",
    "30d"
   ],
   "type": "string",
   "description": "Time period for analysis (e.g., 1h, 24h, 7d, 30d)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-relai-fi-8a0acd62/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.relai.fi](https://www.zero.xyz/host/api.relai.fi/llms.txt)
