← Back to Docs
REST API

REST API Reference

Build custom integrations with the OpenMM REST API.

🚧 Coming Soon

REST API is planned for a future release. Currently OpenMM works via CLI and MCP tools.

Base URL

When running locally:

http://localhost:3000

Start the server with openmm init or npx @qbt-labs/openmm init

Authentication

Market data endpoints (ticker, orderbook, trades) are public and don't require authentication.

For authenticated endpoints (balance, orders), pass your exchange credentials via headers:

curl -H "X-Exchange-Key: $MEXC_API_KEY" \
     -H "X-Exchange-Secret: $MEXC_SECRET" \
     "http://localhost:3000/api/balance?exchange=mexc"

Endpoints

GET/api/ticker

Get current price, bid/ask, spread, and 24h volume for a trading pair

Parameters

NameTypeRequiredDescription
exchangestringYesExchange id (mexc, gateio, kraken, bitget)
symbolstringYesTrading pair (e.g., BTC/USDT)

Example Request

curl "http://localhost:3000/api/ticker?exchange=mexc&symbol=BTC/USDT"

Example Response

{
  "symbol": "BTC/USDT",
  "price": 97234.50,
  "bid": 97230.00,
  "ask": 97235.00,
  "spread": 0.005,
  "volume24h": 1234567.89
}
GET/api/orderbook

Get the order book (bids and asks) for a trading pair

Parameters

NameTypeRequiredDescription
exchangestringYesExchange id
symbolstringYesTrading pair
limitnumberNoNumber of levels (default: 10)

Example Request

curl "http://localhost:3000/api/orderbook?exchange=mexc&symbol=BTC/USDT&limit=5"

Example Response

{
  "bids": [
    { "price": 97230.00, "amount": 1.5 },
    { "price": 97225.00, "amount": 2.3 }
  ],
  "asks": [
    { "price": 97235.00, "amount": 0.8 },
    { "price": 97240.00, "amount": 1.2 }
  ]
}
GET/api/balance

Get account balances for a supported exchange

Parameters

NameTypeRequiredDescription
exchangestringYesExchange id
assetstringNoFilter by specific asset

Example Request

curl -H "Authorization: Bearer $API_KEY" "http://localhost:3000/api/balance?exchange=mexc"

Example Response

{
  "balances": [
    { "asset": "BTC", "free": 1.5, "locked": 0.1 },
    { "asset": "USDT", "free": 10000.00, "locked": 500.00 }
  ]
}
GET/api/trades

Get recent trades for a trading pair with buy/sell breakdown

Parameters

NameTypeRequiredDescription
exchangestringYesExchange id
symbolstringYesTrading pair
limitnumberNoNumber of trades (default: 50)

Example Request

curl "http://localhost:3000/api/trades?exchange=mexc&symbol=BTC/USDT&limit=10"

Example Response

{
  "trades": [
    { "id": "123", "price": 97234.50, "amount": 0.5, "side": "buy", "timestamp": 1709856000000 },
    { "id": "124", "price": 97230.00, "amount": 1.2, "side": "sell", "timestamp": 1709855990000 }
  ]
}
GET/api/cardano/price

Get Cardano token price from DEX aggregation (TOKEN/USDT via TOKEN/ADA × ADA/USDT)

Parameters

NameTypeRequiredDescription
symbolstringYesCardano token symbol (e.g., SNEK, INDY)

Example Request

curl "http://localhost:3000/api/cardano/price?symbol=SNEK"

Example Response

{
  "symbol": "SNEK",
  "priceAda": 0.00045,
  "priceUsdt": 0.00032,
  "adaUsdtRate": 0.71
}

Next Steps