{"openapi":"3.1.0","info":{"title":"Alpaca (BYOK) API","version":"0.1.0","description":"Alpaca (BYOK) lets an AI assistant read your own Alpaca data through the Alpaca API with a key you supply (Alpaca paper-trading API key ID). Read-only: 10 tools (get_account, list_positions, get_position, list_orders, get_order, list_assets, get_asset, get_portfolio_history, list_account_activities, get_market_clock). The BYOK key travels with each request, is used for that one call only and is...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-alpaca.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-alpaca/docs"},"termsOfService":"https://connectorbay.com/byok-alpaca/terms"},"servers":[{"url":"https://byok-alpaca.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-alpaca/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_account":{"post":{"operationId":"get_account","summary":"Show the paper-trading account: status, equity, cash, buying power, portfolio value and whether trading is blocked. Mone","description":"Show the paper-trading account: status, equity, cash, buying power, portfolio value and whether trading is blocked. Money and quantities are strings. Use for \"How much buying power and cash does my Alpaca paper account have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_accountArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_positions":{"post":{"operationId":"list_positions","summary":"List the account's open positions with quantity, average entry price, market value and unrealized profit or loss. Money ","description":"List the account's open positions with quantity, average entry price, market value and unrealized profit or loss. Money and quantities are strings. Use for \"What positions do I hold in my Alpaca paper account\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"list_positionsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_position":{"post":{"operationId":"get_position","summary":"Get the open position for one symbol (or asset ID) with quantity, cost basis, market value and unrealized profit or loss","description":"Get the open position for one symbol (or asset ID) with quantity, cost basis, market value and unrealized profit or loss. Money and quantities are strings. Use for \"How is my AAPL position doing in Alpaca\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"symbol_or_asset_id":{"description":"Ticker symbol such as AAPL, or the asset's UUID. Crypto pairs use the form BTCUSD.","maxLength":40,"title":"Symbol Or Asset Id","type":"string"}},"required":["symbol_or_asset_id"],"title":"get_positionArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_orders":{"post":{"operationId":"list_orders","summary":"List orders (open by default) with symbol, side, type, quantity, status and fills, newest first. Up to 500 per call; thi","description":"List orders (open by default) with symbol, side, type, quantity, status and fills, newest first. Up to 500 per call; this only reads orders and never places or cancels any. Money and quantities are strings. Use for \"What orders did I place in Alpaca this week\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"status":{"anyOf":[{"enum":["open","closed","all"],"type":"string"},{"type":"null"}],"default":"all","description":"Which orders: open, closed or all (provider default open).","title":"Status"},"symbols":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated symbols to limit to, for example 'AAPL,TSLA'.","title":"Symbols"},"side":{"anyOf":[{"enum":["buy","sell"],"type":"string"},{"type":"null"}],"default":null,"description":"Only buy or sell orders.","title":"Side"},"after":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders submitted after this ISO 8601 time (exclusive).","title":"After"},"until":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders submitted before this ISO 8601 time (exclusive).","title":"Until"},"direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Order by submission time: desc (newest first, default) or asc.","title":"Direction"},"limit":{"anyOf":[{"maximum":500,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"Maximum orders to return (1 to 500; provider default 50).","title":"Limit"}},"title":"list_ordersArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_order":{"post":{"operationId":"get_order","summary":"Get one order by its ID with status, quantities, prices and fill details. Money and quantities are strings. Use for \"Wha","description":"Get one order by its ID with status, quantities, prices and fill details. Money and quantities are strings. Use for \"What happened to Alpaca order 61e69015-8549-4bfd-b9c3-01e75843f47d\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"order_id":{"description":"Order UUID.","maxLength":60,"title":"Order Id","type":"string"}},"required":["order_id"],"title":"get_orderArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_assets":{"post":{"operationId":"list_assets","summary":"List tradable assets (symbol, name, exchange, class, tradable, fractionable, shortable). Defaults to US equities; filter","description":"List tradable assets (symbol, name, exchange, class, tradable, fractionable, shortable). Defaults to US equities; filter by status or exchange because the full list is long. Shows at most 100. Use for \"Is TSLA tradable on Alpaca, and on which exchange\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"status":{"anyOf":[{"enum":["active","inactive"],"type":"string"},{"type":"null"}],"default":null,"description":"Only active or inactive assets.","title":"Status"},"asset_class":{"anyOf":[{"maxLength":30,"type":"string"},{"type":"null"}],"default":null,"description":"Asset class, for example us_equity (provider default) or crypto.","title":"Asset Class"},"exchange":{"anyOf":[{"enum":["AMEX","ARCA","BATS","NYSE","NASDAQ","NYSEARCA","OTC","CRYPTO"],"type":"string"},{"type":"null"}],"default":null,"description":"Only this exchange: AMEX, ARCA, BATS, NYSE, NASDAQ, NYSEARCA, OTC or CRYPTO.","title":"Exchange"}},"title":"list_assetsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_asset":{"post":{"operationId":"get_asset","summary":"Get one asset by ticker symbol or asset ID: name, exchange, class, status and whether it is tradable, fractionable or sh","description":"Get one asset by ticker symbol or asset ID: name, exchange, class, status and whether it is tradable, fractionable or shortable. Use for \"Can I trade AAPL fractionally on Alpaca\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"symbol_or_asset_id":{"description":"Ticker symbol such as AAPL, or the asset's UUID.","maxLength":40,"title":"Symbol Or Asset Id","type":"string"}},"required":["symbol_or_asset_id"],"title":"get_assetArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_portfolio_history":{"post":{"operationId":"get_portfolio_history","summary":"Get the account's equity and profit/loss time series over a period (for example 1M) at a chosen resolution. Returns para","description":"Get the account's equity and profit/loss time series over a period (for example 1M) at a chosen resolution. Returns parallel arrays of timestamps, equity, profit_loss and profit_loss_pct. Money and quantities are strings. Use for \"How has my Alpaca paper portfolio value changed over the last month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"period":{"anyOf":[{"maxLength":6,"type":"string"},{"type":"null"}],"default":null,"description":"Duration as number plus unit D, W, M or A (year), for example 1W or 1M (provider default 1M). Not allowed together with both start and end.","title":"Period"},"timeframe":{"anyOf":[{"enum":["1Min","5Min","15Min","1H","1D"],"type":"string"},{"type":"null"}],"default":null,"description":"Resolution: 1Min, 5Min, 15Min, 1H or 1D. Periods over 30 days only accept 1D.","title":"Timeframe"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"First timestamp (ISO 8601).","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Last timestamp (ISO 8601).","title":"End"}},"title":"get_portfolio_historyArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_account_activities":{"post":{"operationId":"list_account_activities","summary":"List account activities such as order fills, dividends and fees with date, symbol, quantity and amount. Up to 100 per pa","description":"List account activities such as order fills, dividends and fees with date, symbol, quantity and amount. Up to 100 per page; pass the last activity id as page_token for the next page. Use for \"What fills and dividends did my Alpaca account have recently\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"category":{"anyOf":[{"enum":["trade_activity","non_trade_activity"],"type":"string"},{"type":"null"}],"default":null,"description":"Only trade_activity or non_trade_activity.","title":"Category"},"after":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only activities created after this date (YYYY-MM-DD or ISO 8601).","title":"After"},"until":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only activities created before this date.","title":"Until"},"direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"Order by time: desc (newest first, default) or asc.","title":"Direction"},"page_size":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"Entries per page (1 to 100).","title":"Page Size"},"page_token":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"The id of the last activity of the previous page; leave empty for the first page.","title":"Page Token"}},"title":"list_account_activitiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_market_clock":{"post":{"operationId":"get_market_clock","summary":"Show whether the US stock market is open now and the next open and close times. Use for \"Is the US stock market open rig","description":"Show whether the US stock market is open now and the next open and close times. Use for \"Is the US stock market open right now\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_market_clockArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}