Agent Forge

OKX Trading

Inspect OKX balances, orders, and recurring buy bots

OKX is a cryptocurrency exchange with API v5 endpoints for balances, positions, order lookup, spot order placement, and recurring buy bots.

In Agent Forge, the OKX Trading block routes requests to the correct regional API domain for global, US/AU, or EU accounts. Use read-only operations first to inspect account state, then enable trading operations only with appropriately scoped API credentials.

Usage Instructions

Select your OKX region, provide API credentials for private endpoints, then choose an operation. Most signed endpoints require an API key, secret, and passphrase.

Trading and recurring-buy actions can move funds or modify live orders. Restrict API key permissions, test in a sandbox workflow first, and verify instrument IDs and order sizes before production use.

Tools

Account

  • okx_get_balance - Get account balances
  • okx_get_positions - Get open positions

Support

  • okx_get_announcements - List public exchange announcements

Orders

  • okx_get_order_details - Get a single order
  • okx_get_open_orders - List open orders
  • okx_get_order_history - List historical orders

Trading

  • okx_place_order - Place a spot or derivatives order
  • okx_cancel_order - Cancel an open order

Trading Bots

  • okx_place_recurring_buy_order - Create a recurring buy strategy
  • okx_amend_recurring_buy_order - Update a recurring buy strategy

Common Inputs

ParameterTypeRequiredDescription
regionstringYesother, us_au, or eu
apiKeystringPrivate opsOKX API key
apiSecretstringPrivate opsOKX API secret
passphrasestringPrivate opsOKX API passphrase
operationstringYesOKX operation to execute
instIdstringOrder opsInstrument ID such as BTC-USDT
instTypestringNoInstrument type filter such as SPOT
sidestringFor place orderbuy or sell
ordTypestringFor place orderOrder type such as market or limit
szstringFor place orderOrder size
pxstringFor limit ordersOrder price
ordIdstringFor cancel / lookupOKX order ID
limitstringNoMaximum records to return

Output

ParameterTypeDescription
datajsonOKX response payload
statusnumberHTTP status code
headersjsonResponse headers
errorCodestringOKX error code when present
errorMessagestringOKX error message when present

Notes

  • Category: tools
  • Type: okx_trading
  • See the OKX API v5 docs for instrument IDs, order types, and recurring buy parameters.
OKX Trading