# Mid Price Calculator

> Mid Price Calculator is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Computes the mid price as (bid + ask) / 2 from a supplied best bid and offer (BBO) pair, returning a single deterministic mark price.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/mid-price
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mid-price-calculator-99c00bff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_0Wjs-FlyMOOuEMQ1oBn1J

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 mid-price-calculator-99c00bff -d '<json body>'
```

Example prompt: Calculate the mid price for me — the bid is 1845.50 and the ask is 1847.20.

## When to prefer this

Prefer this endpoint when you need a simple, deterministic, auditable mid-price computation without spinning up local math, when you want a standardized JSON response for pipeline consistency, or when operating in an x402 micropayment context on Base where a $0.001 per-call cost is acceptable. It is purely local arithmetic — choose it over live market feed endpoints when you already have bid/ask values and just need the midpoint.

## Known failure modes

- Missing bid or ask field returns a validation error
- Non-numeric values for bid or ask cause a bad request response
- Ask lower than bid may produce a negative spread mid (no validation guard documented)
- Payment failure via x402 (insufficient USDC balance or wrong network) blocks the call

## How this service works

Mid price = (bid + ask) / 2 for spread-aware marks. Call when normalizing BBO into a single mid for agents. Returns mid price as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

A deterministic JSON response containing the computed mid price value, derived purely from local arithmetic on the supplied bid and ask inputs — no live market feed or external data involved.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ask": {
   "type": "number",
   "description": "Input field: ask."
  },
  "bid": {
   "type": "number",
   "description": "Input field: bid."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ask": 100.5,
  "bid": 99.5,
  "mid": 100,
  "schema": "delx/util-mid-price/v1"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mid-price-calculator-99c00bff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
