# 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 Trading REST 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 - [True Markets API documentation](https://docs.truemarkets.co/index.md): Trade tokenized stocks, crypto and stablecoins through one API, for your own account or for your users. - [Create an account](https://docs.truemarkets.co/getting-started/create-an-account.md): The account you need depends on who trades, you or your customers. - [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. ## 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. - [Geographic restrictions](https://docs.truemarkets.co/trading-api/geographic-restrictions.md): The countries from which each product on True Markets is not available. - [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. ## Gateway - [About Gateway](https://docs.truemarkets.co/gateway.md): Gateway lets you offer crypto, stablecoin and tokenized stock trading to your users inside your product. - [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. - [Wallet control](https://docs.truemarkets.co/gateway/wallet-control.md): True Markets is non-custodial. Every user wallet needs a signer key and our approval to move funds, and whoever holds the signer key controls the wallet. ### 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. - [Geographic restrictions](https://docs.truemarkets.co/gateway/geographic-restrictions.md): The countries from which each product on True Markets is not available. - [Organization transactions](https://docs.truemarkets.co/gateway/activity.md): Transactions are your users' orders and transfers in one list, newest first. - [Account events](https://docs.truemarkets.co/gateway/events.md): Stream your users' order, transfer and ramp events as they happen, over Server-Sent Events. ### 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. - [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. - [Accounts REST spec](https://docs.truemarkets.co/openapi/account.yaml): Create the users your organization trades for, with their wallets, and read deposit details. - [Account events (SSE) spec](https://docs.truemarkets.co/openapi/events.yaml): Your users' order, transfer and ramp events as they happen, over Server-Sent Events. ## Market Data API - [About Market Data API](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 the API you use. The Trading API uses one key, and Gateway uses 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. - [Rate limits](https://docs.truemarkets.co/developer-resources/rate-limits.md): How many requests you can send, which endpoints have limits of their own, and what to do when you hit one. ### 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. ## Exchange ### Specs - [Exchange 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. - [Exchange WebSocket spec](https://docs.truemarkets.co/asyncapi/cefi-direct.yaml): Order book, trades, auction and drop-copy streams from the CeFi venue. ## API reference - [Overview](https://docs.truemarkets.co/api.md) - [Authentication REST](https://docs.truemarkets.co/api/auth/auth-service-api.md) - [Trading REST](https://docs.truemarkets.co/api/gateway/trading-rest.md) - [Accounts REST](https://docs.truemarkets.co/api/account/true-markets-account-api.md) - [Account events (SSE)](https://docs.truemarkets.co/api/events/account-events-sse.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) - [Exchange REST](https://docs.truemarkets.co/api/institutional/exchange-rest.md) - [Exchange FIX](https://docs.truemarkets.co/api/fix/overview.md) - [Exchange WebSocket](https://docs.truemarkets.co/api/websocket/institutional.md) ## Optional - [Glossary (Get started)](https://docs.truemarkets.co/getting-started/glossary.md): The terms these docs use, in the order you meet them. - [Trading API FAQs (Trading API)](https://docs.truemarkets.co/trading-api/faq.md): Answers to the questions asked most often about the Trading API. - [Gateway FAQs (Gateway)](https://docs.truemarkets.co/gateway/faq.md): Short answers to the questions teams ask first when they build on Gateway. - [Changelog (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.