Authentication Parameters
Authentication parameters identify your strategy and user account when sending signals to OptAlgo.
strategy_key ⚠️
- Type:
string - Required: Yes (Critical)
- Description: Encrypted authentication key that identifies your strategy and user account
Details
The strategy_key is the only required parameter for all signals. This encrypted key contains your user_id and strategy_id, which OptAlgo uses to:
- Authenticate your request
- Route the signal to the correct strategy
- Apply your strategy's configuration
- Execute trades on your connected exchange
How to Get Your Strategy Key
- Log in to the OptAlgo Dashboard
- Navigate to your strategies
- Create a new strategy or select an existing one
- Copy the strategy key from the strategy settings page
- Use this key in all signals for that strategy
Security
- The strategy key is a signed token and is verified on the server
- Invalid or missing keys result in a
400 Bad Requesterror - Never share your strategy key publicly
- Each bot has its own key
- The key does not expire. It stays valid for as long as the bot exists, and a key cannot be revoked on its own. If a key leaks, stop the bot right away, then delete it and create a new one. A deleted bot's key is rejected (
Strategy not found).
Example Usage
{
"strategy_key": "your_strategy_key_here",
"exchange": "BINANCE",
"ticker": "BTCUSDT.P",
"position_side": "LONG",
"action": "BUY",
"leverage": 5
}
Error Messages
| Error | Cause | Solution |
|---|---|---|
| "Strategy key is empty" | Missing strategy_key parameter | Add strategy_key to your signal JSON |
| "Invalid strategy key" | Incorrect or corrupted key | Copy the strategy key again from dashboard |
| "Strategy not found" | Strategy was deleted | Create a new strategy and use its key |