Getting started
The fastest path from nothing to a resting order on the staging venue.
You only need curl. Base URL for every example:
https://api.staging.sphx.io.
Staging is a live, always-on demo venue with simulated flow. Accounts created here receive a starter balance automatically; funds and fills are not real.
1. Create an account
Sign up with an email and password. The response includes your account and a session token; staging seeds every new account with a starter balance, credited straight to the margin sub-account.
curl -X POST https://api.staging.sphx.io/v1/auth/signup \
-H 'content-type: application/json' \
-d '{"email": "you@example.com", "password": "your_long_passphrase_here"}'
For programmatic trading you'll want an API key rather than a session:
curl -X POST https://api.staging.sphx.io/v1/credentials \
-H "Authorization: Bearer $SPHINX_TOKEN" \
-H 'content-type: application/json' \
-d '{"label": "my-bot"}'
The plaintext_key in the response is shown exactly once — store it.
See Authentication for the credential model.
2. Look at the market
Instruments, books, and candles are public — no auth required.
# What's listed?
curl https://api.staging.sphx.io/v1/instruments
# The order book for one instrument.
curl https://api.staging.sphx.io/v1/instruments/1000/orderbook
# Recent candles (1m/5m/15m/1h/1d).
curl "https://api.staging.sphx.io/v1/instruments/1000/candles?resolution=5m"
3. Place an order
Orders are priced in integer pips and sized in whole contracts. A limit buy:
curl -X POST https://api.staging.sphx.io/v1/orders \
-H "Authorization: Bearer $SPHINX_TOKEN" \
-H 'content-type: application/json' \
-d '{
"instrument_id": 1000,
"sub_account_id": 1,
"side": "buy",
"type": "limit",
"price_pips": 3900,
"count": 1,
"tif": "gtc"
}'
Every response arrives in the same
envelope with a correlation_id you
can quote in support requests.
4. Watch it live
Fills, book changes, and candle updates stream over a single WebSocket endpoint — see the streaming overview.
wss://api.staging.sphx.io/v1/ws
Private channels need your bearer token on the upgrade request.
Where next
- Authentication — credentials, entitlements, account states
- Conventions — units, timestamps, pagination, the two instrument views
- Errors — machine-readable codes and retry semantics