> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://partner.ninjatrader.com/connect/resources/reference/environments/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://partner.ninjatrader.com/_mcp/server. # Environments > API environments, URLs, and configuration for the NinjaTrader Partner API The NinjaTrader Partner API is split into two main environments: **Development** and **Production**. Each environment has two domains: **Live** and **Demo**. Understanding these environments is crucial for building a reliable integration. ## Quick Start #### Development Environment Use this for testing and development: * **API Base**: `https://demo-api.staging.ninjatrader.dev/v1` (Demo) or `https://live-api.staging.ninjatrader.dev/v1` (Live) * **WebSocket**: `wss://demo-api.staging.ninjatrader.dev/v1/websocket` or `wss://live-api.staging.ninjatrader.dev/v1/websocket` * **Client Access**: `https://trader.staging.ninjatrader.dev/` or `https://web.staging.ninjatrader.dev/` #### Production Environment Use this for live operations: * **API Base**: `https://demo.tradovateapi.com/v1` (Demo) or `https://live.tradovateapi.com/v1` (Live) * **WebSocket**: `wss://demo.tradovateapi.com/v1/websocket` or `wss://live.tradovateapi.com/v1/websocket` * **Client Access**: `trader.tradovate.com` or `web.ninjatrader.com` ## Environment Details ### Development Environment This is your testing environment for API integration and development work. You should use this environment for: * Testing your integration before going live * Experimenting with new features * Debugging issues without affecting real users ### Production Environment This is your live environment for real client operations and real trading. Only use this environment when: * You're ready to serve actual customers * Your integration has been thoroughly tested * You're confident in your implementation ### Domain Types Understanding the difference between Live and Demo domains is crucial: * **Live**: This environment represents real trading with actual money and positions. Any live accounts you own will show up in this environment. This environment must be used to manage certain entities like tradovate subscriptions, market data subscriptions, and user plugins. * **Demo**: This represents simulated trading for evaluation and testing purposes. All of your Demo accounts will show up in this environment. ## Client Access Points Your users will access their accounts through these client applications: ### Development Clients * **Tradovate**: `https://trader.staging.ninjatrader.dev/` * **NinjaTrader**: `https://web.staging.ninjatrader.dev/` These are your development point-of-access for clients. When you create a user, you can test their experience using one of these clients. ### Production Clients * **Tradovate**: `trader.tradovate.com` * **NinjaTrader**: `web.ninjatrader.com` These are your production point-of-access for real clients. When a user signs up, they can access their evaluation accounts via one of these clients, or the Tradovate or NinjaTrader standalone applications. They can also access via the TDV or NT mobile apps. ### Admin Dashboards * **Development**: `dashboards.staging.ninjatrader.dev` * **Production**: `dashboards.tradovate.com` These are the development and production admin dashboards apps, respectively. You'll use these to manage your users and monitor your integration. ## API Base URLs ### Development Environment * **Development Demo URL**: `https://demo-api.staging.ninjatrader.dev/v1` * **Development Live URL**: `https://live-api.staging.ninjatrader.dev/v1` ### Production Environment * **Production Demo URL**: `https://demo.tradovateapi.com/v1` * **Production Live URL**: `https://live.tradovateapi.com/v1` ## WebSocket URLs ### Real-Time User Data WebSockets #### Development * `wss://demo-api.staging.ninjatrader.dev/v1/websocket` OR * `wss://live-api.staging.ninjatrader.dev/v1/websocket` Use of live or demo URLs will give real-time updates for their respective environments. #### Production * `wss://demo.tradovateapi.com/v1/websocket` OR * `wss://live.tradovateapi.com/v1/websocket` ### Market Data WebSockets #### Development * `wss://md-api.staging.ninjatrader.dev/v1/websocket` #### Production * `wss://md.tradovateapi.com/v1/websocket` ### Market Replay WebSockets Market Replay is a trader-facing feature for replaying historical market sessions. These URLs serve that feature rather than partner integrations. #### Development * `wss://replay.staging.ninjatrader.dev/v1/websocket` When using a Market Replay Socket, forward all messages (both market data and real-time user data) through the replay socket. Expect all messages from the replay session to come through the replay socket. #### Production * `wss://replay.tradovateapi.com/v1/websocket` ## Environment Differences ### Live Environment Capabilities * Change Tradovate Subscription details * Cancel or renew subscriptions manually * Immediately expire a subscription * Change user plugins (such as TradingView) ### Demo Environment Capabilities * Change Demo accounts' permissions * Adjust Demo accounts' max-net liquidities * Change the Risk Category of a Demo account, useful for: * Applying a halted-trading category for an individual account * Upgrading an account to a new type * Changing an account's baseline risk rules * Halt trading for an entire category (useful to stop all, or specific categories of users from trading in an emergency) * Return an account to its SOD state at a given date (by session date, not calendar date) ## Best Practices ### Environment Selection * **Start with Development**: Use the Development environment for all testing and integration work * **Test thoroughly**: Only move to Production when you're confident in your implementation * **Use Demo first**: Test with Demo domains before using Live domains, even in Production ### URL Configuration * **Store URLs as variables**: Store environment URLs as configuration variables in your application * **Use environment-specific credentials**: Use different authentication credentials for each environment * **Handle errors gracefully**: Implement proper error handling for environment-specific responses ### WebSocket Connections * **Choose the right URL**: Use the appropriate WebSocket URL for your environment and data type * **Implement reconnection logic**: WebSocket connections can drop, so implement proper reconnection logic * **Handle environment differences**: Different environments may have different connection requirements --- > API environments, URLs, and configuration for the NinjaTrader Partner API