Blog
AIWebSocketsTrading systemsTypeScriptNode.js

Siebly AI Skills for Trading: Developer Setup Guide

Learn how to use Siebly AI skills for trading automation with Siebly SDKs in TypeScript and Node.js. Build safe, verified crypto REST and WebSocket workflows.

Siebly.io11 min readMarkdown

Overview

Generated exchange code can look correct and still call a method that does not exist, or pass the wrong credential field. Siebly AI skills for trading automation help a coding agent stay on the task. They do not make the output correct. The Siebly SDKs are the JavaScript, TypeScript, and Node.js layer for these exchanges. They sign private requests, attach timestamps where the exchange requires them, and expose typed REST and WebSocket clients. They do not throttle you, and they do not retry a failed order for you.

Start with public data. Move to a demo, sandbox, or testnet only where that package actually has one. Read the current package reference and the exchange docs before you trust a generated call.

Key Takeaways

  • Give the agent a small task: one exchange, one package, one public call, and a list of things it must not do.
  • Check the import, the class name, the option keys, and the method name against the SDK you installed. These ten packages do not share one interface.
  • The SDK signs requests and keeps WebSocket connections alive. Your code still owns rate limits, backoff, and whether a failed call should be sent again.
  • Public calls need no keys. Demo, sandbox, and testnet flags are not the same thing, and several packages have none.
  • Awaitable WebSocket orders exist only on packages that export WebsocketAPIClient. coinbase-api and bitmart-api do not.

What Siebly AI Skills for Trading Automation Help Developers Build

An AI skill gives the agent context: language, exchange, and what the task is allowed to touch. The agent writes the application. The SDK talks to the exchange. The exchange docs say what the endpoint accepts today. None of those three checks the others.

Before you follow a skill’s steps, read the current AI skills for exchange integration page. That page is the list of what the skills cover. After the agent writes code, compare it with the SDK you actually installed and with the exchange docs.

What role does an AI skill play in an exchange integration?

A skill can tell the agent to stay in JavaScript, read public market data, and stop before any private call. A reasonable first task is: fetch one public ticker, map the fields you care about, and handle a thrown error.

The skill does not run the bot, and it does not decide whether a trade is a good idea. Algorithmic trading is a separate topic. This guide is about getting the integration code right.

Why pair AI guidance with a Siebly SDK?

Hand-rolled clients repeat the same work: HTTP, signatures, and clock fields such as recvWindow or an OKX passphrase. A Siebly SDK already does that work, with TypeScript types for requests and responses.

What it does not do:

  • It does not wait when you are near an exchange rate limit. Some responses include limit fields (Binance exchangeInfo, Gate.io getAccountRateLimit(), HTX rate-limit headers). Reading them is still your job.
  • It does not retry a failed REST call. There is no shared retries option on these clients.
  • WebSocket clients do reconnect on their own, and on several exchanges they resubscribe after the socket comes back. That is connection recovery. It is not “send this order again.”

For the package list, start at the Siebly SDK documentation.

How to Turn a Siebly AI Skill into a Verifiable Automation Workflow

Pick one public call and make the agent name the package. If the generated file imports a class that package does not export, throw it out.

Define the task, exchange, and permitted data first

Say the language, the npm package, the class, and the method. Say that the first version must not read balances, place orders, or read environment variables.

A Binance public ticker, with no keys, looks like this. The method is get24hrChangeStatistics, not getTicker.

Imported example

JavaScript
import { MainClient } from "binance";

const client = new MainClient();

const ticker = await client.get24hrChangeStatistics({
  symbol: "BTCUSDT",
});

The same idea on other packages uses different classes, methods, and symbol strings. Copying the Binance call onto another exchange will fail.

Imported example

JavaScript
import { RestClientV5 } from "bybit-api";

const client = new RestClientV5();
const tickers = await client.getTickers({ category: "linear" });

Imported example

JavaScript
import { RestClient } from "okx-api";

const client = new RestClient();
const ticker = await client.getTicker({ instId: "BTC-USDT" });

Imported example

JavaScript
import { RestClient } from "gateio-api";

const client = new RestClient();
const ticker = await client.getSpotTicker({
  currency_pair: "BTC_USDT",
});

Imported example

JavaScript
import { SpotClient } from "kucoin-api";

const client = new SpotClient();
const ticker = await client.getTicker({ symbol: "BTC-USDT" });

Imported example

JavaScript
import { SpotClient } from "@siebly/kraken-api";

const client = new SpotClient();
const ticker = await client.getTicker({ pair: "XBTUSD" });

Imported example

JavaScript
import { SpotClient } from "@siebly/htx-api";

const client = new SpotClient();
const ticker = await client.getTicker({ symbol: "btcusdt" });

Imported example

JavaScript
import { CBAdvancedTradeClient } from "coinbase-api";

const client = new CBAdvancedTradeClient({});
const product = await client.getPublicProduct({
  product_id: "BTC-USD",
});

Imported example

JavaScript
import { RestClient } from "bitmart-api";

const client = new RestClient();
const ticker = await client.getSpotTickerV3({ symbol: "BTC_USDT" });

Imported example

JavaScript
import { RestClientV3 } from "bitget-api";

const client = new RestClientV3();
const candles = await client.getCandles({
  symbol: "BTCUSDT",
  category: "SPOT",
  interval: "1m",
});

Bitget has two REST generations. RestClientV3 is for the Unified Trading Account. If the account is still on the older API, use RestClientV2 and its own methods, such as getSpotTicker. Do not mix the two.

Review generated code against documented SDK behavior

Reject the output if any of these are wrong:

  • Package name. Only Kraken and HTX are scoped: @siebly/kraken-api and @siebly/htx-api. The others install as binance, bybit-api, okx-api, bitget-api, gateio-api, kucoin-api, coinbase-api, and bitmart-api. There is no binance.
  • Class name. Binance spot REST is MainClient. USD-M futures are USDMClient. Bybit V5 is RestClientV5. Coinbase Advanced Trade is CBAdvancedTradeClient, and that package also exports Exchange, International, Prime, App, and Commerce clients. BitMart spot is RestClient. Futures are FuturesClientV2.
  • Option keys. Binance uses api_key and api_secret. Bybit uses key and secret. OKX and Bitget need apiKey, apiSecret, and apiPass. KuCoin uses apiPassphrase. BitMart uses apiMemo. Passing apiKey into MainClient or RestClientV5 does nothing useful.
  • Symbol format. BTCUSDT, BTC-USDT, BTC_USDT, BTC-USD, XBTUSD, and btcusdt are all real, on different exchanges.

Then add tests for a normal payload, a missing field, and a thrown API error. Keep secrets out of the prompt. If you later use a key, store it outside the repo, and leave withdrawal permission off. The Siebly SDK documentation is the index. The exchange docs still decide what a field means.

Choose the Right Integration Boundary: AI Skills, SDKs, and Exchange APIs

LayerResponsibilityReview focus
AI skillTells the agent the task and the limits.The skill does not run or verify the code.
Siebly SDKSigns requests, types the calls, and keeps WebSocket connections up, including resubscribe after a drop.Confirm the class and method in that package. Do not assume a retry helper.
Exchange documentationSays which fields, weights, and error codes are current.This is the source of truth for API behavior.
ApplicationDecides when to call, when to wait, and when to stop.Test throttling and failure handling yourself.

When should a workflow use an SDK instead of raw API calls?

Use the SDK when you want the signature, the timestamp, and the typed method in one place. You still need the exchange docs for required fields. An SDK method can exist and still be the wrong product. Binance submitNewOrder on USDMClient is a futures REST order. The spot WebSocket order is submitNewSpotOrder on WebsocketAPIClient. Same library, different class, different name.

OKX is the same kind of trap. REST order entry is submitOrder. The WebSocket order entry is submitNewOrder. Bybit REST is submitOrder on RestClientV5. The WebSocket trade client uses submitNewOrder.

What responsibilities remain with the application?

You decide which errors are worth another attempt, how long to wait, and when to give up. The SDK will not make that decision.

WebSocket market data and WebSocket orders are different. A subscription is an event stream on WebsocketClient (or WebsocketClientV2 / WebsocketClientV3 on Bitget). An order you can await goes through WebsocketAPIClient, and only on these packages:

coinbase-api has a sendWSAPIRequest method on WebsocketClient. The implementation is a stub. The comment in the client says it is not supported. Do not call it. bitmart-api has no WebsocketAPIClient. Use its REST clients for orders, and WebsocketClient for streams.

How to Validate AI-Assisted Automation Safely Before Private Access

Run the public call first. Save a fixture from a real response and test your parser against that fixture, plus a copy with a field removed. Live responses move around. A fixture does not.

For streams, drop the socket and check that your own state survives a reconnect and a duplicate event. The client will try to reconnect. Your cache still has to tolerate the gap.

If you use an awaitable WebSocket order, test the promise on a demo or testnet account where one exists. Cover the resolve, the reject, and a timeout. Kraken’s WebsocketAPIClient currently covers spot only.

What should developers test in a simulation?

  • Parsing: required fields, types, and the value you store.
  • State: a repeated event, a late event, and an event for a symbol you do not track.
  • Failures: HTTP error, disconnect, and a rejected order.
  • Logs: enough to debug the call, and no keys or secrets.

Rate limits stay in your code. The clients in this set will not sleep for you when a weight or request cap is close.

These checks tell you the code path works. They say nothing about whether a strategy makes money.

Where a demo, sandbox, or testnet actually exists

Do not add testnet: true because another package has it. These are the flags that exist today:

PackageSafe environment in the SDK
binancetestnet: true for the test networks. demoTrading: true is separate: live market data, simulated fills.
bybit-apitestnet: true and demoTrading: true are separate options. Credentials use key and secret.
okx-apidemoTrading: true. Also set market when the account is EEA (EEA) or US (US). Global is the default.
bitget-apidemoTrading: true on the V3 WebSocket API client.
bitmart-apidemoTrading: true on FuturesClientV2 and the futures WebSocket. Not a spot testnet switch.
gateio-apiuseTestnet: true on WebsocketClient.
@siebly/kraken-apitestnet: true on DerivativesClient only. Spot stays on the live host.
kucoin-apiNo testnet host in this SDK.
coinbase-apiuseSandbox on the Exchange and International clients. Advanced Trade, App, and Prime have no sandbox.
@siebly/htx-apiNo testnet or demo flag. Public reads are the safe first step.

A Bybit testnet client uses different option names from Binance:

Imported example

JavaScript
import { RestClientV5 } from "bybit-api";

const client = new RestClientV5({
  testnet: true,
  key: process.env.API_KEY,
  secret: process.env.API_SECRET,
});

Binance leaves clock sync off unless you set disableTimeSync: false. Bybit leaves it off unless you set enable_time_sync: true. Same idea, opposite flag. Copy one client’s options into the other and the clock behavior will not follow.

How should API credentials be protected?

Public examples should not contain keys. Do not paste keys into a prompt, a log, or a screenshot. When a later step needs a key, keep it in a secret store, grant the smallest permission set that works, and disable withdrawals. The Siebly SDK documentation is where you pick the package. The exchange docs are where you confirm the call.

Implement with Siebly AI Skills and the Relevant Exchange SDK

Install the package, open its examples, and only then ask the agent to write the integration. If the operation is missing from the package, check the exchange docs before you invent a method.

Select a documented package for the target exchange

Imported example

Shell
npm install binance
npm install bybit-api
npm install okx-api
npm install bitget-api
npm install gateio-api
npm install kucoin-api
npm install coinbase-api
npm install bitmart-api
npm install @siebly/kraken-api
npm install @siebly/htx-api

Each package is JavaScript, with TypeScript types. There is not a separate Python or Go SDK in this set. Browser bundles exist for some of them. Private keys still belong on a server.

Public call, then a WebSocket order, on the package that has one

An OKX WebSocket order is a promise. The client opens and authenticates the socket for you. REST uses apiKey on the RestClient constructor. This client wants an accounts array, and the method is submitNewOrder, not submitOrder.

Imported example

TypeScript
import { WebsocketAPIClient } from "okx-api";

const wsClient = new WebsocketAPIClient({
  accounts: [
{
apiKey: process.env.API_KEY,
apiSecret: process.env.API_SECRET,
apiPass: process.env.API_PASSPHRASE,
},
  ],
});

const order = await wsClient.submitNewOrder({
  instId: "BTC-USDT",
  tdMode: "cash",
  side: "buy",
  ordType: "market",
  sz: "0.1",
});

Use demo trading for that call until you mean to hit production. Set demoTrading: true on the same options object.

Binance spot over the WebSocket API:

Imported example

TypeScript
import { WebsocketAPIClient } from "binance";

const wsClient = new WebsocketAPIClient({
  api_key: process.env.API_KEY,
  api_secret: process.env.API_SECRET,
  // testnet: true,
});

const order = await wsClient.submitNewSpotOrder({
  symbol: "BTCUSDT",
  side: "BUY",
  type: "MARKET",
  quoteOrderQty: "10",
});

Ed25519 keys can log in once on the Binance WebSocket API. HMAC and RSA sign every command. Futures orders on this class are submitNewFuturesOrder, not submitNewSpotOrder.

Kraken spot over WebSocket, from the package README. The symbol uses a slash.

Imported example

JavaScript
import { WebsocketAPIClient } from "@siebly/kraken-api";

const wsApiClient = new WebsocketAPIClient({
  apiKey: process.env.API_KEY,
  apiSecret: process.env.API_SECRET,
});

const order = await wsApiClient.submitSpotOrder({
  order_type: "limit",
  side: "buy",
  limit_price: 26500.4,
  order_qty: 1.2,
  symbol: "BTC/USD",
});

Bitget’s V3 WebSocket order takes the product as the first argument:

Imported example

TypeScript
import { WebsocketAPIClient } from "bitget-api";

const wsClient = new WebsocketAPIClient({
  apiKey: process.env.API_KEY,
  apiSecret: process.env.API_SECRET,
  apiPass: process.env.API_PASS,
  // demoTrading: true,
});

const order = await wsClient.submitNewOrder("spot", {
  orderType: "limit",
  price: "100",
  qty: "0.1",
  side: "buy",
  symbol: "BTCUSDT",
  timeInForce: "gtc",
});

Gate.io and HTX follow the same pattern: construct WebsocketAPIClient, then await a named method such as submitNewSpotOrder (Gate.io) or submitSpotOrder (HTX). KuCoin’s spot WebSocket order is submitNewSpotOrder. Read the method list in that package before you reuse a name from another one.

Move from a verified prototype to maintainable code

Keep config, the SDK client, and your own logic in separate modules. Test the parser without the network. Log the method and the error code, not the secret.

If the call is a WebSocket order, confirm both the class (WebsocketAPIClient) and the method on that exchange. A generated placeOrder() is a guess until you find it in the package.

Build the Next Workflow with a Verified Integration Boundary

Use a skill to keep the agent inside the task. Use the SDK that matches the exchange, with the class and option names that package actually exports. Treat the exchange docs as the source of truth when a field or error code is unclear.

These SDKs cover JavaScript, TypeScript, and Node.js. They sign requests and maintain sockets. You still choose the rate limit policy and what happens after a failure.

To begin, review Siebly SDKs for your exchange integration. Start with one public call you can run without a key.

Frequently Asked Questions

What are Siebly AI skills for trading automation?

They are instructions for a coding agent working on an exchange integration. They can name the language and the boundary of the task. They do not verify the code, run a bot, or make trading decisions. Check the result against the installed SDK and the exchange docs before you run it.

How do I use an AI skill with a Siebly exchange SDK?

Name the package and a public method, for example MainClient.get24hrChangeStatistics from binance, or SpotClient.getTicker from @siebly/kraken-api. Ask for that call only. Run it with no keys. Compare the import and the arguments with the package examples before you add anything private.

Can AI skills generate exchange API integration code?

Yes. Treat the file as a draft. Common failures in this set are a shared getTicker() that only some clients have, apiKey passed into Binance or Bybit, testnet: true on KuCoin or HTX, and WebsocketAPIClient imported from coinbase-api or bitmart-api.

Do Siebly SDKs automatically handle exchange rate limits?

No. None of these clients pause or queue calls to stay under an exchange cap. Your process has to do that, using the limits in the current exchange docs. If you retry, that policy is yours too. A WebSocket reconnect is not a retry of the request that failed.

Is it safe to test an AI-generated exchange workflow with public data or testnet?

Public data is the right first step on every package here, because it needs no key. A testnet, demo, or sandbox exists only on some clients, and the flag name differs. KuCoin and HTX do not expose one in these SDKs. Coinbase Advanced Trade does not have a sandbox. Passing those checks does not say anything about trading results.

What should I verify before using generated JavaScript or TypeScript code?

The npm name, the import, the constructor options, the method, the symbol format, and the response fields. Then run the public call, or the demo flag that package documents. Keep secrets out of prompts, source, and logs.

Can a WebSocket API support awaitable exchange operations?

Yes, where the package exports WebsocketAPIClient. You await a method such as submitNewOrder, submitNewSpotOrder, or submitSpotOrder, and the client sends it on a persistent socket. coinbase-api and bitmart-api do not offer that. Confirm the method in the package before you ship generated code, and try the promise on a demo or testnet account when that package has one.

Related articles

Continue from here

Related Siebly resources

All articles

Subscribe on Substack

Complete the Substack form below to join our newsletter. Substack handles all subscriber data directly.