Cryptora Institutional API
Run sub-accounts, move funds between them, place orders in batches and follow your orders and balances live, from your own programs. Base URL: https://cryptora.dev
Overview
This API builds on the standard one in the API documentation: the same keys, the same signing, the same /api/v1 endpoints for balances, orders and fills. On top it adds:
- Ed25519 keys next to HMAC keys: the private key never leaves your server.
- Sub-accounts by API: create, rename, freeze and close them, and give them their own keys.
- Transfers between your main account and its sub-accounts, with your own reference for safe retries.
- Up to 10 orders in one request, and cancelling every open order of a market at once.
- A user data stream over WebSocket: order changes, balances and transfers as they happen.
- A higher rate limit for your account when the platform raises your tier.
Every answer is JSON with ok true or false. A refusal carries code and error. Accounts are named by their public UID, never by an internal id.
Keys and permissions
Make keys in API Management (your account), on a sub-account's page (that sub-account), or by API with POST /api/v1/sub-accounts/<uid>/keys. A key acts as the account it belongs to: a sub-account's key trades the sub-account's balances.
| Permission | What it allows |
|---|---|
| Read | Always on. Balances, orders, fills, transfers, the key itself, the user data stream |
| Trade | Place and cancel spot orders, batches and cancel-all |
| Transfer | A main account key: move funds between the main account and its sub-accounts. A sub-account key: move funds from itself to its main account |
| Sub-accounts | Main account keys only. Create, rename, freeze and close sub-accounts, manage their keys; includes Transfer |
- No key can withdraw funds from the platform.
- With an IP list (up to 30 addresses), the key only works from those addresses. The platform may require one for keys that trade, transfer or manage sub-accounts.
- A key can end on a date you choose (30 days to 10 years), or never.
- Freezing or closing a sub-account stops its keys; closing deletes them.
Signing
Every signed request carries X-WS-APIKEY, X-WS-TIMESTAMP (milliseconds since 1970, UTC), X-WS-SIGNATURE and optionally X-WS-RECV-WINDOW (5000 by default, up to 60000). The string signed is the same for both kinds of key:
timestamp + METHOD + path with query + body
1790500000000GET/api/v1/sub-accounts
1790500000000POST/api/v1/sub-accounts/transfer{"toUid":10000042,"currency":"USDT","amount":"250"}| Key | X-WS-SIGNATURE |
|---|---|
| HMAC-SHA256 | HMAC-SHA256 of the string, keyed with the secret, as lowercase hex |
| Ed25519 | The Ed25519 signature of the string (64 bytes) made with your private key, as base64 |
Sign the exact body bytes you send. Each signature works once. HMAC examples are in the API documentation; Ed25519 below.
Make an Ed25519 key pair
openssl genpkey -algorithm ed25519 -out private.pem openssl pkey -in private.pem -pubout # paste this public key when you make the key
Node.js 18+
import crypto from 'node:crypto';
import fs from 'node:fs';
const KEY = process.env.WS_API_KEY; // the API key shown when the key was made
const PRIVATE = crypto.createPrivateKey(fs.readFileSync('private.pem'));
async function call(method, path, body) {
const ts = Date.now().toString();
const raw = body ? JSON.stringify(body) : '';
// Ed25519 signs the same string as HMAC; the signature is sent as base64
const sig = crypto.sign(null, Buffer.from(ts + method + path + raw), PRIVATE).toString('base64');
const res = await fetch('https://cryptora.dev' + path, {
method,
headers: { 'X-WS-APIKEY': KEY, 'X-WS-TIMESTAMP': ts, 'X-WS-SIGNATURE': sig, 'Content-Type': 'application/json' },
body: raw || undefined,
});
return res.json();
}
console.log(await call('GET', '/api/v1/sub-accounts'));
console.log(await call('POST', '/api/v1/sub-accounts/transfer', { toUid: 10000042, currency: 'USDT', amount: '250', clientRef: 'rebalance-2026-11-25' }));Python (cryptography)
import base64, json, os, time, requests
from cryptography.hazmat.primitives.serialization import load_pem_private_key
KEY = os.environ["WS_API_KEY"]
PRIVATE = load_pem_private_key(open("private.pem", "rb").read(), password=None)
def call(method, path, body=None):
ts = str(int(time.time() * 1000))
raw = json.dumps(body, separators=(",", ":")) if body else ""
sig = base64.b64encode(PRIVATE.sign((ts + method + path + raw).encode())).decode()
headers = {"X-WS-APIKEY": KEY, "X-WS-TIMESTAMP": ts, "X-WS-SIGNATURE": sig, "Content-Type": "application/json"}
return requests.request(method, "https://cryptora.dev" + path, headers=headers, data=raw or None).json()
print(call("GET", "/api/v1/sub-accounts/transfers?limit=20"))curl and OpenSSL 3
TS=$(date +%s000)
PATH_Q='/api/v1/key'
SIG=$(printf '%s' "${TS}GET${PATH_Q}" | openssl pkeyutl -sign -inkey private.pem -rawin | base64 -w0)
curl -s "https://cryptora.dev${PATH_Q}" -H "X-WS-APIKEY: $WS_API_KEY" -H "X-WS-TIMESTAMP: $TS" -H "X-WS-SIGNATURE: $SIG"Rate limits
Each key may send a number of requests a minute: 600 by default, more when the platform gives your account a higher tier (1,200, 3,000, 6,000 or 12,000). Your sub-accounts' keys share your tier. Every answer says where you stand:
| Header | Value |
|---|---|
X-RateLimit-Limit | Requests allowed in the minute |
X-RateLimit-Remaining | Requests left in this minute |
X-RateLimit-Reset | When the minute rolls over, in UNIX seconds |
Retry-After | Only on 429: seconds to wait |
Orders keep the trade page's own limit of new orders a minute per account; each order of a batch counts.
Key and limit
GET/api/v1/keyRead
Answer
{ "ok": true,
"key": { "name": "Desk bot", "prefix": "cex_a1b2", "kind": "ed25519",
"permissions": { "read": true, "trade": true, "subAccounts": false, "transfer": true },
"ipWhitelist": ["203.0.113.10"], "expiresAt": null, "createdAt": "2026-11-25T09:00:00.000Z" },
"account": { "uid": 10000042, "isSubAccount": true },
"rateLimit": { "requestsPerMinute": 3000 } }GET/api/v1/rate-limitRead
Answer
{ "ok": true, "requestsPerMinute": 3000, "windowSeconds": 60,
"today": { "requests": 18240, "errors": 12, "limited": 0 } }Sub-accounts
A sub-account is a full account of its own (wallets, deposit addresses, orders, keys) that belongs to your main account. Virtual sub-accounts have no sign-in: you run them by API and by switching into them on the website. Email sub-accounts get an invitation, set their own password and sign in on their own. These endpoints need a main account key with the Sub-accounts permission.
GET/api/v1/sub-accounts?includeClosed=1Sub-accounts
includeClosed=1.Answer
{ "ok": true, "masterUid": 10000001, "used": 3, "max": 20, "totalUsd": 184230.55,
"subAccounts": [ { "uid": 10000042, "label": "Desk 1", "kind": "virtual", "status": "active",
"email": null, "inviteState": "none", "note": "", "createdVia": "api",
"createdAt": "2026-11-25T09:00:00.000Z", "lastLoginAt": null, "totalUsd": 52010.2 } ] }POST/api/v1/sub-accountsSub-accounts
label: 1 to 48 letters, digits, spaces, dots, dashes or underscores, unique among yours. An email sub-account gets its invitation by email. Your account must meet the platform's conditions (identity verified, two-factor on) and be under its limit.Body
{ "label": "Desk 2", "kind": "virtual", "note": "Market making" }
{ "label": "Analyst", "kind": "email", "email": "[email protected]" }Answer
{ "ok": true, "subAccount": { "uid": 10000043, "label": "Desk 2", "kind": "virtual", "status": "active", ... } }GET/api/v1/sub-accounts/<uid>Sub-accounts
usd is null for a coin without a price.Answer
{ "ok": true, "subAccount": { "uid": 10000042, ... , "totalUsd": 52010.2 },
"balances": [ { "wallet": "spot", "currency": "USDT", "available": "50000", "locked": "1200", "usd": 51200 },
{ "wallet": "funding", "currency": "BTC", "available": "0.01", "locked": "0", "usd": 810.2 } ] }PATCH/api/v1/sub-accounts/<uid>Sub-accounts
Body
{ "label": "Desk 1 (EU)", "note": "Moved to the EU desk" }POST/api/v1/sub-accounts/<uid>/statusSub-accounts
freeze: signs it out; it cannot trade or receive funds and its keys are refused until unfrozen. Its funds can still move to the main account. unfreeze undoes it (not for one the platform froze). close: for good; every balance must be zero and its orders ended first. Its keys are deleted and it stops counting toward your limit.
Body
{ "action": "freeze" } // or "unfreeze", "close"Sub-account keys
GET/api/v1/sub-accounts/<uid>/keysSub-accounts
POST/api/v1/sub-accounts/<uid>/keysSub-accounts
publicKey: PEM, or the raw 32 bytes in base64 or hex. A sub-account key cannot have the Sub-accounts permission.Body
{ "name": "Desk 1 bot", "kind": "ed25519", "publicKey": "-----BEGIN PUBLIC KEY-----\n...",
"trade": true, "transfer": true, "ipWhitelist": ["203.0.113.10"], "expiresInDays": 90 }Answer
{ "ok": true, "key": { "id": "...", "prefix": "cex_9f8e", ... }, "apiKey": "cex_...",
"secret": "cxs_..." } // secret only for an HMAC keyDELETE/api/v1/sub-accounts/<uid>/keys/<keyId>Sub-accounts
Transfers
POST/api/v1/sub-accounts/transferTransfer
Moves funds at once and for free. A UID left out (or 0) is the key's own account; wallets default to spot. A main account key moves between any two accounts of the family (sub-account to sub-account too); a sub-account key only from itself to its main account. Nothing goes into a frozen or closed sub-account; a frozen one can still be emptied into the main account.
clientRef (optional, 1 to 64 letters, digits, dots, dashes, colons or underscores) makes a retry safe: the same reference again answers the first transfer instead of moving twice; the same reference with different details is refused with REF_REUSED.
Body
{ "fromUid": 0, "toUid": 10000042, "fromWallet": "spot", "toWallet": "spot",
"currency": "USDT", "amount": "250", "clientRef": "rebalance-2026-11-25" }Answer
{ "ok": true, "transfer": { "id": "6f1c...", "fromUid": 10000001, "toUid": 10000042,
"fromWallet": "spot", "toWallet": "spot", "currency": "USDT", "amount": "250", "via": "api",
"clientRef": "rebalance-2026-11-25", "createdAt": "2026-11-25T09:30:00.000Z" } }GET/api/v1/sub-accounts/transfers?uid=¤cy=&startTime=&endTime=&limit=&before=Read
uid narrows to one account, times are milliseconds, limit up to 500 (50 by default), and before a transfer id to page back from.Batch orders
POST/api/v1/orders/batchTrade
Body
{ "orders": [
{ "symbol": "BTC-USDT", "side": "BUY", "type": "LIMIT", "amount": "0.01", "price": "80000" },
{ "symbol": "BTC-USDT", "side": "SELL", "type": "LIMIT", "amount": "0.01", "price": "82000" } ] }Answer
{ "ok": true, "results": [ { "ok": true, "order": { "id": 18231, ... } },
{ "ok": false, "error": "Insufficient balance" } ] }DELETE/api/v1/orders/cancel-all?symbol=BTC-USDTTrade
Answer
{ "ok": true, "symbol": "BTC-USDT", "cancelled": 7, "results": [ { "id": "18231", "ok": true }, ... ] }User data stream
Your orders, balances and transfers pushed to you as they change, instead of asking every second.
POST/api/v1/user-data-streamRead
Answer
{ "ok": true, "listenKey": "9c1d...64 hex", "expiresAt": "2026-11-25T10:30:00.000Z",
"url": "wss://cryptora.dev/ws/v1/user?listenKey=9c1d..." }PUT/api/v1/user-data-stream?listenKey=...Read
DELETE/api/v1/user-data-stream?listenKey=...Read
listenKeyExpired and close.Events
| event | When | Carries |
|---|---|---|
connected | Once, on connecting | listenKey, expiresAt |
order | Every change of one of your spot orders: new, each fill, cancel | order: id, clientOrderId, symbol, side, type, timeInForce, price, averagePrice, amount, filled, remaining, cost, fee, feeCurrency, status, createdAt, updatedAt |
balance | After an order or a transfer touched a coin | balances: wallet, currency, available, locked |
transfer | A sub-account transfer in or out | transfer: id, direction (in or out), fromUid, toUid, fromWallet, toWallet, currency, amount, clientRef, createdAt |
listenKeyExpired | The listen key ran out | then the socket closes with 4002 |
Every event has time in milliseconds. An unknown or ended listen key is closed with 4001. The server pings every so often; answer with a pong (browsers and most libraries do it for you).
Node.js 22+
// 1. open a listen key with a signed request (any key: Read is enough)
const { listenKey, url } = await call('POST', '/api/v1/user-data-stream');
// 2. connect; no signing on the socket itself, the listen key is the proof
const ws = new WebSocket(url); // wss://cryptora.dev/ws/v1/user?listenKey=...
ws.onmessage = (m) => {
const e = JSON.parse(m.data);
if (e.event === 'order') console.log('order', e.order.id, e.order.status, e.order.filled);
if (e.event === 'balance') console.log('balance', e.balances);
if (e.event === 'transfer') console.log('transfer', e.transfer.direction, e.transfer.amount, e.transfer.currency);
};
// 3. keep it alive: every 30 minutes (it ends 60 minutes after the last keep-alive)
setInterval(() => call('PUT', '/api/v1/user-data-stream?listenKey=' + listenKey), 30 * 60 * 1000);Sub-account rules
- A sub-account cannot withdraw to other platforms or addresses, unless the platform allows it for your account. Move funds to the main account and withdraw from there.
- No P2P trading, sending gifts, card or merchant applications, or referral network settings in a sub-account. It can redeem gift codes.
- A sub-account has your verification level; it never submits identity documents of its own.
- A sub-account cannot have sub-accounts.
- Switched into a sub-account on the website, you cannot change its password or security settings; the switch ends after a few hours or when you sign out.
Errors
The signing errors (MISSING_AUTH, INVALID_SIGNATURE, RATE_LIMITED and the rest) are listed in the API documentation. These come from the endpoints above:
| HTTP | code | Meaning |
|---|---|---|
| 400 | BAD_LABEL | The name is empty, too long, or has other characters |
| 400 | BAD_EMAIL | Not an email address |
| 400 | BAD_AMOUNT | The amount is zero, negative or too large |
| 400 | BAD_CURRENCY | No coin given |
| 400 | BAD_WALLET | A wallet that cannot be used for transfers |
| 400 | BAD_REF | clientRef has other characters or is too long |
| 400 | SAME_ACCOUNT | From and to are the same account |
| 400 | BAD_PUBLIC_KEY | Not an Ed25519 public key |
| 400 | BAD_IPS | An entry is not an IP address, or more than 30 |
| 400 | IP_REQUIRED | The platform needs an IP list for this key |
| 400 | BAD_BATCH | orders is missing, empty, or has more than 10 |
| 400 | SYMBOL_REQUIRED | cancel-all needs a symbol |
| 403 | PERMISSION_DENIED | The key lacks the Sub-accounts or Transfer permission |
| 403 | IS_SUB_ACCOUNT | A sub-account key asked for main account actions |
| 403 | SUB_TO_MASTER_ONLY | A sub-account key moves only to its main account |
| 403 | KYC_REQUIRED | Verify your identity to make sub-accounts |
| 403 | TWO_FACTOR_REQUIRED | Turn on two-factor sign-in |
| 403 | MASTER_SUSPENDED | Sub-accounts are switched off for your account |
| 403 | LIMIT_REACHED | You have as many sub-accounts as you may |
| 403 | FROZEN_BY_ADMIN | The platform froze it; only support can unfreeze it |
| 404 | NOT_FOUND | No such sub-account or key of yours |
| 404 | NOT_IN_FAMILY | The UID is not you or one of your sub-accounts |
| 404 | LISTEN_KEY_EXPIRED | The listen key is unknown or over: open a new one |
| 409 | LABEL_TAKEN | Another sub-account of yours has this name |
| 409 | EMAIL_TAKEN | An account with this email exists |
| 409 | INSUFFICIENT_BALANCE | Not enough available in that wallet |
| 409 | TO_NOT_ACTIVE | Nothing can go into a frozen or closed sub-account |
| 409 | FROM_FROZEN | A frozen sub-account can only be emptied into the main account |
| 409 | NOT_EMPTY | Empty the sub-account before closing it |
| 409 | REF_REUSED | This clientRef belongs to a different transfer |
| 409 | KEY_LIMIT | The account has as many keys as it may |