mirror of
https://github.com/laoxong/nofx.git
synced 2026-06-07 03:07:56 +08:00
a13f39afdd
This update enables users to configure any OpenAI-compatible API endpoint, allowing the use of: - OpenAI official API (GPT-4, GPT-4o, etc.) - OpenRouter (access to multiple models) - Local deployed models (Ollama, LM Studio, etc.) - Other OpenAI-format compatible API services Changes: - config: Add custom_api_url, custom_api_key, custom_model_name fields - mcp: Add SetCustomAPI function and ProviderCustom constant - trader: Update AI initialization logic to support custom API - manager: Pass custom API config to trader instances - Add CUSTOM_API.md documentation with usage examples - Update config.json.example with custom API sample Co-Authored-By: tinkle-community <tinklefund@gmail.com>
51 lines
1.4 KiB
JSON
51 lines
1.4 KiB
JSON
{
|
|
"traders": [
|
|
{
|
|
"id": "hyperliquid_deepseek",
|
|
"name": "Hyperliquid DeepSeek Trader",
|
|
"ai_model": "deepseek",
|
|
"exchange": "hyperliquid",
|
|
"hyperliquid_private_key": "your_ethereum_private_key_without_0x_prefix",
|
|
"hyperliquid_testnet": false,
|
|
"deepseek_key": "your_deepseek_api_key",
|
|
"initial_balance": 1000,
|
|
"scan_interval_minutes": 3
|
|
},
|
|
{
|
|
"id": "binance_qwen",
|
|
"name": "Binance Qwen Trader",
|
|
"ai_model": "qwen",
|
|
"exchange": "binance",
|
|
"binance_api_key": "your_binance_api_key",
|
|
"binance_secret_key": "your_binance_secret_key",
|
|
"qwen_key": "your_qwen_api_key",
|
|
"initial_balance": 1000,
|
|
"scan_interval_minutes": 3
|
|
},
|
|
{
|
|
"id": "binance_custom",
|
|
"name": "Binance Custom API Trader",
|
|
"ai_model": "custom",
|
|
"exchange": "binance",
|
|
"binance_api_key": "your_binance_api_key",
|
|
"binance_secret_key": "your_binance_secret_key",
|
|
"custom_api_url": "https://api.openai.com/v1",
|
|
"custom_api_key": "sk-your-api-key",
|
|
"custom_model_name": "gpt-4o",
|
|
"initial_balance": 1000,
|
|
"scan_interval_minutes": 3
|
|
}
|
|
],
|
|
"leverage": {
|
|
"btc_eth_leverage": 5,
|
|
"altcoin_leverage": 5
|
|
},
|
|
"use_default_coins": true,
|
|
"coin_pool_api_url": "",
|
|
"oi_top_api_url": "",
|
|
"api_server_port": 8080,
|
|
"max_daily_loss": 10.0,
|
|
"max_drawdown": 20.0,
|
|
"stop_trading_minutes": 60
|
|
}
|