API Overview
GMX exposes several integration points for developers, integrators, and AI agents building on the protocol. Start with the integration surface that matches your task instead of trying to use one API for everything.
For AI agent frameworks with pre-built trading skills, see AI Agents.
Available APIs
GMX offers four integration points depending on the type of data or action you need.
HTTP APIs
GMX provides two HTTP API surfaces. The GMX API is under active development and will become the primary HTTP integration point. Use the GMX API for app-level HTTP integrations, account data, order data, analytics, and API-relayed order workflows. Use the Oracle API for stable read-only oracle, market, liquidity, and APY snapshots served from chain-specific gmxinfra.io hosts.
| GMX API — OpenAPI Reference | Oracle API — endpoint docs | |
|---|---|---|
| Base URLs | https://{chain}.gmxapi.io/v1 and https://{chain}.gmxapi.ai/v1 — two independent peer regions per chain. Use either; clients integrating directly should treat both as equal. | https://{chain}-api.gmxinfra.io primary hosts with documented fallback URLs |
| Data | Markets, tickers, tokens, positions, orders, rates, APY, performance, wallet balances, allowances, staking power, buyback stats, JIT liquidity, subaccounts, and order transaction workflows. | Oracle prices, markets, liquidity |
| Status | Expanding | Stable |
The /v1 path in the gmxapi.io and gmxapi.ai base URLs is part of the GMX API deployment path. In these docs, Oracle API refers to the chain-specific HTTP endpoints on gmxinfra.io.
Other integration points
- Contracts — Interact directly with ExchangeRouter, Reader, and GlvReader contracts on-chain.
- GraphQL — Historical on-chain data via Subsquid endpoints.
- Integration pair feed — Public pair-summary endpoints for exchange and aggregator listings:
https://gmx-integration-cg.vercel.app/api/arbitrum/pairsandhttps://gmx-integration-cg.vercel.app/api/avalanche/pairs. Treat these as a narrow pair feed, not a general-purpose API.
Start here
- Integration guide — "I want to do X" workflows, cache and retry guidance, and when to use the GMX API, Oracle API, GraphQL, or the SDK
- Getting GM and GLV token prices — How to choose between Chainlink Data Feeds, Reader contracts, and API/SDK data for GM/GLV valuation
- Troubleshooting — What to do when reads look stale, validation fails, or write-path state does not appear yet
- GMX API OpenAPI Reference — Generated endpoint schemas for the current GMX API surface
- Oracle API — Manual docs for prices, markets, liquidity, and fallback URLs
TypeScript SDK
The @gmx-io/sdk package provides a high-level TypeScript interface that wraps these APIs. It ships two clients: SDK v1 (GmxSdk) for direct RPC-backed reads and writes, and SDK v2 (GmxApiSdk) for HTTP-backed reads, wallet helpers, subaccount helpers, and API-relayed order workflows. The current SDK v2 surface covers markets, tickers, tokens, pairs, rates, APY, performance, positions, orders, OHLCV, buyback stats, staking power, wallet balances, allowances, approval transaction building, and signed order submission. See the SDK docs for details.
The generated GMX API reference is generated from the OpenAPI spec and is the best source for raw HTTP schemas. The SDK pages are the best source for typed client method names, bigint parsing, signing helpers, and end-to-end TypeScript workflows.
Supported networks
GMX V2 is deployed on the following networks.
- Arbitrum One
- Avalanche C-Chain
- Botanix
- MegaETH
Not every API surface is available on every deployed network. Check the specific GMX API, Oracle API, GraphQL, or SDK page you plan to use before wiring a production integration.
For contract and API update announcements, see Updates and Support.
AI agent integration
GMX's oracle-based pricing and two-phase execution model make it well-suited for autonomous trading agents. For pre-built agent plugins that bundle SDK references, API endpoints, contract addresses, and order specifications, see the AI Agents section. This documentation site also generates LLM-friendly bundles at llms.txt and llms-full.txt for direct model consumption.