This guide walks you through everything you need to go from zero to placing your first live order on Bullish. By the end you will have generated an API key, obtained a JWT session token, looked up your trading account ID, retrieved the current nonce range, and submitted a limit order — all via the REST Trading API.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bullish-exchange/api-docs/llms.txt
Use this file to discover all available pages before exploring further.
Generate an API Key
Before you can call any authenticated endpoint you need an API key. Bullish supports two key types:
- ECDSA — A P-256 public/private key pair. Supports both trading and custody endpoints.
- HMAC — A shared secret key. Supports trading endpoints only.
- Log in to your Bullish account
- Click your account initials in the upper-right corner, then click Settings
- Click API Keys, then click Add API Key
- Select the key type — ECDSA or HMAC
- Enter a name in the Key Name field
- Optionally add an IP whitelist. If set, all login requests must originate from within that range
- Click Generate API Key and securely store the credentials
ECDSA keys include a
metadata field. Base64-decode it to extract your userId, which is required when calling the ECDSA login endpoint:Obtain a JWT Token
All authenticated API requests require an ECDSA request body fields:
HMAC request headers:
Both endpoints return the same response:Save both values —
Authorization: Bearer <JWT_TOKEN> header. The JWT is valid for 24 hours.Choose the login method that matches your key type.| Field | Description |
|---|---|
publicKey | Your ECDSA public key (PEM format, UNIX newline encoded) |
signature | Signed JSON string of loginPayload using your ECDSA private key |
loginPayload.userId | Your user ID extracted from the ECDSA key metadata |
loginPayload.nonce | Current epoch timestamp in seconds (unrelated to the orders API nonce) |
loginPayload.expirationTime | Epoch timestamp in seconds, set 5 minutes in the future |
loginPayload.biometricsUsed | Always false |
loginPayload.sessionKey | Always null |
| Header | Description |
|---|---|
BX-TIMESTAMP | Milliseconds since EPOCH |
BX-NONCE | Client-side incremented 64-bit unsigned integer |
BX-PUBLIC-KEY | Your HMAC public key |
BX-SIGNATURE | HMAC signature of timestamp + nonce + "GET" + "/trading-api/v1/users/hmac/login" |
token is used in the Authorization header and authorizer is embedded in signed request payloads.Get Your Trading Account IDs
Most trading endpoints require a Response (array of trading accounts):Note the
tradingAccountId. Retrieve all trading accounts associated with your API key:tradingAccountId and rateLimitToken values — you will need them in later steps. You can also pass the rateLimitToken in the BX-RATELIMIT-TOKEN request header to unlock higher rate limit tiers.Get the Current Nonce Range
Every authenticated write request (order creation, cancellation, etc.) requires a Response:
Your
BX-NONCE header. The nonce is a unique, client-side incremented 64-bit unsigned integer. The exchange enforces a valid range that is updated daily.Retrieve the current nonce range before sending your first order:| Field | Description |
|---|---|
lowerBound | Start of today in EPOCH microseconds — the minimum valid nonce value |
upperBound | End of today in EPOCH microseconds — the maximum valid nonce value |
BX-NONCE value for each request must:- Fall within
[lowerBound, upperBound] - Be strictly greater than the nonce used in your previous request
- Be unique (no reuse)
Place an Order
With a valid JWT, trading account ID, and a nonce in hand, you can now place an order. The example below places a BTC/USD limit buy order at a price of Submit the order:Successful response (HTTP 200):A
55071.5000 for a quantity of 1.87000000 BTC with a GTC (good-till-cancelled) time-in-force.Construct the request body (the command):200 response means the exchange has acknowledged the command. Use the returned orderId to poll GET /trading-api/v2/orders/ to confirm the order’s current status.Supported timeInForce values:| Value | Meaning |
|---|---|
GTC | Good Till Cancelled — stays open until filled or cancelled |
FOK | Fill or Kill — cancelled immediately if it cannot be fully filled |
IOC | Immediate or Cancel — filled in full or in part; remainder is cancelled |
Sandbox environments are available for testing before going live. Use
https://api.simnext.bullish-test.com/trading-api as the base URL to run the same steps against simulated data without risking real funds. See the Environments page for all available sandbox URLs.