# Clients and SDKs

True Markets publishes first-party SDKs that wrap signing, token refresh, and every Gateway operation as typed methods. They auto-load `TM_KEY_FILE` from your environment, so there's no manual JWT step.

| Language | Package |
|  --- | --- |
| TypeScript | `@truemarkets/sdk` |
| Python | `truemarkets` |


## Installation


```bash npm
npm install @truemarkets/sdk
```


```bash bun
bun add @truemarkets/sdk
```


```bash pip
pip install truemarkets
```

TypeScript SDK requires Node 18+ or Bun. Python SDK requires Python 3.10+.

## Authentication

Both SDKs auto-load `TM_KEY_FILE` from your environment or a `.env` file in the working directory. See [Onboarding](/getting-started/onboarding) for how to download an API key bundle.


```sh
# .env
TM_ENV=prod
TM_KEY_FILE=/path/to/truemarkets-api-key-XXXXXXXX.json
```

## Quick example

Fetch a quote for $25 of BTC:


```typescript TypeScript
import { Client } from "@truemarkets/sdk";

const client = new Client();

const { data: quote } = await client.gateway.computeQuote({
  body: {
    base_asset: "BTC",
    quote_asset: "USDC",
    qty: "25",
    qty_unit: "quote",
    side: "buy",
  },
});
```


```python Python
from truemarkets import Client
from truemarkets._generated.gateway.models import (
    OrderSide,
    QuoteRequest,
    QuoteRequestQtyUnit,
)

c = Client()

quote = c.gateway.compute_quote(body=QuoteRequest(
    base_asset="BTC",
    quote_asset="USDC",
    qty="25",
    qty_unit=QuoteRequestQtyUnit.QUOTE,
    side=OrderSide.BUY,
))
```

Methods are generated from the OpenAPI spec and named after `operationId`s (`listAssets`/`list_assets`, `createOrder`/`create_order`, `getOrderStatus`/`get_order_status`, etc.). Autocomplete shows the full surface; see each SDK's README for the DeFi flow and Turnkey signing helpers.

## CLI and MCP

Prefer to drive the API from your terminal — or from an AI agent? The True Markets [CLI](https://truemarkets.co/cli) covers both. It installs via Homebrew or GitHub CLI, and ships an MCP server you can wire into Claude Desktop, Claude Code, or Cursor so an agent can fetch quotes and place trades for you. Auth is email-code, no stored keys.

## Next steps

- **[Quick Start](/getting-started/quickstart)** — buy your first BTC end-to-end.
- **[Gateway API reference](/apis/gateway/openapi)** — every endpoint, schema, and error code.
- **[Discord](https://discord.gg/SC92xRUZqw)** — SDK questions, MCP setup help, and integration chat happen here.