API Key Authentication for Evaluation Partners
API key authentication system for Tradovate evaluation partners. This guide covers the complete authentication flow using your provided API key to obtain and manage access tokens.
Authentication Overview
Evaluation partners use API key authentication to obtain access tokens for secure communication with Tradovate services. Access tokens expire after 90 minutes and should be refreshed every 85 minutes to ensure uninterrupted service.
Key Requirements
- Store access tokens to prevent overuse of the
getAccessTokenendpoint - Refresh tokens every 85 minutes (they expire after 90 minutes)
Implementation
Authentication Implementation
First, create a .env file in your project root with your Tradovate credentials:
Install the dotenv package to load environment variables:
Security Best Practice: Add .env to your .gitignore file to prevent committing sensitive credentials to version control:
Now implement authentication using environment variables:
Using the Access Token
Once you have an access token, you can make authenticated requests to the API. The access token must be send as a bearer token in the Authorization header for all HTTP requests. Here’s how to verify your authentication by calling the /auth/me endpoint:
WebSocket Integration
For WebSocket connections, authentication after connection is required. After authenticating the websocket connection, you do not need to send the access token with every request.
We will go over websockets in more detail in the websocket tutorial section.
Security Best Practices
Store Access Tokens Securely
Partner Authentication Summary
For evaluation partners, follow these key authentication requirements:
- API Key Only: Use the API key provided by Tradovate for authentication
- Store Tokens: Cache access tokens to prevent overuse of the authentication endpoint
- 85-Minute Refresh: Refresh tokens every 85 minutes (they expire after 90 minutes)
- Bearer Token: All HTTP requests must be signed with your API key as a bearer token in the Authorization header
This authentication system provides secure, efficient access token management specifically designed for evaluation partners using API key authentication.

