Skip to content

Environments

Describes stx-python 0.10.1, the current release.

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.

STX is operated by XV Exchange, LLC, a Designated Contract Market regulated by the U.S. Commodity Futures Trading Commission (CFTC). Contracts traded on STX are cleared by XV Clearing, LLC, a CFTC-registered Derivatives Clearing Organization. Trading involves substantial risk of loss and may not be appropriate for everyone. Members risk losing the cost to enter any transaction, including fees. Consider whether trading is appropriate for you in light of your experience and financial resources. Nothing on this site is investment advice or a recommendation to trade. Past performance is not indicative of future results.

© 2026 STX. All rights reserved.llms.txtllms-full.txtView as Markdown
Docs version v1.10.5