Skip to content
🌐Network: Mainnet▼

API Overview ​

Operational basics for integrating with the o2 REST and WebSocket APIs.

For contract addresses, market IDs, asset IDs, chain IDs, and RPC endpoints, see Network Identifiers. For SDK-first integration guides, use Authentication & Signing, Orders, and Sessions.

Where To Start ​

CategoryUse It For
Health CheckAPI server health status
Market DataMarkets, tickers, summaries, fees, and order book depth
TradingTrades, candles, order action payloads, order history, and session endpoints
AccountsAccount creation, balances, owner operations, withdrawals, and nonce windows
WebSocketsWebSocket streams, reconnect behavior, and stream errors
Aggregator Endpoints/v1/agg/ aliases for third-party market-data integrations

Order creation and cancellation are submitted as actions through POST /v1/session/actions.

  • Create Order documents the CreateOrder action payload and links to each supported order type.
  • Cancel Order documents the CancelOrder action payload.
  • Order History documents read endpoints for retrieving orders after submission.

For signing, session authorization, batching, and nonce rules, see Session Management and Nonces.

Networks ​

o2 docs and examples reference three networks: Mainnet, Testnet, and Devnet. Use the network selector in the docs header to switch interactive examples where supported.

Mainnet ​

Use mainnet for production trading.

ComponentURL
REST APIhttps://api.o2.app
WebSocketwss://api.o2.app/v1/ws
Trading UIhttps://trade.o2.app

Mainnet has no faucet. For deposits and withdrawals, use the o2 trading UI or follow the Deposits & Withdrawals guide.

Testnet ​

Use testnet for integration testing.

ComponentURL
REST APIhttps://api.testnet.o2.app
WebSocketwss://api.testnet.o2.app/v1/ws
Fuel RPChttps://testnet.fuel.network/v1/graphql
Faucethttps://fuel-o2-faucet.vercel.app/api/testnet/mint-v2

For faucet behavior, whitelisting, and thin testnet order books, see Testing on Testnet.

Devnet ​

Devnet is also referenced by the SDK quick starts and bot integration guide.

ComponentURL
REST APIhttps://api.devnet.o2.app
WebSocketwss://api.devnet.o2.app/v1/ws
Fuel RPChttps://devnet.fuel.network/v1/graphql
Faucethttps://fuel-o2-faucet.vercel.app/api/devnet/mint-v2

Allowed HTTP Verbs ​

The o2 REST API uses these HTTP verbs:

VerbUsage
GETRetrieve markets, order books, trades, orders, balances, account state, and health information
POSTCreate accounts, execute session actions, run account operations, withdraw assets, and call analytics actions
PUTCreate or update trading sessions

Unsupported verbs should be treated as unavailable unless a specific endpoint page documents them.

Authentication Headers ​

Public market data endpoints generally do not require signatures.

Account-specific state-changing endpoints require signed payloads. Most session and account operation endpoints also require:

http
O2-Owner-Id: 0x<owner_b256_address>

For the full owner/session key model and signing flows, see Authentication & Signing.

Server Location ​

The o2 API is hosted on AWS in the Tokyo region: ap-northeast-1.

If you are colocating latency-sensitive infrastructure, use ap-northeast-1 as the reference region unless the o2 team provides updated guidance.

Response Format ​

REST responses are JSON. Error responses use structured error codes where available; see Error Codes.

Interactive endpoint pages use the selected network from the docs network selector when possible.

Health Check ​

Check API server health status.

GET /health

Response:

json
{
  "status": "ok"
}

Reference Format ​

Endpoint pages document:

  • HTTP method and path
  • query parameters or request body
  • response shape
  • rate limit
  • source reference

For cross-cutting behavior, use the dedicated references: