{"openapi":"3.1.0","info":{"title":"Trade It API","version":"1.0.0","description":"Trade It API for market asset lookup, brokerage account access, and draft/live trade workflows across supported brokerages: Charles Schwab, Coinbase, ETrade, Kraken, Public, Robinhood, Tastytrade, and Webull.","contact":{"name":"Trade It","url":"https://tradeit.app/llm-resources"}},"x-tradeit":{"supportedBrokerages":{"all":["Charles Schwab","Coinbase","ETrade","Kraken","Public","Robinhood","Tastytrade","Webull"],"equitiesAndOptions":["Charles Schwab","ETrade","Public","Robinhood","Tastytrade","Webull"],"crypto":["Coinbase","Kraken"]},"authentication":{"methods":["oauth2","api_key"],"mcp_authentication_docs":"https://docs.tradeit.app/mcp.html#authentication","api_authentication_docs":"https://docs.tradeit.app/api.html#authentication","api_key_management_url":"https://tradeit.app/account/api-keys"}},"servers":[{"url":"https://mcp.tradeit.app","description":"Trade It tool API and MCP host"}],"tags":[{"name":"Assets","description":"Lookup market assets and prices."},{"name":"Accounts","description":"Read connected brokerage accounts."},{"name":"Trades","description":"Create and execute trade workflows."}],"security":[{"OAuth2":["tool:execute"]},{"TradeItApiKey":[]}],"paths":{"/tools/search_assets":{"post":{"tags":["Assets"],"operationId":"searchAssets","summary":"Search assets by symbol or name","description":"Search for a stock or crypto asset and return normalized metadata plus the latest available price.","security":[{"OAuth2":["asset:read","tool:execute"]},{"TradeItApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAssetsRequest"}}}},"responses":{"200":{"description":"Normalized asset result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tools/get_accounts":{"post":{"tags":["Accounts"],"operationId":"getAccounts","summary":"List connected brokerage accounts","description":"Return the authenticated user's connected brokerage accounts with balances and brokerage metadata.","security":[{"OAuth2":["brokerage:read","tool:execute"]},{"TradeItApiKey":[]}],"responses":{"200":{"description":"Connected accounts.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Account"}}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tools/get_holdings":{"post":{"tags":["Accounts"],"operationId":"getHoldings","summary":"List holdings for an account","description":"Return normalized holdings for a connected brokerage account. Set refresh to true when the user needs the freshest eligible sync.","security":[{"OAuth2":["brokerage:read","tool:execute"]},{"TradeItApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetHoldingsRequest"}}}},"responses":{"200":{"description":"Holdings list.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Holding"}}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tools/get_trades":{"post":{"tags":["Trades"],"operationId":"getTrades","summary":"List recent trades","description":"Return the authenticated user's recent trades with cursor pagination and optional refresh behavior.","security":[{"OAuth2":["trade:read","tool:execute"]},{"TradeItApiKey":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTradesRequest"}}}},"responses":{"200":{"description":"Paginated trade result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradePage"}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tools/create_trade":{"post":{"tags":["Trades"],"operationId":"createTrade","summary":"Create a draft trade","description":"Create a stock or crypto trade draft that the user can review before execution.","security":[{"OAuth2":["trade:write","tool:execute"]},{"TradeItApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTradeRequest"}}}},"responses":{"200":{"description":"Trade draft or immediately placed trade, depending on account settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trade"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tools/create_options_trade":{"post":{"tags":["Trades"],"operationId":"createOptionsTrade","summary":"Create a draft options trade","description":"Create an options order or multi-leg spread draft using OCC leg definitions.","security":[{"OAuth2":["trade:write","tool:execute"]},{"TradeItApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOptionsTradeRequest"}}}},"responses":{"200":{"description":"Draft options trade.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trade"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/tools/execute_trade":{"post":{"tags":["Trades"],"operationId":"executeTrade","summary":"Execute an approved draft trade","description":"Execute a draft trade after the user has explicitly reviewed and approved it.","security":[{"OAuth2":["trade:write","tool:execute"]},{"TradeItApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteTradeRequest"}}}},"responses":{"200":{"description":"Executed trade.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trade"}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing or invalid authentication.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Trade cannot be executed in its current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","description":"OAuth 2.0 authorization code flow for Trade It.","flows":{"authorizationCode":{"authorizationUrl":"https://auth.tradeit.app/auth/v1/authorize","tokenUrl":"https://auth.tradeit.app/auth/v1/token","scopes":{"asset:read":"Read market asset metadata and prices.","brokerage:read":"Read linked brokerage accounts and balances.","brokerage:write":"Create or update brokerage connections.","trade:read":"Read trade history and order state.","trade:write":"Create draft trades and order updates.","tool:execute":"Execute Trade It MCP and agent tools.","user:read":"Read the authenticated Trade It user profile."}}}},"TradeItApiKey":{"type":"http","scheme":"bearer","description":"User-created Trade It API key sent as a bearer token. Create keys at https://tradeit.app/account/api-keys."}},"schemas":{"Balance":{"type":"object","additionalProperties":false,"required":["amount","currency"],"properties":{"amount":{"type":"number"},"currency":{"type":"string","example":"USD"}}},"Asset":{"type":"object","additionalProperties":false,"required":["id","ticker","name","type"],"properties":{"id":{"type":"integer"},"ticker":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","example":"stock"},"exchange":{"type":"string","nullable":true},"mic_code":{"type":"string","nullable":true},"logo_url":{"type":"string","format":"uri","nullable":true},"price":{"anyOf":[{"$ref":"#/components/schemas/Balance"},{"type":"null"}]}}},"BrokerageMetadata":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"fractional_support":{"type":"boolean"}}},"Account":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"balance":{"anyOf":[{"$ref":"#/components/schemas/Balance"},{"type":"null"}]},"cash":{"anyOf":[{"$ref":"#/components/schemas/Balance"},{"type":"null"}]},"brokerage_metadata":{"$ref":"#/components/schemas/BrokerageMetadata"}}},"Holding":{"type":"object","additionalProperties":true,"required":["account_id","asset_id"],"properties":{"account_id":{"type":"integer"},"asset_id":{"type":"integer"},"quantity":{"type":"number","nullable":true},"average_cost":{"anyOf":[{"$ref":"#/components/schemas/Balance"},{"type":"null"}]},"asset":{"anyOf":[{"$ref":"#/components/schemas/Asset"},{"type":"null"}]}}},"TradeLeg":{"type":"object","additionalProperties":false,"required":["type","action","quantity"],"properties":{"type":{"type":"string","enum":["option","equity"]},"action":{"type":"string","enum":["buy","sell"]},"position_effect":{"type":"string","nullable":true,"enum":["open","close",null]},"occ":{"type":"string","nullable":true},"quantity":{"type":"number"}}},"Trade":{"type":"object","additionalProperties":true,"required":["id","status"],"properties":{"id":{"type":"integer"},"status":{"type":"string"},"type":{"type":"string","nullable":true},"account_id":{"type":"integer","nullable":true},"asset_id":{"type":"integer","nullable":true},"total_units":{"type":"number","nullable":true},"filled_units":{"type":"number","nullable":true},"canceled_units":{"type":"number","nullable":true},"order_type":{"type":"string","nullable":true},"time_in_force":{"type":"string","nullable":true},"execution_price":{"anyOf":[{"$ref":"#/components/schemas/Balance"},{"type":"null"}]},"fee":{"anyOf":[{"$ref":"#/components/schemas/Balance"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","nullable":true},"placed_at":{"type":"string","format":"date-time","nullable":true},"executed_at":{"type":"string","format":"date-time","nullable":true},"asset":{"anyOf":[{"$ref":"#/components/schemas/Asset"},{"type":"null"}]},"legs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/TradeLeg"}},{"type":"null"}]}}},"TradePage":{"type":"object","additionalProperties":false,"required":["trades","next_cursor","has_more"],"properties":{"trades":{"type":"array","items":{"$ref":"#/components/schemas/Trade"}},"next_cursor":{"anyOf":[{"type":"integer"},{"type":"string"},{"type":"null"}]},"has_more":{"type":"boolean"}}},"SearchAssetsRequest":{"type":"object","additionalProperties":false,"required":["query"],"properties":{"query":{"type":"string","minLength":1}}},"GetHoldingsRequest":{"type":"object","additionalProperties":false,"required":["account_id"],"properties":{"account_id":{"type":"integer"},"refresh":{"type":"boolean","default":false}}},"GetTradesRequest":{"type":"object","additionalProperties":false,"properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":12},"cursor":{"anyOf":[{"type":"integer"},{"type":"string"}]},"refresh":{"type":"boolean","default":false}}},"CreateTradeRequest":{"type":"object","additionalProperties":false,"required":["symbol","amount","unit","buy_or_sell"],"properties":{"symbol":{"type":"string"},"amount":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string","enum":["dollars","shares"]},"buy_or_sell":{"type":"string","enum":["buy","sell"]},"order_type":{"type":"string","enum":["market","limit","stop","stop_limit"],"default":"market"},"limit_price":{"type":"number","exclusiveMinimum":0},"stop_price":{"type":"number","exclusiveMinimum":0},"time_in_force":{"type":"string","enum":["day","gtc"]},"account_id":{"type":"integer"}}},"CreateOptionsTradeRequest":{"type":"object","additionalProperties":false,"required":["symbol","legs"],"properties":{"symbol":{"type":"string"},"direction":{"type":"string","enum":["debit","credit"]},"legs":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/TradeLeg"}},"order_type":{"type":"string","enum":["market","limit","stop","stop_limit"],"default":"market"},"limit_price":{"type":"number","exclusiveMinimum":0},"stop_price":{"type":"number","exclusiveMinimum":0},"time_in_force":{"type":"string","enum":["day","gtc"]},"account_id":{"type":"integer"}}},"ExecuteTradeRequest":{"type":"object","additionalProperties":false,"required":["trade_id"],"properties":{"trade_id":{"type":"integer"}}},"ErrorResponse":{"type":"object","additionalProperties":false,"required":["error","error_description"],"properties":{"error":{"type":"string"},"error_description":{"type":"string"},"resolution":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":true}}}}}}}