Skip to content

Environments

The exchanges, their hosts and which one to start with are listed on Environments. In the SDK, pick one with region and env (as keyword arguments, as STX_REGION and STX_ENV, or in a credentials profile):

Exchange region env
STX US demo "us" "demo"
STX Ontario demo "ontario" "demo"
STX Ontario "ontario" "production"
from stx import STX, Environment, Region
with STX(region="us", env="demo") as client:
print(client.base_url, client.socket_url)
# same exchange:
same = STX(region=Region.US, env=Environment.DEMO)
same.close()

env also accepts "prod" and "live" for production.

An API key works on one exchange only, so keep one credentials profile per exchange and switch with profile; see Authentication.

To reach any other host, such as a local server, pass host="http://localhost:4000" (or set STX_HOST). The URL’s scheme is kept for both HTTP and the socket, so http:// talks plain HTTP and ws://. verify_tls=False (or STX_VERIFY_TLS=false) turns off certificate checks; use it only for a local server.

v1.5.9Changelogllms.txtllms-full.txt