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 balancesokx_get_positions- Get open positions
Support
okx_get_announcements- List public exchange announcements
Orders
okx_get_order_details- Get a single orderokx_get_open_orders- List open ordersokx_get_order_history- List historical orders
Trading
okx_place_order- Place a spot or derivatives orderokx_cancel_order- Cancel an open order
Trading Bots
okx_place_recurring_buy_order- Create a recurring buy strategyokx_amend_recurring_buy_order- Update a recurring buy strategy
Common Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
region | string | Yes | other, us_au, or eu |
apiKey | string | Private ops | OKX API key |
apiSecret | string | Private ops | OKX API secret |
passphrase | string | Private ops | OKX API passphrase |
operation | string | Yes | OKX operation to execute |
instId | string | Order ops | Instrument ID such as BTC-USDT |
instType | string | No | Instrument type filter such as SPOT |
side | string | For place order | buy or sell |
ordType | string | For place order | Order type such as market or limit |
sz | string | For place order | Order size |
px | string | For limit orders | Order price |
ordId | string | For cancel / lookup | OKX order ID |
limit | string | No | Maximum records to return |
Output
| Parameter | Type | Description |
|---|---|---|
data | json | OKX response payload |
status | number | HTTP status code |
headers | json | Response headers |
errorCode | string | OKX error code when present |
errorMessage | string | OKX 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.