{"openapi":"3.1.0","info":{"title":"Trade It API","version":"1.0.0","description":"Read brokerage accounts and holdings, create reviewable orders, and execute approved trades. Authenticate with a user API key or per-user OAuth token.","contact":{"name":"Trade It","url":"https://tradeit.app/llm-resources"}},"servers":[{"url":"https://api.tradeit.app"}],"x-supported-brokerages":{"all":["Charles Schwab","Coinbase","ETrade","Kraken","Moomoo","Public","Robinhood","Tastytrade","TradeStation","TradeStation Paper","Webull"],"equitiesAndOptions":["Charles Schwab","ETrade","Moomoo","Public","Robinhood","Tastytrade","TradeStation","TradeStation Paper","Webull"],"crypto":["Coinbase","Kraken"]},"security":[{"OAuth2":["tool:execute"]},{"TradeItApiKey":[]}],"paths":{"/api/tool/execute":{"post":{"operationId":"executeTool","externalDocs":{"url":"https://docs.tradeit.app/api"},"summary":"Execute a Trade It tool","description":"Select an operation with toolName and supply its params. The response is the operation result, without a result wrapper. Review and obtain explicit user approval before submitting a live trade. Accounts configured for automatic execution may submit during creation; inspect returned order state.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"search_assets"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"description":"The ticker symbol or name of the asset"}},"required":["query"]}},"description":"Look up a stock or crypto asset by ticker symbol or name. Returns price and asset metadata."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"get_option_chain"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"root_symbol":{"type":"string","minLength":1,"description":"Underlying asset symbol, e.g. AMZN"},"expiration_date_gte":{"description":"Filter by expiration date greater than or equal to this YYYY-MM-DD date","type":"string"},"expiration_date_lte":{"description":"Filter by expiration date less than or equal to this YYYY-MM-DD date","type":"string"},"type":{"description":"Filter by call or put","type":"string","enum":["call","put"]},"strike_price_gte":{"description":"Filter by strike price greater than or equal to this value","type":"string"},"strike_price_lte":{"description":"Filter by strike price less than or equal to this value","type":"string"},"delta_gte":{"description":"Filter by absolute value delta greater than or equal to this value","type":"number"},"delta_lte":{"description":"Filter by absolute value delta less than or equal to this value","type":"number"},"greeks":{"default":false,"description":"When true, include delta/gamma/theta/rho/vega on each contract","type":"boolean"},"limit":{"description":"Max number of contracts to return after filtering","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["root_symbol"]}},"description":"Search option chain by underlying symbol, option type, expiration range, strike range, and absolute delta range. Returns OCC symbols with bid and ask. If the user mentions delta, you must set greeks true, set delta_gte and delta_lte as an absolute decimal range around the target. e.g. 16 delta -> delta_gte 0.15, delta_lte 0.17. Do not call this tool without delta_gte/delta_lte for delta-based requests."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"create_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"symbol":{"type":"string","minLength":1,"description":"Ticker symbol of the asset, e.g. TSLA"},"amount":{"type":"number","exclusiveMinimum":0,"description":"The amount to trade, interpreted as dollars or shares based on unit."},"unit":{"type":"string","enum":["dollars","shares"],"description":"Whether amount is in dollars or shares."},"buy_or_sell":{"type":"string","enum":["buy","sell"]},"metadata":{"type":"object","properties":{"image_url":{"description":"URL of the image used to create the trade","type":"string"}}},"order_type":{"description":"Type of order: market (default), limit, stop, or stop_limit","type":"string","enum":["market","limit","stop","stop_limit"]},"limit_price":{"description":"Required for limit or stop-limit orders","type":"number","exclusiveMinimum":0},"stop_price":{"description":"Required for stop or stop-limit orders","type":"number","exclusiveMinimum":0},"take_profit":{"description":"Take-profit exit for Buy entries. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"The trigger amount"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"stop_loss":{"description":"Stop-loss exit for Buy entries. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"The trigger amount"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"time_in_force":{"description":"How long the order remains active: day, gtc. Omit to use brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"account_id":{"description":"ID of the brokerage account to execute the trade on. Omit to use default.","anyOf":[{"type":"number"},{"type":"string"}]}},"required":["symbol","amount","unit","buy_or_sell"]}},"description":"Create a draft stock or crypto trade order for user to review.\nUse for single-leg equity or crypto buy/sell orders.\nThis tool returns a draft order only; brokerage execution requires a separate tool."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"create_options_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"symbol":{"type":"string","minLength":1,"description":"Ticker symbol of the underlying asset, e.g. SPX, TSLA"},"legs":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["option","equity"],"description":"Type of leg: \"option\" for options, \"equity\" for stock/crypto"},"action":{"type":"string","enum":["buy","sell"],"description":"Trade action: \"buy\" or \"sell\""},"position_effect":{"description":"Open a new position or close an existing one. Required for option legs; null for equity legs.","anyOf":[{"type":"string","enum":["open","close"]},{"type":"null"}]},"occ":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"OCC format string for options (e.g., \"240119C00195000\" for Jan 19, 2024 $1950 call). Required for option legs, null for equity legs. Format: YYMMDD[C|P]STRIKE"},"quantity":{"type":"number","exclusiveMinimum":0,"description":"Number of contracts for options or shares for equity"}},"required":["type","action","occ","quantity"]},"description":"Array of trade legs. At least one leg is required."},"direction":{"description":"Required only for multi-leg spreads: \"debit\" to pay, \"credit\" to receive, or \"even\" for a zero-net limit order","type":"string","enum":["debit","credit","even"]},"limit_price":{"description":"Required for limit or stop-limit orders. Multi-leg option limit orders may use 0 with direction \"even\"","type":"number","minimum":0},"order_type":{"description":"Type of order: market (default), limit, stop, or stop_limit","type":"string","enum":["market","limit","stop","stop_limit"]},"stop_price":{"description":"Required for stop or stop-limit orders","type":"number","exclusiveMinimum":0},"time_in_force":{"description":"How long the order remains active: day, gtc. Omit to use brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"account_id":{"description":"ID of the brokerage account to execute the trade on. Omit to use default.","anyOf":[{"type":"number"},{"type":"string"}]}},"required":["symbol","legs"]}},"description":"Create a draft options trade order with one or more concrete legs.\nUse for single options, vertical spreads, and mixed equity/option strategies.\nOption legs require OCC symbols. Equity legs use occ: null.\nThis tool returns a draft order only; brokerage execution is a separate tool."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"create_trade_link"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"config":{"type":"object","properties":{"ticker":{"type":"string","minLength":1,"description":"The ticker symbol of the asset to trade"},"trade_type":{"default":0,"type":"number","enum":[0,1]},"action":{"type":"string","enum":["buy","sell"]},"amount":{"type":"number","exclusiveMinimum":0},"unit":{"default":"dollars","type":"string","enum":["dollars","shares"]},"direction":{"type":"string","enum":["debit","credit","even"]},"legs":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["option","equity"]},"action":{"type":"string","enum":["buy","sell"]},"position_effect":{"anyOf":[{"type":"string","enum":["open","close"]},{"type":"null"}]},"occ":{"anyOf":[{"type":"string"},{"type":"null"}]},"quantity":{"type":"number"}},"required":["type","action","position_effect","occ","quantity"]}},"order_type":{"default":"market","description":"Type of order: market (default), limit, stop, or stop_limit","type":"string","enum":["market","limit","stop","stop_limit"]},"limit_price":{"description":"Required for limit or stop-limit orders. Multi-leg option limit orders may use 0 for an even order","type":"number","minimum":0},"stop_price":{"description":"Required for stop or stop-limit orders","type":"number","exclusiveMinimum":0},"time_in_force":{"description":"How long the order remains active: day, gtc. Omit to use brokerage default.","type":"string","enum":["day","gtc","ioc","fok"]},"take_profit":{"description":"Take-profit exit for Buy entries. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"The trigger amount"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"stop_loss":{"description":"Stop-loss exit for Buy entries. Not supported by all brokerages.","type":"object","properties":{"value":{"type":"number","exclusiveMinimum":0,"description":"The trigger amount"},"unit":{"default":"$","description":"Absolute price ($) or percent from entry price (%).","type":"string","enum":["$","%"]}},"required":["value"]},"utm_referred":{"type":"string"}},"required":["ticker"]}},"required":["config"]}},"description":"Create a shareable Trade Link from a trade configuration.\nUse for trade alerts or shared trade ideas that others can review and edit.\nThis tool returns a URL only; it does not create brokerage orders."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"get_accounts"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown.","type":"boolean"}}}},"description":"Get all brokerage accounts for the user. Use refresh=true to request fresh balances and buying power when eligible. Currently supported: Charles Schwab, Coinbase, ETrade, Kraken, Moomoo, Public, Robinhood, Tastytrade, TradeStation, TradeStation Paper, Webull"},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"get_holdings"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"account_id":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"ID of the brokerage account to inspect"},"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown.","type":"boolean"}},"required":["account_id"]}},"description":"Get holdings for a brokerage account. Use refresh=true to request fresh brokerage data when eligible."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"get_trades"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"limit":{"description":"Number of trades to return. Defaults to 12, maximum 100.","type":"integer","exclusiveMinimum":0,"maximum":100},"cursor":{"description":"Cursor from a previous get_trades response. Pass next_cursor to continue paginating older trades.","anyOf":[{"type":"number"},{"type":"string"}]},"refresh":{"description":"When true, requests the freshest available brokerage data. Real-time refresh requires a Pro plan and has a 1 minute per-account cooldown.","type":"boolean"}}}},"description":"Get the user's recent trades with cursor pagination. Use refresh=true to request fresh brokerage sync when eligible."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"image_to_assets"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"imageBase64":{"type":"string","minLength":1,"description":"Base64 encoded image data to analyze"}},"required":["imageBase64"]}},"description":"Analyzes an image to identify companies or cryptocurrencies and returns structured asset information with prices."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"execute_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trade_id":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"ID of the trade to execute"}},"required":["trade_id"]}},"description":"Execute a draft trade order by trade ID. Use only after the user explicitly requests to execute the specific trade.\n    DO NOT call this immediately after create_trade or create_options_trade; the user must review and confirm first."},{"type":"object","required":["toolName","params"],"properties":{"toolName":{"type":"string","const":"cancel_trade"},"params":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"trade_id":{"anyOf":[{"type":"number"},{"type":"string"}],"description":"ID of the trade to cancel"}},"required":["trade_id"]}},"description":"Cancel a draft or cancellable brokerage order by trade ID.\nFor a submitted order, cancellation is requested from the brokerage and may race with an in-progress fill."}]},"example":{"toolName":"get_accounts","params":{}}}}},"responses":{"200":{"description":"The selected operation result. See the corresponding tool definition or API guide for its response fields."},"400":{"description":"Invalid tool or request parameters."},"401":{"description":"Missing or invalid bearer token. Follow OAuth discovery or provide a user-created API key."},"403":{"description":"Insufficient scope or plan access."},"429":{"description":"Rate limit exceeded."}}}}},"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","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":"Create a user API key at https://tradeit.app/account/api-keys."}}}}