For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

Programmatic access to the Nexus Exchange — OpenAPI spec, SDKs, CLI, and MCP.

The Nexus Exchange is API-first: everything a trader can do is available programmatically. The Interfaces are the officially supported clients for that API — a machine-readable OpenAPI specification, language SDKs, a command-line tool, and an MCP server for AI agents. All of them speak to the same REST and WebSocket gateway documented under APIs & Rates; pick whichever fits how you build.

The OpenAPI specification

The API is contract-first. The machine-readable schema — every route, request/response body, and CCXT method mapping — is published at nexus-xyz/nexus-exchange-api and served live at /openapi.json. Releases are tracked on GitHub Releases. The SDKs, CLI, and MCP server below are all generated from — or pinned to — a released version of this spec, so they stay in lockstep with the gateway.

SDKs

Language
Repository
Use it for

Rust

nexus-exchange-rs

Latency-sensitive clients and market-making bots

TypeScript

nexus-exchange-ts

Web, Node, and edge applications

Python

nexus-exchange-py

Research, backtesting, and scripting

Each SDK handles request signing (HMAC), pagination, and the WebSocket subscription lifecycle so you don't reimplement them. Version support and breaking-change policy are documented in each repository's README.

For the account and portfolio surface — consolidated account state, the withdrawable balance, the fee schedule, enriched position risk fields, and the equity/PnL/volume time-series — see Portfolio & Account State, which covers all four interfaces together.

Command line

The nexus-exchange-cli wraps the same API for interactive use and shell scripting — manage keys, place and cancel orders, and query account state without writing code. nexus --version reports the API spec and SDK versions it is built against.

MCP server

The nexus-exchange-mcp server exposes the Exchange as Model Context Protocol tools, so an AI assistant or agent can trade and read account state through the same authenticated API a human client uses.

Choosing a network

The Exchange runs on Nexus Testnet today as a development preview, with a public mainnet to follow. Every interface targets one network at a time, selected by the gateway base URL it is pointed at — see APIs & Rates for the current base URL and the Quickstart for the end-to-end connection flow. Credentials are scoped to the network they are created on: a testnet API key is not valid against mainnet, and vice versa.

Authentication

Authentication is identical across every interface. You sign a fixed message with your wallet (EIP-191) to obtain a short-lived session token, use that token once to mint an HMAC API key, then sign each trading request with that key. The SDKs and CLI perform the request signing for you. The full walkthrough, with runnable examples, is in the Quickstart.

Status: development preview on testnet. The interfaces track the OpenAPI spec release-by-release; pin to a spec version in production and consult each repository's release notes before upgrading. Testnet credentials and balances have no real-world value.

Last updated