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 80 minutes. Each token response includes an expirationTime field with the exact expiry time. Renew by calling renewAccessToken with your current token before it expires.
Key Requirements
- Store access tokens to prevent overuse of the
accessTokenRequestendpoint - Renew tokens before they expire (80 minutes), using the
expirationTimefield from the token response for the exact expiry time
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
- Renew Before Expiration: Access tokens expire after 80 minutes; renew before the
expirationTimein the token response by callingrenewAccessToken - 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.

