Skip to main content

For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /sdks/overview.md.

Clients and SDKs

Call the Trading API from TypeScript or Python. The SDKs mint and refresh tokens for you from the key file that TM_KEY_FILE points at.

LanguagePackageRequires
TypeScript@truemarkets/sdkNode 18+ or Bun
PythontruemarketsPython 3.10+

Methods are generated from the OpenAPI spec and named after its operationIds: listAssets/list_assets, createOrder/create_order, getOrderStatus/get_order_status, and so on. They cover the core trading calls; for an endpoint an SDK doesn't wrap yet, call it over HTTP. Each SDK's README covers the DeFi flow and the Turnkey signing helpers. Both SDKs send usage telemetry unless you set TM_TELEMETRY=0.

Same venue, different credentials

The SDKs wrap the Trading API. The CLI trades the same account from a terminal. The credentials differ: the SDKs use your API key file, while the CLI logs you in with an emailed code and keeps your keys on your device. Pick the CLI when you want to trade from a terminal without writing code.

Set up an SDK​

  1. Install: npm, bun, or pip.
  2. Authenticate: point TM_KEY_FILE at your key file.
  3. List assets: the shortest useful call.

Next: Installation