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.
| Language | Package | Requires |
|---|---|---|
| TypeScript | @truemarkets/sdk | Node 18+ or Bun |
| Python | truemarkets | Python 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.
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
- Install: npm, bun, or pip.
- Authenticate: point
TM_KEY_FILEat your key file. - List assets: the shortest useful call.
Related
- API reference: every endpoint, schema, and error code.
- Trading API quickstart: the same flow in raw HTTP, if you would rather see the wire format.
- Discord: SDK questions and integration chat.