Introduction

Welcome to the OSL OpenAPI Overview. This guide provides technical specifications for integrating with the OSL Global API.

Getting Started - Create API Key

This guide provides technical specifications for integrating with the OSL Global API. Before beginning development and trading, please log in to our web platform and configure your API credentials.

You can navigate to the API key management section to create your API keys. Each sub-account supports up to 10 sets of API keys. Access scopes can be configured for each key:

  • Read-Only: Grants access to data retrieval, such as market data.
  • Spot Trading: Grants permission for order placement and cancellations in the Spot market.
  • Futures Trading: Grants permission for order placement and cancellations in the Futures market.

Access Credentials

Upon creation, the system will generate the following credentials. Please ensure you store them securely:

CredentialDescription
API KeyYour unique public identifier used to authenticate requests.
Secret KeyA private signing key. Never share this key.
PasswordA user-defined security code. Note: If lost, the Passphrase cannot be recovered; you will need to delete and recreate the API key.
❗️

Security Reminder:

These credentials provide full access to your account, as such we enforce IP Whitelisting during API key creation.

If you suspect your keys have been compromised, delete them immediately.

Environment Information


OSL Global Site

  • HTTP Endpoint: https://api.osl.com

  • WebSocket Endpoint: wss://stream-api.osl.com



Endpoint Types

The API is divided into two primary categories:

  1. Public Endpoints: Used for retrieving market data and platform configurations. Accessible without authentication.
  2. Private Endpoints: Used for account management and trading operations. Every private request requires a valid signature and your APIKey in the request headers.

WebSocket API

WebSocket enables persistent, full-duplex connections, allowing for real-time updates based on market events. Key advantages include minimal header overhead (~2 bytes), bidirectional communication, and reduced resource consumption. It is highly recommended for latency-sensitive operations.

WebSocket Endpoints

Channel TypeEndpointDescription
Public Channelwss://stream-api.osl.com/openapi/v1/wsMarket Data
Private Channelwss://stream-api.osl.com/openapi/v1/ws/userTrading & Account

Connection & Rate Limits

  • Connection Limit: 300 connection attempts per IP / 5 minutes; maximum 100 concurrent connections per IP.
  • Subscription Limit: 240 subscriptions per hour / connection; maximum 1,000 channels per connection.
  • Heartbeat: Send a ping message every 30 seconds. The server will respond with pong. The server terminates connections that do not send a ping within 2 minutes.
  • Message Rate: Each connection can receive a maximum of 10 messages per second.
  • Stability Tip: We recommend subscribing to no more than 50 channels per connection for maximum stability.

Example: Subscribing to a Public Ticker

Connect: wss://stream-api.osl.com/v2/ws/public Request:

{
  "op": "subscribe",
  "args": [
    {
      "channel": "ticker",
      "instType": "sp",
      "instId": "btcusdt"
    }
  ]
}