# Crypto Liquidation Price Calculator

> Crypto Liquidation Price Calculator is a paid API for AI agents from api.24klabs.ai, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-13).

Calculates the liquidation price for a long or short leveraged perpetual futures position given entry price, leverage, and maintenance margin rate, and returns the distance to liquidation.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/crypto-liquidation-price
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/crypto-liquidation-price-calculator-4a83a722
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SM-uhyyIdnAS95uqEHjO3

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 crypto-liquidation-price-calculator-4a83a722 -d '<json body>'
```

Example prompt: What's the liquidation price if I open a 10x long BTC position at an entry price of $65,000 with a maintenance margin rate of 0.5%?

## When to prefer this

Use this endpoint when you need a fast, on-demand computation of the liquidation price for a single leveraged perpetual futures position without connecting to a live exchange API. It is ideal for pre-trade risk checks, building trading dashboards, or embedding liquidation math into automated agents managing crypto portfolios. Prefer this over manual formula implementation or exchange-specific APIs when you want a simple, exchange-agnostic calculation based solely on entry price, leverage, and maintenance margin rate.

## Known failure modes

- Missing required fields (entry price, leverage, position direction, or maintenance margin rate) returns a validation error
- Leverage value of zero or negative causes a computation error
- Maintenance margin rate outside valid range (e.g. >100%) may return an error or nonsensical result
- Invalid position direction string (not 'long' or 'short') returns a bad request error
- Network timeout or service unavailability returns a 5xx error

## How this service works

Liquidation price for a long/short leveraged (perp) position from entry, leverage and maintenance-margin rate; returns liquidation price and distance to it.

## Output

Returns the computed liquidation price for the specified leveraged position and the distance (in price units or percentage) from the entry price to the liquidation level, allowing traders to assess their downside or upside risk exposure.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "side": {
   "type": "string"
  },
  "leverage": {
   "type": "number"
  },
  "entry_price": {
   "type": "number"
  },
  "maintenance_margin_rate": {
   "type": "number"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "distance_pct": -9.5,
  "liquidation_price": 27150
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/crypto-liquidation-price-calculator-4a83a722/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.24klabs.ai](https://www.zero.xyz/host/api.24klabs.ai/llms.txt)
