GET /account/margin-mode
Read the account default and effective margin mode
Read the account default and effective margin mode.
operationId: getMarginMode · CCXT method: fetchMarginMode
Declared server:
https://api.testnet.nexus.xyz/v1. See Networks.
Authentication: hmacAuth.
Returns the account-level default and the mode that governs the selected market. source states whether the effective result comes from the account default, an open position, or forced market policy. Only account_default is mutable through this route.
HMAC API key authentication. Send three headers:
X-API-Key: your key ID (e.g.nx_a1b2c3...)X-Timestamp: current time in unix millisecondsX-Signature:hex(hmac_sha256(secret, timestamp + "\n" + METHOD + "\n" + path + "\n" + query + "\n" + sha256_hex(body)))
Timestamp must be within 30 seconds of server time.
The key is network-scoped; the signature is not. The canonical string above has no network component, so the same signed request is byte-identical on every host. What stops a testnet key from authenticating against mainnet is that the key does not exist in that host's key store — sign only for the host that minted the key, and never replay a signed payload against another network. Presented to the wrong host, a key is refused with the same opaque 401 as an unknown key and must not be retried there. See “API keys are bound to one network” in the API description.
The account default and effective margin mode with its source.
True only when POST can change the effective result through the account default.
Invalid or unknown query fields, or a missing or malformed market_id.
Authentication failed. All 401 responses return the same opaque body to prevent information leakage. A credential minted on a different network is one of the causes it hides — by design, so that a key id cannot be probed for existence on another network. Do not retry it against another host.
MarketNotFound — no such market.
Rate limit exceeded. Retryable — honour retry-after and back off; this is what separates a 429 from the permanent 403 jurisdiction refusals. Branch on the body's code, which is always RATE_LIMIT_EXCEEDED, and on bucket to learn WHICH budget bottlenecked — the buckets are independent, so a caller at its read ceiling can still submit orders and should not back off the whole client. Do not parse message: it is a diagnostic whose wording is not stable. Requests are charged by weight, so exhausting a budget takes fewer heavy calls than x-ratelimit-limit suggests. See “Rate limits” in the API description.
An unexpected internal error while reading account or market risk state.
GET /v1/account/margin-mode?market_id=text HTTP/1.1
Host: api.testnet.nexus.xyz
X-API-Key: YOUR_API_KEY
Accept: */*
{
"market_id": "text",
"account_default": "cross",
"effective_mode": "cross",
"source": "account_default",
"mutable": true
}Test it cannot sign this request. X-Signature is an HMAC computed per call: see Authentication, or use an SDK.
API version 0.9.131
Last updated

