{"openapi":"3.1.0","info":{"title":"OANDA (BYOK) API","version":"0.1.0","description":"OANDA (BYOK) lets an AI assistant read your own OANDA data through the OANDA API with a key you supply (OANDA v20 personal access token). Read-only: 11 tools (list_accounts, get_account_summary, list_instruments, get_pricing, get_candles, list_open_positions, list_positions, list_open_trades, list_trades, list_orders, list_transactions_since_id). The BYOK key travels with each request, is used...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-oanda.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-oanda/docs"},"termsOfService":"https://connectorbay.com/byok-oanda/terms"},"servers":[{"url":"https://byok-oanda.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-oanda/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/list_accounts":{"post":{"operationId":"list_accounts","summary":"List the OANDA account numbers the token can access (one token covers all sub-accounts), with their tags. Use for \"Which","description":"List the OANDA account numbers the token can access (one token covers all sub-accounts), with their tags. Use for \"Which OANDA accounts does my token give access to\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"}},"required":["env"],"title":"list_accountsArguments","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_account_summary":{"post":{"operationId":"get_account_summary","summary":"Get an account summary: currency, balance, NAV, unrealized and realized P/L, margin used and available, and counts of op","description":"Get an account summary: currency, balance, NAV, unrealized and realized P/L, margin used and available, and counts of open trades, positions and pending orders. Amounts are returned as decimal strings. Use for \"What is my OANDA account balance and margin available\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"}},"required":["env","account_id"],"title":"get_account_summaryArguments","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_instruments":{"post":{"operationId":"list_instruments","summary":"List the instruments an account can trade (currency pairs, metals, CFDs) with type, display name, pip location, margin r","description":"List the instruments an account can trade (currency pairs, metals, CFDs) with type, display name, pip location, margin rate and size limits. Optionally limit to a list of instruments. Use for \"Which instruments can I trade on my OANDA account\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"},"instruments":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated instrument names to return only those, for example 'EUR_USD,USD_JPY'. Leave empty for all.","title":"Instruments"}},"required":["env","account_id"],"title":"list_instrumentsArguments","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_pricing":{"post":{"operationId":"get_pricing","summary":"Get current bid and ask prices (with depth buckets, closeout prices and tradeable flag) for a list of instruments. Use f","description":"Get current bid and ask prices (with depth buckets, closeout prices and tradeable flag) for a list of instruments. Use for \"What is the current EUR/USD price at OANDA\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"},"instruments":{"description":"Comma-separated instrument names, for example 'EUR_USD,USD_JPY'.","maxLength":500,"title":"Instruments","type":"string"},"since":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only return prices that changed after this time (RFC 3339 or Unix seconds).","title":"Since"}},"required":["env","account_id","instruments"],"title":"get_pricingArguments","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_candles":{"post":{"operationId":"get_candles","summary":"Get candlestick history (open, high, low, close, volume) for one instrument at a chosen granularity, as midpoint, bid or","description":"Get candlestick history (open, high, low, close, volume) for one instrument at a chosen granularity, as midpoint, bid or ask candles. Up to 5000 candles per call. Use for \"Show hourly EUR/USD candles for the last day at OANDA\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"},"instrument":{"description":"Instrument name with an underscore between the currencies, for example 'EUR_USD'.","maxLength":200,"title":"Instrument","type":"string"},"price":{"anyOf":[{"maxLength":3,"type":"string"},{"type":"null"}],"default":null,"description":"Price components as a combination of M (midpoint), B (bid) and A (ask), for example 'M' or 'BA'. Default M.","title":"Price"},"granularity":{"anyOf":[{"enum":["S5","S10","S15","S30","M1","M2","M4","M5","M10","M15","M30","H1","H2","H3","H4","H6","H8","H12","D","W","M"],"type":"string"},{"type":"null"}],"default":null,"description":"Candle size from S5 (5 seconds) through M1, M15, H1, H4, D, W to M (month). Default S5.","title":"Granularity"},"count":{"anyOf":[{"maximum":5000,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Number of candles to return (1 to 5000, default 500). Do not combine with both from and to.","title":"Count"},"from_time":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the range (RFC 3339 or Unix seconds).","title":"From Time"},"to_time":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the range (RFC 3339 or Unix seconds).","title":"To Time"},"smooth":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to use the previous close as each candle's open.","title":"Smooth"}},"required":["env","account_id","instrument"],"title":"get_candlesArguments","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_open_positions":{"post":{"operationId":"list_open_positions","summary":"List the account's open positions per instrument with long and short sides (units, average price, P/L) and margin used. ","description":"List the account's open positions per instrument with long and short sides (units, average price, P/L) and margin used. Use for \"What positions do I have open at OANDA\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"}},"required":["env","account_id"],"title":"list_open_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/list_positions":{"post":{"operationId":"list_positions","summary":"List every position the account has had per instrument, open or closed, with lifetime P/L and the long and short sides. ","description":"List every position the account has had per instrument, open or closed, with lifetime P/L and the long and short sides. Use for \"What is my lifetime profit and loss per instrument at OANDA\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"}},"required":["env","account_id"],"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/list_open_trades":{"post":{"operationId":"list_open_trades","summary":"List the account's open trades with instrument, entry price, open time, current units and unrealized P/L. Use for \"What ","description":"List the account's open trades with instrument, entry price, open time, current units and unrealized P/L. Use for \"What trades are open on my OANDA account right now\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"}},"required":["env","account_id"],"title":"list_open_tradesArguments","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_trades":{"post":{"operationId":"list_trades","summary":"List trades by state (open, closed, or all), optionally for one instrument, newest first; page backwards with before_id.","description":"List trades by state (open, closed, or all), optionally for one instrument, newest first; page backwards with before_id. Up to 500 per call. Use for \"Show my last 20 closed OANDA trades\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"},"state":{"anyOf":[{"enum":["OPEN","CLOSED","CLOSE_WHEN_TRADEABLE","ALL"],"type":"string"},{"type":"null"}],"default":null,"description":"Trade state: OPEN (default), CLOSED, CLOSE_WHEN_TRADEABLE or ALL.","title":"State"},"instrument":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Only trades of this instrument, for example 'EUR_USD'.","title":"Instrument"},"count":{"anyOf":[{"maximum":500,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Maximum number of trades (1 to 500, default 50).","title":"Count"},"before_id":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Only trades with an ID lower than this one (use the oldest ID of the previous page).","title":"Before Id"}},"required":["env","account_id"],"title":"list_tradesArguments","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 by state (pending, filled, triggered, cancelled or all), optionally for one instrument, newest first. Up to ","description":"List orders by state (pending, filled, triggered, cancelled or all), optionally for one instrument, newest first. Up to 500 per call. Use for \"Which pending orders do I have at OANDA\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"},"state":{"anyOf":[{"enum":["PENDING","FILLED","TRIGGERED","CANCELLED","ALL"],"type":"string"},{"type":"null"}],"default":null,"description":"Order state: PENDING (default), FILLED, TRIGGERED, CANCELLED or ALL.","title":"State"},"instrument":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders of this instrument, for example 'EUR_USD'.","title":"Instrument"},"count":{"anyOf":[{"maximum":500,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Maximum number of orders (1 to 500, default 50).","title":"Count"},"before_id":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Only orders with an ID lower than this one.","title":"Before Id"}},"required":["env","account_id"],"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/list_transactions_since_id":{"post":{"operationId":"list_transactions_since_id","summary":"List account transactions (fills, financing, deposits, order events) newer than a given transaction ID; the account summ","description":"List account transactions (fills, financing, deposits, order events) newer than a given transaction ID; the account summary's lastTransactionID is the newest. Use for \"What account transactions happened after transaction 6000 at OANDA\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"env":{"description":"Which OANDA environment the key belongs to: fxtrade for a live account or fxpractice for a demo (practice) account.","enum":["fxtrade","fxpractice"],"title":"Env","type":"string"},"account_id":{"description":"OANDA account number, for example '101-004-1234567-001'. list_accounts returns the numbers the key can read.","maxLength":200,"title":"Account Id","type":"string"},"id":{"description":"Return transactions with an ID greater than this one.","maxLength":20,"title":"Id","type":"string"},"type":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated transaction filters such as ORDER_FILL, DAILY_FINANCING or TRANSFER_FUNDS.","title":"Type"}},"required":["env","account_id","id"],"title":"list_transactions_since_idArguments","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}}}}