Base URLs

All REST endpoints live under a single versioned gateway. All WebSocket traffic runs on a single multiplexed socket.

Gateway

Mainnet

TransportBase URL
RESThttps://api.godarkdex.com/api/v1
WebSocketwss://api.godarkdex.com/ws/v1

Testnet

TransportBase URL
RESThttps://api.godarkdex-testnet.com/api/v1
WebSocketwss://api.godarkdex-testnet.com/ws/v1

API keys, bearer tokens, and balances are not shared between mainnet and testnet — credentials issued on one environment will not authenticate against the other.

All REST examples in these docs omit the base URL for brevity and default to mainnet. A request shown as POST /orders means POST https://api.godarkdex.com/api/v1/orders on mainnet or POST https://api.godarkdex-testnet.com/api/v1/orders on testnet.

Endpoint Reference

REST

MethodPathAuthPurpose
POST/auth/tokenExchange api_key + api_secret + passphrase for bearer token
POST/auth/token/revokeRevoke a bearer token
GET/instrumentsList all tradable instruments
GET/instruments/{symbol}Single instrument detail
POST/ordersBearerPlace an order
DELETE/orders/{orderId}BearerCancel an order
PATCH/orders/{orderId}BearerModify an order
GET/orders/{orderId}BearerFetch a single order by id
POST/orders/mass-quoteBearerBatch cancel-replace (Prime and Apex tiers)
GET/positionsBearerSnapshot of open positions
GET/accountBearerBalance, VIP tier, and account-level config in one call
GET/account/vipBearerCurrent VIP tier and rolling 30d volume
GET/vip/tiersPublic fee schedule for all tiers
GET/transparencySingle public transparency snapshot: reserves root, engine attestation, and aggregate stats (supports ?epoch= and ?window=)
GET/settlement/status/{batchId}BearerBatch settlement status

WebSocket

One endpoint, one socket per session. Ops and channels are multiplexed:

wss://api.godarkdex.com/ws/v1
Op / ChannelDirectionPurpose
op: loginClient → ServerAuthenticate the socket using a bearer token
op: logoutClient → ServerEnd the session cleanly
op: ping / pongBothHeartbeat
op: subscribe / unsubscribeClient → ServerManage channel subscriptions
op: account.infoClient → ServerFetch balance, VIP tier, and account config (mirrors GET /account)
op: order.place / order.cancel / order.modifyClient → ServerTrading (mirrors REST)
channel: ordersServer → ClientSnapshot + incremental order updates
channel: positionsServer → ClientSnapshot + incremental position updates

See WebSocket Trading, Orders Channel, and Positions Channel for message schemas.

Common Headers

All authenticated REST requests require:

Content-Type: application/json
Authorization: Bearer <access_token>

All responses include:

HeaderPurpose
X-Request-IdUnique id for this request. Echo in bug reports.
X-RateLimit-LimitRequest budget for the current window.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetUnix seconds when the window resets.

Response format

All REST responses share the same JSON shape:

{
  "code": 0,
  "data": { },
  "timestamp": "2026-04-20T10:30:00.123Z",
  "request_id": "req_01HXYZ..."
}

On error:

{
  "code": 1410,
  "message": "Margin insufficient",
  "timestamp": "2026-04-20T10:30:00.123Z",
  "request_id": "req_01HXYZ..."
}

See Error Codes for the code reference.

Server Time

GET /time

Returns server time (useful for clock-skew diagnostics and signing windows).

{
  "code": 0,
  "data": {
    "server_time": "2026-04-20T10:30:00.123Z",
    "server_time_ns": 1839975000123000000
  }
}