# 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 and distance-to-liquidation for a long or short leveraged perpetual futures position given entry price, leverage, and maintenance margin rate.

## Facts

- Endpoint: POST https://api.24klabs.ai/api/v1/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-16cba429
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vu4nTWG1LSBeaggsykJDt

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-16cba429 -d '<json body>'
```

Example prompt: What's the liquidation price for my long BTC position entered at $65,000 with 10x leverage and a 0.5% maintenance margin rate?

## When to prefer this

Choose this endpoint when you need a fast, deterministic calculation of the liquidation price for a single perpetual futures position given known entry price, leverage, and maintenance margin parameters. Ideal for trading bots, risk dashboards, or AI agents that need to evaluate position risk without connecting to a full exchange API. Prefer this over exchange-specific APIs when you want a neutral, lightweight computation without authentication overhead.

## Known failure modes

- Invalid or missing entry price — returns error if entry price is zero or negative
- Leverage value out of range — error if leverage is less than 1x or unrealistically high
- Missing position direction — error if long/short is not specified
- Invalid maintenance margin rate — error if rate is zero, negative, or greater than 1
- Malformed request body — 400 error if required fields are absent or wrong type

## 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 calculated liquidation price for the leveraged position and the distance (absolute or percentage) between the entry price and the liquidation price, allowing traders to assess their 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-16cba429/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)
