{"uid":"cap_kvoRhMpQrIvSEgeMzEsVW","slug":"delx-commerce-order-book-mid-price-calculator-ffb34f54","name":"Delx Commerce — Order Book Mid Price Calculator","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/ob-mid-from-levels?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"ask":{"type":"number","description":"Best ask price (top of book)"},"bid":{"type":"number","description":"Best bid price (top of book)"}}},"responseSchema":{"type":"json","example":{"ask":100.2,"bid":100,"mid":100.1,"schema":"delx/util-ob-mid-from-levels/v1","spread_abs":0.2000000000000028,"spread_bps":19.98001998002027}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_1JuIOtijU8BME2gcgDGNs","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the mid price, absolute spread, and spread in basis points from a best bid and best ask price pair","exampleAgentPrompt":"Calculate the mid price and spread for a market where the best bid is 100 and the best ask is 100.2.","exampleUseCases":[{"title":"Crypto order book mid price","prompt":"I have a BTC/USDC order book where the top bid is 67450.50 and the top ask is 67451.80 — what's the mid price and spread in bps?"},{"title":"Spread monitoring for trading bot","prompt":"My algo needs the mid price and spread in basis points for a market with best bid 1.0042 and best ask 1.0045 — can you calculate that?"},{"title":"Fair value estimation for options pricing","prompt":"I'm pricing an option and need the mid of the underlying: best bid is 3210.00 and best ask is 3210.75. What's the mid and absolute spread?"}],"resultDescription":"Returns a JSON object containing the echo of ask and bid inputs, the computed mid price (arithmetic mean of bid and ask), the absolute spread (ask minus bid), and the spread in basis points (spread relative to mid price), all under the schema identifier delx/util-ob-mid-from-levels/v1.","failureModes":["Missing bid or ask field returns a validation error","Non-numeric values for bid or ask cause a parsing error","Ask price lower than bid price may produce a negative spread but does not error","Payment failure via x402 returns HTTP 402 before computation occurs"],"whenToPreferThis":"Use this endpoint when you need a fast, cheap, verifiable micro-computation of mid price and spread metrics from raw top-of-book bid/ask levels without setting up any infrastructure or account. It is ideal for AI agents that handle order book data on a per-call basis and want pay-per-result pricing in USDC with no subscription overhead. Prefer it over building your own arithmetic when you need a standardized, schema-versioned output that can be audited downstream.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:54:04.440Z","isFirstParty":false,"canonicalSlug":"delx-commerce-order-book-mid-price-calculator-ffb34f54"}