Trading API
Run your strategy on autopilot.
A plain REST API for your OnePass accounts, plus a live stream, a Python library and an MCP server for AI agents: market, limit and stop orders, brackets, Level 2 and candles. Same rules, same prices and same commission as the trade screen ($0 on Standard, 0.01% per round trip on Pro).
1. Get a key
Create one under My accounts → API. Tick "Allow trading" to place orders; leave it off for a read-only key. The key is shown once.
2. Send it with every request
curl https://onepasstraderfunding.com/api/v1/accounts \
-H "Authorization: Bearer op_live_…"3. Trade
curl -X POST https://onepasstraderfunding.com/api/v1/accounts/ACCOUNT_ID/orders \
-H "Authorization: Bearer op_live_…" -H "Content-Type: application/json" \
-d '{"type":"market","symbol":"BTC","side":"long","notional":50000,"tp":83000,"sl":80500}'import requests
API = "https://onepasstraderfunding.com/api/v1"
H = {"Authorization": "Bearer op_live_…"}
acct = requests.get(f"{API}/accounts", headers=H).json()["accounts"][0]
r = requests.post(f"{API}/accounts/{acct['id']}/orders", headers=H,
json={"type": "limit", "symbol": "ETH", "side": "long", "notional": 20000, "price": 2400})
print(r.json())Python library
One file, no dependencies: onepass_api.py. Every endpoint, plus a live stream that reconnects by itself.
from onepass_api import OnePass
op = OnePass("op_live_…", base="https://onepasstraderfunding.com/api/v1")
acct = op.accounts()[0]
op.order(acct["id"], "market", "NVDA", "long", notional=20000, tp=230, sl=215)
for event, data in op.stream(["NVDA", "BTC"], account=acct["id"]):
print(event, data) # "quote" and "account" eventsAI agents (MCP)
Let Claude or any MCP client read markets and trade your accounts: onepass-mcp.mjs (Node 18+, no dependencies). Give it a read-only key if you want the agent to look but not trade.
{
"mcpServers": {
"onepass": {
"command": "node",
"args": ["/path/to/onepass-mcp.mjs"],
"env": { "ONEPASS_API_KEY": "op_live_…", "ONEPASS_API_BASE": "https://onepasstraderfunding.com/api/v1" }
}
}
}Endpoints
Base URL https://onepasstraderfunding.com/api/v1 · JSON in and out · markets: NQ, BTC, ETH, SOL, XRP, DOGE, HYPE, FARTCOIN, kPEPE, PENGU, TRUMP, SPX, SP500, GOLD, SILVER, OIL, NVDA, GOOGL, MU, META, TSLA, INTC, AMD, AAPL, AMZN, MSFT
- GET
/accountsYour accounts: balance, equity, open position, resting order, status.
- GET
/accounts/{id}One account and its trade history.
- POST
/accounts/{id}/ordersneeds trading keyPlace an order.
{ "type": "market", "symbol": "BTC", "side": "long", "notional": 50000, "tp": 83000, "sl": 80500 } { "type": "limit", "symbol": "NQ", "side": "short", "notional": 60000, "price": 30750 } - DELETE
/accounts/{id}/ordersneeds trading keyCancel the resting limit or stop order.
- PATCH
/accounts/{id}/positionneeds trading keySet, move or clear (null) take-profit and stop-loss.
{ "tp": 83500, "sl": null } - DELETE
/accounts/{id}/positionneeds trading keyClose the open position at market.
- GET
/marketsEvery market with the live bid and ask.
- GET
/markets/{symbol}/book?depth=10Level 2 market depth.
- GET
/markets/{symbol}/candles?tf=1m&limit=300OHLC candles: 1m, 5m, 15m, 1h, 4h.
- GET
/pausesTrading pauses over the next 48 hours.
- GET
/stream?symbols=BTC,NVDA&account={id}Live updates as Server-Sent Events, so your bot doesn't poll: quote events (best bid and ask, every half second when it changes), account events (balance, equity, position, every 2 seconds) and a reconnect event after about 4 minutes. Up to 10 markets per stream.
How orders behave
- Market orders and closes fill at the live exchange price 250 ms after they arrive, the same as on the trade screen. Buys fill at the ask, sells at the bid.
- Limit and stop orders rest until the market reaches their price; one resting order per account, while flat. A pause, or the account closing or expiring, cancels it.
- Your account's profit target and static max loss always apply and close the position exactly at the level.
- Trading pauses (major news releases, NQ, S&P 500, gold, silver and oil while CME is closed, and stocks outside the NYSE regular session) block new orders; GET /pauses lists them.
- Limits: 10 requests per second per key, and at most two new orders per second per account. Closing is never limited.
- Opposite positions across your own accounts are refused, the same as on screen.
Errors
{ "error": { "code": "rejected", "message": "A buy limit must be below the current ask." } }Codes: missing_key, invalid_key (401) · read_only_key (403) · not_found (404) · rejected (400) · restricted_location (451) · rate_limited (429, retry after a second).