# True Markets > Trading infrastructure across CeFi and DeFi markets If the user is building a product where their own customers trade, use Gateway. Create a user for each customer with the Accounts API, authenticate with your organization's API key, and place orders for that user through the Trading API with the `TM-On-Behalf-Of` header. Start with [Getting started with Gateway](https://docs.truemarkets.co/gateway/quickstart.md). If the user wants to trade their own account from code, use the Trading API with a key from app.truemarkets.co. Don't create an organization or users. Start with [Getting started with Trading API](https://docs.truemarkets.co/trading-api/quickstart.md). If the user wants an agent to trade their own account without writing code, use the tm CLI with its agent skills: install and log in to the CLI, then run `npx skills install truemarkets`. See [AI agents](https://docs.truemarkets.co/cli/ai-agents.md). Every order moves real funds, and there is no test mode. A first trade costs a few dollars of USDC. Append `.md` to any page URL to get it as Markdown. Each product section below lists its OpenAPI and AsyncAPI files under Specs. The larger specs run past 100 KB, which some fetch tools cut off without saying so, so download a spec with curl or wget before reading it. ## Get started - [Get started](https://docs.truemarkets.co/index.md): Trade crypto, stablecoins and tokenized stocks from code. Pick your path by who trades. - [Create an account](https://docs.truemarkets.co/getting-started/create-an-account.md): The account you need depends on who trades. You, your customers, or your firm. - [Build with agents](https://docs.truemarkets.co/getting-started/build-with-agents.md): Give a coding agent any page as Markdown, or connect an assistant to our MCP servers. ## Gateway - [About Gateway](https://docs.truemarkets.co/gateway.md): Add trading to your app through the API. You create a user for each of your customers, and your servers place orders on their behalf from that user's own wallets. - [Getting started with Gateway](https://docs.truemarkets.co/gateway/quickstart.md): Go from a new organization to your first filled trade for a user, in about 15 minutes. ### How it works - [How requests and signing work](https://docs.truemarkets.co/gateway/requests-and-signing.md): Gateway uses two keys for two jobs. Your organization API key signs you in; your signer key signs your users' wallet transactions. - [Signer keys](https://docs.truemarkets.co/gateway/signing-keys.md): A signer key signs every trade, transfer and export from a user's wallet. Decide where it lives before you create users. ### Guides - [User accounts](https://docs.truemarkets.co/gateway/create-a-user.md): Create a user for one of your customers and get the user_id you trade for them with. - [Fund a user's wallet](https://docs.truemarkets.co/gateway/fund-a-wallet.md): Send tokens on-chain to a user's wallet address, then check the balance. - [Send funds from a user's wallet](https://docs.truemarkets.co/gateway/send-funds.md): Send tokens from a user's wallet to any address on the same chain. - [Trade for a user](https://docs.truemarkets.co/gateway/trade-for-a-user.md): Add TM-On-Behalf-Of to a request made with your organization token, and it runs for that user. - [Place orders for a user](https://docs.truemarkets.co/gateway/place-orders.md): Place market and limit orders for a user, list and read them, cancel them, and follow each one to a final state. - [What your users can trade](https://docs.truemarkets.co/gateway/what-you-can-trade.md): The asset catalog lists everything your users can trade, and each asset's fields say where it trades and what it is. - [Organization transactions](https://docs.truemarkets.co/gateway/activity.md): Transactions are your users' orders and transfers in one list, newest first. ### Launch - [Gateway go-live checklist](https://docs.truemarkets.co/gateway/go-live.md): There is no test mode, so your first run is a small live trade. ### Specs - [Authentication REST spec](https://docs.truemarkets.co/openapi/auth.yaml): Exchange an API key signature for a token, and refresh it. - [Accounts REST spec](https://docs.truemarkets.co/openapi/account.yaml): Create the users your organization trades for, with their wallets, and read deposit details. - [Trading REST spec](https://docs.truemarkets.co/openapi/gateway.yaml): Quotes, orders, transfers, balances and transactions, for your own account or for a user you act for. ## Trading API - [About Trading API](https://docs.truemarkets.co/trading-api.md): The Trading API lets you trade your own True Markets account from code, with one key that signs your requests and your orders. - [Create your API key](https://docs.truemarkets.co/trading-api/api-key.md): One API key mints the tokens that authenticate your calls and signs your orders. Create it at app.truemarkets.co. - [Getting started with Trading API](https://docs.truemarkets.co/trading-api/quickstart.md): Mint a token, buy a small amount of SOL, and find the fill in your transactions, in about 10 minutes. ### How it works - [How requests and signing work](https://docs.truemarkets.co/trading-api/requests-and-signing.md): One API key does two jobs. It signs you in, and it signs your own wallet transactions. ### Guides - [Fund your wallet](https://docs.truemarkets.co/trading-api/fund.md): Send stablecoins to your wallet, or buy with a card at app.truemarkets.co, then check your balance. - [Send funds](https://docs.truemarkets.co/trading-api/send-funds.md): Move tokens from your wallet to any address on the same chain. - [Place orders](https://docs.truemarkets.co/trading-api/place-orders.md): Place market, limit and perpetual orders, list and read them, cancel or change them, and follow each one to a final state. - [What you can trade](https://docs.truemarkets.co/trading-api/what-you-can-trade.md): The asset catalog lists everything you can trade, and each asset's fields say where it trades and what it is. - [Your transactions](https://docs.truemarkets.co/trading-api/transactions.md): Transactions are your orders and transfers in one list, newest first. ### Launch - [Trading API go-live checklist](https://docs.truemarkets.co/trading-api/go-live.md): There is no test mode, so your first run is a small live trade. ### Specs - [Authentication REST spec](https://docs.truemarkets.co/openapi/auth.yaml): Exchange an API key signature for a token, and refresh it. - [Trading REST spec](https://docs.truemarkets.co/openapi/gateway.yaml): Quotes, orders, transfers, balances and transactions, for your own account or for a user you act for. ## Institutional - [About Institutional](https://docs.truemarkets.co/institutional/overview.md): Institutional access connects your firm directly to the True Markets exchange over REST, WebSocket or FIX. - [Access and credentials](https://docs.truemarkets.co/institutional/access-and-credentials.md): Apply for institutional access, connect to the exchange and receive credentials for REST, WebSocket and FIX. - [Account models](https://docs.truemarkets.co/institutional/account-models.md): Principal, omnibus agency or fully disclosed, and how each one structures your accounts and clients. - [Manage clients](https://docs.truemarkets.co/institutional/manage-clients.md): Read the clients on your account and change their self-trade prevention setting. - [Trade over FIX](https://docs.truemarkets.co/institutional/trade-over-fix.md): The FIX sessions for order entry, market data and drop copy, and what you need before you connect. - [Trade over REST](https://docs.truemarkets.co/institutional/trade-over-rest.md): Sign CeFi REST requests with HMAC-SHA256, then place orders, read balances and move funds on the exchange. - [Migrate to the /v1/cefi paths](https://docs.truemarkets.co/institutional/migrate-to-cefi-paths.md): Move your CeFi REST calls from the removed /api/v1/ prefix to /v1/cefi/, and upgrade to schema version v2026_01_23 before November 1, 2026. ### Exchange documentation - [Exchange overview](https://docs.truemarkets.co/documentation/exchange-overview.md): How the True Markets exchange matches orders, the checks it applies, and the protocols that reach it. - [Rule Book](https://docs.truemarkets.co/documentation/rulebook.md): The rules for trading on the True Markets CeFi exchange. A work in progress, not yet final or binding. - [Increment sizes](https://docs.truemarkets.co/documentation/increment-sizes.md): The minimum price and quantity increments, by price bucket, that every order on the exchange must fit. - [Price bands](https://docs.truemarkets.co/documentation/price-bands.md): How the exchange rejects incoming orders priced too far from the current mid-point, and how to reach liquidity outside the band. - [Fee schedule](https://docs.truemarkets.co/documentation/fee-schedule.md): What the CeFi exchange charges per executed order, by client type and side. ### Specs - [CeFi direct REST spec](https://docs.truemarkets.co/openapi/cefi-direct.yaml): Order entry, balances and market data on the CeFi venue, for firms with direct access. - [CeFi direct WebSocket spec](https://docs.truemarkets.co/asyncapi/cefi-direct.yaml): Order book, trades, auction and drop-copy streams from the CeFi venue. ## Market data - [About Market data](https://docs.truemarkets.co/market-data/overview.md): Read prices, candles and order books over REST and WebSocket, with no account and no token. ### Specs - [Market data REST spec](https://docs.truemarkets.co/openapi/marketdata.yaml): Prices, candles and history across venues, without a token. - [Market data WebSocket spec](https://docs.truemarkets.co/asyncapi/marketdata.yaml): Batched candles, trending and surging assets, and reference prices as they update. ## Developer resources - [Developer resources](https://docs.truemarkets.co/developer-resources.md): How keys, tokens and errors work across every True Markets API, plus the SDKs, CLI and MCP servers. ### Essentials - [API keys](https://docs.truemarkets.co/developer-resources/api-keys.md): The keys you hold depend on who trades. An API trader holds one key, and a Gateway client holds two. - [Authenticate requests](https://docs.truemarkets.co/developer-resources/authentication.md): Sign a challenge with your API key to mint a token, then send it as a bearer token on every call. - [Errors](https://docs.truemarkets.co/developer-resources/errors.md): Every error returns the same body. Branch on code, fall back to type, and retry only the cases listed here. ### SDKs - [Clients and SDKs](https://docs.truemarkets.co/sdks/overview.md): Call the Trading API from TypeScript or Python, with token minting and refresh handled by the SDK. - [Install the SDK](https://docs.truemarkets.co/sdks/installation.md): Install the TypeScript SDK with npm or bun, or the Python SDK with pip. - [Authenticate the SDK](https://docs.truemarkets.co/sdks/authentication.md): Point TM_KEY_FILE at your key file and the SDK mints and refreshes tokens for you. - [Quickstart](https://docs.truemarkets.co/sdks/quickstart.md): Make your first call with the TypeScript or Python SDK. ### CLI - [Overview](https://docs.truemarkets.co/cli/overview.md): Buy, sell, transfer and check balances from your terminal with the tm CLI, with JSON output and a dry run before anything spends. - [Install the CLI](https://docs.truemarkets.co/cli/installation.md): Install the tm binary with the install script, Homebrew, or a pre-built download, then confirm it runs. - [Log in to the CLI](https://docs.truemarkets.co/cli/authentication.md): Sign up or log in to the tm CLI with an emailed code, or set an environment variable for non-interactive use. - [Commands](https://docs.truemarkets.co/cli/commands.md): Every tm command, its flags, defaults and output. - [AI agents](https://docs.truemarkets.co/cli/ai-agents.md): Let an AI agent trade through the tm CLI with skills, or through the hosted MCP server. ### MCP - [MCP Overview](https://docs.truemarkets.co/mcp.md): Connect an AI assistant to True Markets market data and trading over the Model Context Protocol. - [Claude Setup](https://docs.truemarkets.co/mcp/setup/claude.md): Add the True Markets Market Data or Trading MCP server to Claude.ai, Claude Desktop or Claude Code. - [ChatGPT Setup](https://docs.truemarkets.co/mcp/setup/chatgpt.md): Add the True Markets Market Data or Trading MCP server to ChatGPT. - [Cursor Setup](https://docs.truemarkets.co/mcp/setup/cursor.md): Add the True Markets Market Data or Trading MCP server to Cursor. - [Market Data Server](https://docs.truemarkets.co/mcp/servers/marketdata.md): Reference for the True Markets Market Data MCP server and its read-only tools. - [Trading Server](https://docs.truemarkets.co/mcp/servers/trading.md): Reference for the True Markets Trading MCP server, its email-code login, local signing and every tool. - [Examples](https://docs.truemarkets.co/mcp/examples.md): Prompts to try with the True Markets MCP servers, from a first setup check to a full trade. ## API reference - [Overview](https://docs.truemarkets.co/api.md) - [Authentication REST](https://docs.truemarkets.co/api/auth/auth-service-api.md) - [Accounts REST](https://docs.truemarkets.co/api/account/true-markets-account-api.md) - [Trading REST](https://docs.truemarkets.co/api/gateway/true-markets-gateway-api.md) - [CeFi direct REST](https://docs.truemarkets.co/api/institutional/true-markets-cefi-rest.md) - [CeFi direct FIX](https://docs.truemarkets.co/api/fix/overview.md) - [CeFi direct WebSocket](https://docs.truemarkets.co/api/websocket/institutional.md) - [Market data REST](https://docs.truemarkets.co/api/market-data/market-data-service-api.md) - [Market data WebSocket](https://docs.truemarkets.co/api/websocket/market-data.md) ## Optional - [Glossary (Get started)](https://docs.truemarkets.co/getting-started/glossary.md): The terms these docs use, in the order you meet them. - [Gateway FAQs (Gateway)](https://docs.truemarkets.co/gateway/faq.md): Short answers to the questions teams ask first when they build on Gateway. - [Trading API FAQs (Trading API)](https://docs.truemarkets.co/trading-api/faq.md): Answers to the questions API traders ask most often. - [API Change Log (Developer resources)](https://docs.truemarkets.co/documentation/changelog.md): Every documented change across the True Markets APIs, newest first. - [FAQ (Developer resources)](https://docs.truemarkets.co/mcp/faq.md): Answers about True Markets MCP keys, supported clients, chains, data freshness, rate limits, trading and privacy.