ExchangeCredentials is a container that holds strongly-typed API credentials for every exchange supported by CryptoClients.Net. It is passed to IExchangeRestClient.SetApiCredentials, the tracker factory, or GlobalExchangeOptions at startup.
Creating credentials
There are three patterns for creating anExchangeCredentials instance.
Object initializer (recommended for known exchanges)
Set only the exchanges you need. All properties are nullable.CreateFrom(Dictionary<string, ApiCredentials>)
Build from a runtime dictionary — useful when exchange names and credentials are loaded from configuration.
CreateFrom(string, ApiCredentials)
Convenience overload for a single exchange.
Credential types by exchange
Different exchanges require different credential combinations. The table below summarises what each exchange’s credential type expects.| Exchange | Credential type | Required fields |
|---|---|---|
| Aster | AsterCredentials | API key, private key |
| Binance | BinanceCredentials | API key, API secret |
| BingX | BingXCredentials | API key, API secret |
| Bitfinex | BitfinexCredentials | API key, API secret |
| Bitget | BitgetCredentials | API key, API secret, passphrase |
| BitMart | BitMartCredentials | API key, API secret, memo |
| BitMEX | BitMEXCredentials | API key, API secret |
| Bitstamp | BitstampCredentials | API key, API secret |
| BloFin | BloFinCredentials | API key, API secret, passphrase |
| Bybit | BybitCredentials | API key, API secret |
| Coinbase | CoinbaseCredentials | API key, API secret |
| CoinEx | CoinExCredentials | API key, API secret |
| CoinGecko | CoinGeckoCredentials | API key only |
| CoinW | CoinWCredentials | API key, API secret |
| CryptoCom | CryptoComCredentials | API key, API secret |
| DeepCoin | DeepCoinCredentials | API key, API secret, passphrase |
| GateIo | GateIoCredentials | API key, API secret |
| HTX | HTXCredentials | API key, API secret |
| HyperLiquid | HyperLiquidCredentials | Wallet address, private key |
| Kraken | KrakenCredentials | API key, API secret (spot and/or futures) |
| Kucoin | KucoinCredentials | API key, API secret, passphrase |
| Mexc | MexcCredentials | API key, API secret |
| OKX | OKXCredentials | API key, API secret, passphrase |
| Polymarket | PolymarketCredentials | (See exchange docs) |
| Toobit | ToobitCredentials | API key, API secret |
| WhiteBit | WhiteBitCredentials | API key, API secret |
| XT | XTCredentials | API key, API secret |
Upbit does not support authenticated operations through the shared client at this time.
Code examples by credential type
API key + secret (Binance, Bybit, Kraken, HTX, GateIo, Mexc, …)
API key + secret (Binance, Bybit, Kraken, HTX, GateIo, Mexc, …)
API key + secret + passphrase (Kucoin, OKX, Bitget, BloFin, DeepCoin)
API key + secret + passphrase (Kucoin, OKX, Bitget, BloFin, DeepCoin)
Private key based (Aster, HyperLiquid)
Private key based (Aster, HyperLiquid)
Kraken (separate spot and futures credentials)
Kraken (separate spot and futures credentials)
Kraken issues separate API keys for spot and futures.
Applying credentials
At startup via GlobalExchangeOptions
At runtime via SetApiCredentials
Dynamic credentials
DynamicCredentials and DynamicCredentialInfo support scenarios where the exact exchange credential type is not known at compile time — for example, building a UI that accepts user-supplied keys.
DynamicCredentialInfo
Describes what fields are required for a given exchange and trading mode, so a UI can render the appropriate input fields.
Exchange name.
Human-readable label for the
Key field (e.g. "API Key" or "Wallet Address").Whether the first extra parameter is required.
Human-readable label for
Param1 (typically "API Secret" or "Private Key").Whether the second extra parameter is required.
Human-readable label for
Param2 (typically "Passphrase").Whether a third parameter is required.
Human-readable label for
Param3.DynamicCredentials
A generic credential bag. Populate only the fields required by the target exchange (use GetDynamicCredentialInfo to determine which).
Trading mode this credential is intended for.
The primary key field (API key, wallet address, etc.).
First parameter — typically the API secret or private key.
Second parameter — typically the passphrase.
Third parameter — exchange-specific.
CreateCredentialsForExchange
Converts a DynamicCredentials instance into the strongly-typed ApiCredentials subclass that the exchange expects.
Setting dynamic credentials at runtime
Full dynamic credential flow
Properties reference
Aster API credentials.
Binance API credentials.
BingX API credentials.
Bitfinex API credentials.
Bitget API credentials.
BitMart API credentials.
BitMEX API credentials.
Bitstamp API credentials.
BloFin API credentials.
Bybit API credentials.
Coinbase API credentials.
CoinEx API credentials.
CoinGecko API credentials (API key only).
CoinW API credentials.
Crypto.com API credentials.
DeepCoin API credentials.
Gate.io API credentials.
HTX API credentials.
HyperLiquid API credentials.
Kraken API credentials (supports separate spot and futures keys).
Kucoin API credentials.
Mexc API credentials.
OKX API credentials.
Polymarket API credentials.
Toobit API credentials.
WhiteBit API credentials.
XT API credentials.