XT.Net AI API Quick Map

June 29, 2026 ยท View on GitHub

Use this file to route common user intents to the correct XT.Net client member. If a method name or parameter is not listed here, inspect XT.Net/Interfaces/Clients/** before generating code.

Client Roots

IntentUse
REST callsnew XTRestClient()
WebSocket streamsnew XTSocketClient()
API key authenticationoptions.ApiCredentials = new XTCredentials("key", "secret")
Live environmentXTEnvironment.Live
Custom environmentXTEnvironment.CreateCustom(...)
Dependency injectionservices.AddXT(options => { ... })
Spot REST APIclient.SpotApi
USDT-M Futures REST APIclient.UsdtFuturesApi
Coin-M Futures REST APIclient.CoinFuturesApi
Spot socket APIsocketClient.SpotApi
Futures socket APIsocketClient.FuturesApi

Spot REST

Spot source examples use symbols like eth_usdt.

User intentXT.Net member
Get server timeclient.SpotApi.ExchangeData.GetServerTimeAsync()
Get client IPclient.SpotApi.ExchangeData.GetClientIpAsync()
Get spot symbolsclient.SpotApi.ExchangeData.GetSymbolsAsync()
Get info for one spot symbolclient.SpotApi.ExchangeData.GetSymbolsAsync(symbol: "eth_usdt")
Get spot order bookclient.SpotApi.ExchangeData.GetOrderBookAsync("eth_usdt", limit: 100)
Get spot klines/candlesclient.SpotApi.ExchangeData.GetKlinesAsync("eth_usdt", KlineInterval.OneMinute)
Get recent spot tradesclient.SpotApi.ExchangeData.GetRecentTradesAsync("eth_usdt")
Get spot trade historyclient.SpotApi.ExchangeData.GetTradeHistoryAsync("eth_usdt")
Get spot tickerclient.SpotApi.ExchangeData.GetTickersAsync("eth_usdt")
Get all spot tickersclient.SpotApi.ExchangeData.GetTickersAsync()
Get spot price tickerclient.SpotApi.ExchangeData.GetPriceTickersAsync("eth_usdt")
Get spot book tickerclient.SpotApi.ExchangeData.GetBookTickersAsync("eth_usdt")
Get 24h spot tickerclient.SpotApi.ExchangeData.Get24HTickersAsync("eth_usdt")
Get assetsclient.SpotApi.ExchangeData.GetAssetsAsync()
Get asset network infoclient.SpotApi.ExchangeData.GetAssetNetworksAsync()
Get one spot balanceclient.SpotApi.Account.GetBalanceAsync("usdt")
Get spot balancesclient.SpotApi.Account.GetBalancesAsync()
Get deposit addressclient.SpotApi.Account.GetDepositAddressAsync(asset, network)
Get deposit historyclient.SpotApi.Account.GetDepositHistoryAsync(asset, network)
Withdraw assetclient.SpotApi.Account.WithdrawAsync(asset, network, address, quantity)
Get withdrawal historyclient.SpotApi.Account.GetWithdrawalHistoryAsync(asset, network)
Transfer between account typesclient.SpotApi.Account.TransferAsync(asset, from, to, quantity, clientId)
Transfer to subaccountclient.SpotApi.Account.SubAccountTransferAsync(...)
Get spot private socket tokenclient.SpotApi.Account.GetWebsocketTokenAsync()
Place spot orderclient.SpotApi.Trading.PlaceOrderAsync(...)
Query spot order by idclient.SpotApi.Trading.GetOrderAsync(orderId)
Query spot order by client idclient.SpotApi.Trading.GetOrderByClientOrderIdAsync(clientOrderId)
Cancel spot orderclient.SpotApi.Trading.CancelOrderAsync(orderId)
Get open spot ordersclient.SpotApi.Trading.GetOpenOrdersAsync(...)
Get closed spot ordersclient.SpotApi.Trading.GetClosedOrdersAsync(...)
Cancel all spot ordersclient.SpotApi.Trading.CancelAllOrdersAsync(BusinessType.Spot, symbol: "eth_usdt")
Edit spot orderclient.SpotApi.Trading.EditOrderAsync(orderId, quantity, price)
Get multiple spot ordersclient.SpotApi.Trading.GetOrdersAsync(orderIds)
Cancel multiple spot ordersclient.SpotApi.Trading.CancelOrdersAsync(orderIds)
Get spot user tradesclient.SpotApi.Trading.GetUserTradesAsync(...)

USDT-M Futures REST

Use CoinFuturesApi instead of UsdtFuturesApi for Coin-M futures. The futures REST interface shape is shared.

User intentXT.Net member
Get futures server timeclient.UsdtFuturesApi.ExchangeData.GetServerTimeAsync()
Get futures client IPclient.UsdtFuturesApi.ExchangeData.GetClientIpAsync()
Get futures quote assetsclient.UsdtFuturesApi.ExchangeData.GetSymbolAssetsAsync()
Get one futures symbolclient.UsdtFuturesApi.ExchangeData.GetSymbolAsync("ETH_USDT")
Get futures symbolsclient.UsdtFuturesApi.ExchangeData.GetSymbolsAsync()
Get leverage bracket for symbolclient.UsdtFuturesApi.ExchangeData.GetLeverageBracketsAsync("ETH_USDT")
Get all leverage bracketsclient.UsdtFuturesApi.ExchangeData.GetLeverageBracketsAsync()
Get futures tickerclient.UsdtFuturesApi.ExchangeData.GetTickerAsync("ETH_USDT")
Get all futures tickersclient.UsdtFuturesApi.ExchangeData.GetTickersAsync()
Get futures recent tradesclient.UsdtFuturesApi.ExchangeData.GetRecentTradesAsync("ETH_USDT")
Get futures order bookclient.UsdtFuturesApi.ExchangeData.GetOrderBookAsync("ETH_USDT")
Get index priceclient.UsdtFuturesApi.ExchangeData.GetIndexPriceAsync("ETH_USDT")
Get all index pricesclient.UsdtFuturesApi.ExchangeData.GetIndexPricesAsync()
Get mark priceclient.UsdtFuturesApi.ExchangeData.GetMarkPriceAsync("ETH_USDT")
Get all mark pricesclient.UsdtFuturesApi.ExchangeData.GetMarkPricesAsync()
Get futures klinesclient.UsdtFuturesApi.ExchangeData.GetKlinesAsync("ETH_USDT", FuturesKlineInterval.OneMinute)
Get futures market infoclient.UsdtFuturesApi.ExchangeData.GetMarketInfoAsync("ETH_USDT")
Get all futures market infoclient.UsdtFuturesApi.ExchangeData.GetMarketInfosAsync()
Get funding rateclient.UsdtFuturesApi.ExchangeData.GetFundingRateAsync("ETH_USDT")
Get futures book tickerclient.UsdtFuturesApi.ExchangeData.GetBookTickerAsync("ETH_USDT")
Get all futures book tickersclient.UsdtFuturesApi.ExchangeData.GetBookTickersAsync()
Get funding rate historyclient.UsdtFuturesApi.ExchangeData.GetFundingRateHistoryAsync("ETH_USDT")
Get risk balanceclient.UsdtFuturesApi.ExchangeData.GetRiskBalanceAsync("ETH_USDT")
Get open interestclient.UsdtFuturesApi.ExchangeData.GetOpenInterestAsync("ETH_USDT")
Get futures symbol infoclient.UsdtFuturesApi.ExchangeData.GetSymbolInfoAsync()
Get futures balancesclient.UsdtFuturesApi.Account.GetBalancesAsync()
Get futures account infoclient.UsdtFuturesApi.Account.GetAccountInfoAsync()
Get futures user assetclient.UsdtFuturesApi.Account.GetUserAssetAsync("USDT")
Get futures user assetsclient.UsdtFuturesApi.Account.GetUserAssetsAsync()
Get futures account billsclient.UsdtFuturesApi.Account.GetAccountBillsAsync()
Get funding fee historyclient.UsdtFuturesApi.Account.GetFundingFeeHistoryAsync()
Get futures fee rateclient.UsdtFuturesApi.Account.GetFeeRateAsync()
Set leverageclient.UsdtFuturesApi.Account.SetLeverageAsync("ETH_USDT", PositionSide.Long, 5)
Adjust marginclient.UsdtFuturesApi.Account.AdjustMarginAsync(...)
Get ADL infoclient.UsdtFuturesApi.Account.GetAdlInfoAsync()
Set position typeclient.UsdtFuturesApi.Account.SetPositionTypeAsync(...)
Get futures private socket listen keyclient.UsdtFuturesApi.Account.GetListenKeyAsync()
Place futures orderclient.UsdtFuturesApi.Trading.PlaceOrderAsync(...)
Place multiple futures ordersclient.UsdtFuturesApi.Trading.PlaceMultipleOrdersAsync(orders)
Edit futures orderclient.UsdtFuturesApi.Trading.EditOrderAsync(...)
Get closed futures ordersclient.UsdtFuturesApi.Trading.GetClosedOrdersAsync(...)
Get futures user tradesclient.UsdtFuturesApi.Trading.GetUserTradesAsync(...)
Query futures orderclient.UsdtFuturesApi.Trading.GetOrderAsync(orderId)
Get futures ordersclient.UsdtFuturesApi.Trading.GetOrdersAsync(...)
Cancel futures orderclient.UsdtFuturesApi.Trading.CancelOrderAsync(orderId)
Cancel all futures ordersclient.UsdtFuturesApi.Trading.CancelAllOrdersAsync("ETH_USDT")
Get open futures positionsclient.UsdtFuturesApi.Trading.GetPositionsAsync("ETH_USDT")
Get futures position infoclient.UsdtFuturesApi.Trading.GetPositionsInfoAsync("ETH_USDT")
Close all positionsclient.UsdtFuturesApi.Trading.CloseAllPositionsAsync()
Get margin call infoclient.UsdtFuturesApi.Trading.GetMarginCallInfoAsync("ETH_USDT")
Place trigger orderclient.UsdtFuturesApi.Trading.PlaceTriggerOrderAsync(...)
Cancel trigger orderclient.UsdtFuturesApi.Trading.CancelTriggerOrderAsync(orderId)
Cancel all trigger ordersclient.UsdtFuturesApi.Trading.CancelAllTriggerOrdersAsync("ETH_USDT")
Get trigger ordersclient.UsdtFuturesApi.Trading.GetTriggerOrdersAsync(...)
Get trigger orderclient.UsdtFuturesApi.Trading.GetTriggerOrderAsync(orderId)
Get closed trigger ordersclient.UsdtFuturesApi.Trading.GetClosedTriggerOrdersAsync(...)
Place stop-limit orderclient.UsdtFuturesApi.Trading.PlaceStopLimitOrderAsync(...)
Cancel stop-limit orderclient.UsdtFuturesApi.Trading.CancelStopLimitOrderAsync(orderId)
Get stop-limit ordersclient.UsdtFuturesApi.Trading.GetStopLimitOrdersAsync(...)
Place track orderclient.UsdtFuturesApi.Trading.PlaceTrackOrderAsync(...)
Cancel track orderclient.UsdtFuturesApi.Trading.CancelTrackOrderAsync(orderId)
Get track orderclient.UsdtFuturesApi.Trading.GetTrackOrderAsync(orderId)
Get open track ordersclient.UsdtFuturesApi.Trading.GetOpenTrackOrdersAsync(...)
Get closed track ordersclient.UsdtFuturesApi.Trading.GetClosedTrackOrdersAsync(...)

Coin-M Futures REST

User intentXT.Net member
Coin-M futures market dataclient.CoinFuturesApi.ExchangeData.*
Coin-M futures account callsclient.CoinFuturesApi.Account.*
Coin-M futures trading callsclient.CoinFuturesApi.Trading.*
Coin-M shared REST clientclient.CoinFuturesApi.SharedClient

Spot WebSocket

User intentXT.Net member
Subscribe spot trade updatessocketClient.SpotApi.SubscribeToTradeUpdatesAsync("eth_usdt", handler)
Subscribe many spot trade updatessocketClient.SpotApi.SubscribeToTradeUpdatesAsync(symbols, handler)
Subscribe spot kline updatessocketClient.SpotApi.SubscribeToKlineUpdatesAsync("eth_usdt", KlineInterval.OneMinute, handler)
Subscribe spot order book updatessocketClient.SpotApi.SubscribeToOrderBookUpdatesAsync("eth_usdt", depth, handler)
Subscribe spot incremental order book updatessocketClient.SpotApi.SubscribeToIncrementalOrderBookUpdatesAsync("eth_usdt", handler)
Subscribe spot ticker updatessocketClient.SpotApi.SubscribeToTickerUpdatesAsync("eth_usdt", handler)
Subscribe spot balance updatessocketClient.SpotApi.SubscribeToBalanceUpdatesAsync(token, handler)
Subscribe spot order updatessocketClient.SpotApi.SubscribeToOrderUpdatesAsync(token, handler)
Subscribe spot user trade updatessocketClient.SpotApi.SubscribeToUserTradeUpdatesAsync(token, handler)

Private spot streams require token = await restClient.SpotApi.Account.GetWebsocketTokenAsync().

Futures WebSocket

User intentXT.Net member
Subscribe futures tradessocketClient.FuturesApi.SubscribeToTradeUpdatesAsync("ETH_USDT", handler)
Subscribe futures klinessocketClient.FuturesApi.SubscribeToKlineUpdatesAsync("ETH_USDT", KlineInterval.OneMinute, handler)
Subscribe futures tickersocketClient.FuturesApi.SubscribeToTickerUpdatesAsync("ETH_USDT", handler)
Subscribe futures aggregated tickersocketClient.FuturesApi.SubscribeToAggregatedTickerUpdatesAsync("ETH_USDT", handler)
Subscribe futures index pricesocketClient.FuturesApi.SubscribeToIndexPriceUpdatesAsync("ETH_USDT", handler)
Subscribe futures mark pricesocketClient.FuturesApi.SubscribeToMarkPriceUpdatesAsync("ETH_USDT", handler)
Subscribe futures incremental order booksocketClient.FuturesApi.SubscribeToIncrementalOrderBookUpdatesAsync("ETH_USDT", updateInterval, handler)
Subscribe futures order booksocketClient.FuturesApi.SubscribeToOrderBookUpdatesAsync("ETH_USDT", depth, updateInterval, handler)
Subscribe futures funding ratesocketClient.FuturesApi.SubscribeToFundingRateUpdatesAsync("ETH_USDT", handler)
Subscribe futures balance updatessocketClient.FuturesApi.SubscribeToBalancesUpdatesAsync(listenKey, handler)
Subscribe futures position updatessocketClient.FuturesApi.SubscribeToPositionUpdatesAsync(listenKey, handler)
Subscribe futures order updatessocketClient.FuturesApi.SubscribeToOrderUpdatesAsync(listenKey, handler)
Subscribe futures user trade updatessocketClient.FuturesApi.SubscribeToUserTradeUpdatesAsync(listenKey, handler)
Subscribe futures notification updatessocketClient.FuturesApi.SubscribeToNotificationUpdatesAsync(listenKey, handler)

Private futures streams require listenKey = await restClient.UsdtFuturesApi.Account.GetListenKeyAsync().

SharedApis

User intentXT.Net member or interface
Shared spot REST clientnew XTRestClient().SpotApi.SharedClient
Shared USDT-M futures REST clientnew XTRestClient().UsdtFuturesApi.SharedClient
Shared Coin-M futures REST clientnew XTRestClient().CoinFuturesApi.SharedClient
Shared spot socket clientnew XTSocketClient().SpotApi.SharedClient
Shared futures socket clientnew XTSocketClient().FuturesApi.SharedClient
Shared spot ticker RESTISpotTickerRestClient.GetSpotTickerAsync(new GetTickerRequest(symbol))
Shared spot order RESTISpotOrderRestClient.PlaceSpotOrderAsync(...)
Shared futures ticker RESTIFuturesTickerRestClient.GetFuturesTickerAsync(...)
Shared futures order RESTIFuturesOrderRestClient.PlaceFuturesOrderAsync(...)
Shared ticker socketITickerSocketClient.SubscribeToTickerUpdatesAsync(...)
Shared order book socketIOrderBookSocketClient.SubscribeToOrderBookUpdatesAsync(...)
Discover shared capabilitiesclient.SpotApi.SharedClient.Discover() or the equivalent futures/socket SharedClient root

For shared socket subscriptions, keep the concrete XTSocketClient and unsubscribe with await socketClient.UnsubscribeAsync(subscription.Data).

Result Handling

SituationPattern
REST success checkDirect and shared REST methods return HttpResult<T> / HttpResult
Socket subscription success checkDirect and shared subscriptions return WebSocketResult<UpdateSubscription>
Generic success checkif (!result.Success) { Console.WriteLine(result.Error); return; }
Read result dataRead result.Data only after result.Success
Retry decisionRetry only when result.Error?.IsTransient == true
CancellationPass ct: cancellationToken

Common Routing Pitfalls

Do not useUse instead
Raw HttpClientXTRestClient / XTSocketClient
ApiCredentialsXTCredentials
XTClientXTRestClient / XTSocketClient
socketClient.UsdtFuturesApisocketClient.FuturesApi
socketClient.CoinFuturesApisocketClient.FuturesApi
SpotApi.MarginSpotApi.Account / SpotApi.Trading with BusinessType.Leverage where supported
.Data without .Success checkCheck .Success first
Private spot stream without tokenSpotApi.Account.GetWebsocketTokenAsync() then subscribe
Private futures stream without listen keyUsdtFuturesApi.Account.GetListenKeyAsync() then subscribe
Inventing testnet environmentXTEnvironment.Live or XTEnvironment.CreateCustom(...)