GaiaExGaiaEx
API

Spot Trading Orders & History

Execute spot trades on GaiaEx via API: place market and limit orders, cancel orders, and retrieve trade history.

AI AGENT READYEquip Claude Code, OpenAI Codex & Antigravity (`agy`) with Official GaiaEx Skills
CLAUDE CODESKILL.md
Claude SKILL.md

Drop-in Claude Code skill with HMAC-SHA256 signing, /fapi/v1 & /fapi/v2 schemas, and secret-redaction guardrails.

Raw ↗
OPENAI CODEXAGENTS.md
Codex AGENTS.md

Drop-in repository AGENTS.md for OpenAI Codex CLI — tick-size rules, rate-limit budgets, and self-custody boundaries.

Raw ↗
ANTIGRAVITYAGY.md
Antigravity AGY.md

Google Antigravity (agy) & Gemini agent spec with verified async Python WebSocket + REST execution templates.

Raw ↗
UNIVERSAL LLMllms.txt
/llms.txt Index

Single-URL machine-readable index of all GaiaEx documentation pages, OpenAPI 3.0 schema, and Postman collection.

Raw ↗

Overview

Spot Trading endpoints follow the industry-standard GaiaEx Spot API standard under both https://openapi.gaiaex.com/sapi/v1/* and https://openapi.gaiaex.com/api/v3/*.

All Spot Trading endpoints require the X-MBX-APIKEY header and an HMAC-SHA256 signature + timestamp query/form parameter. Your trading account address is automatically resolved server-side from the API key.

POST10/s key · 5/s IPhttps://openapi.gaiaex.com/sapi/v1/orderHMAC

New Spot Order (TRADE)

POST https://openapi.gaiaex.com/sapi/v1/order (or /api/v3/order)

Send in a new spot market or limit order.

Parameters (Query String or Form/JSON Body):

NameTypeMandatoryDescription
symbolSTRINGYESSpot pair (e.g. PURRUSDC, BTCUSDC)
sideENUMYESBUY or SELL
typeENUMYESLIMIT or MARKET
timeInForceENUMNOGTC or IOC (default GTC for LIMIT)
quantityDECIMALYESOrder quantity in base token units
priceDECIMALNOLimit price (required for LIMIT orders)
newClientOrderIdSTRINGNOUnique client order ID
recvWindowLONGNOMax 60000 (default 5000)
timestampLONGYESCurrent timestamp in milliseconds
signatureSTRINGYESHMAC-SHA256 hex digest of the query/form string

Example — Limit Buy:

curl -X POST "https://openapi.gaiaex.com/sapi/v1/order?symbol=PURRUSDC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1000&price=0.0550&timestamp=1743508800000&signature=YOUR_HMAC_SHA256_SIG" \
  -H "X-MBX-APIKEY: YOUR_API_KEY"

Response:

{
  "symbol": "PURRUSDC",
  "orderId": 555666777,
  "clientOrderId": "spot_order_1",
  "transactTime": 1743508800000,
  "price": "0.0550",
  "origQty": "1000",
  "executedQty": "0",
  "status": "NEW",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY"
}

Parameters

symbol
stringRequired

Spot symbol (e.g. PURRUSDC, BTCUSDC)

side
stringRequired

BUY or SELL

type
stringRequired

LIMIT or MARKET

quantity
stringRequired

Order quantity

price
stringOptional

Limit price

timestamp
intRequired

Request timestamp in ms

signature
stringRequired

HMAC-SHA256 signature

DELETE10/s key · 5/s IPhttps://openapi.gaiaex.com/sapi/v1/orderHMAC

Cancel Spot Order (TRADE)

DELETE https://openapi.gaiaex.com/sapi/v1/order (or /api/v3/order)

Cancel an active spot order by orderId or origClientOrderId.

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYESSpot pair (e.g. PURRUSDC)
orderIdLONGNOExchange order ID to cancel
origClientOrderIdSTRINGNOClient order ID to cancel
timestampLONGYESCurrent timestamp in milliseconds
signatureSTRINGYESHMAC-SHA256 signature

Response:

{
  "symbol": "PURRUSDC",
  "orderId": 555666777,
  "origClientOrderId": "spot_order_1",
  "status": "CANCELED",
  "origQty": "1000",
  "executedQty": "0",
  "type": "LIMIT",
  "side": "BUY"
}

Parameters

symbol
stringRequired

Spot symbol (e.g. PURRUSDC)

orderId
intRequired

Order ID to cancel

timestamp
intRequired

Request timestamp in ms

signature
stringRequired

HMAC-SHA256 signature

GET20/s IPhttps://openapi.gaiaex.com/sapi/v1/orderHMAC

Query Spot Order (USER_DATA)

GET https://openapi.gaiaex.com/sapi/v1/order (or /api/v3/order)

Check a spot order's status by orderId or origClientOrderId.

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYESSpot pair (e.g. PURRUSDC, BTCUSDC)
orderIdLONGNOExchange order ID
origClientOrderIdSTRINGNOClient order ID
recvWindowLONGNOMax 60000 (default 5000)
timestampLONGYESCurrent timestamp in milliseconds
signatureSTRINGYESHMAC-SHA256 signature

Response:

{
  "symbol": "PURRUSDC",
  "orderId": 555666777,
  "clientOrderId": "spot_order_1",
  "price": "0.0550",
  "origQty": "1000",
  "executedQty": "1000",
  "cummulativeQuoteQty": "55.00",
  "status": "FILLED",
  "timeInForce": "GTC",
  "type": "LIMIT",
  "side": "BUY",
  "time": 1743508800000,
  "updateTime": 1743508805000,
  "isWorking": false
}

Parameters

symbol
stringRequired

Spot symbol (e.g. PURRUSDC, BTCUSDC)

orderId
intOptional

Order ID to query

origClientOrderId
stringOptional

Client order ID to query

timestamp
intRequired

Request timestamp in ms

signature
stringRequired

HMAC-SHA256 signature

DELETE10/s key · 5/s IPhttps://openapi.gaiaex.com/sapi/v1/openOrdersHMAC

Cancel All Open Orders on a Symbol (TRADE)

DELETE https://openapi.gaiaex.com/sapi/v1/openOrders (or /api/v3/openOrders)

Cancels all active spot orders on a symbol.

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYESSpot pair (e.g. PURRUSDC)
timestampLONGYESCurrent timestamp in milliseconds
signatureSTRINGYESHMAC-SHA256 signature

Response:

[
  {
    "symbol": "PURRUSDC",
    "orderId": 555666777,
    "status": "CANCELED",
    "origQty": "1000",
    "side": "BUY",
    "type": "LIMIT"
  }
]

Parameters

symbol
stringRequired

Spot symbol (e.g. PURRUSDC)

timestamp
intRequired

Request timestamp in ms

signature
stringRequired

HMAC-SHA256 signature