All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| getAIHubStrategyRecommend | GET /bot/strategy/recommend | Get AIHub strategy recommendations |
| postAIHubSpotGridCreate | POST /bot/spot-grid/create | Create spot grid |
| postAIHubMarginGridCreate | POST /bot/margin-grid/create | Create a lever grid |
| postAIHubInfiniteGridCreate | POST /bot/infinite-grid/create | Create infinite grid |
| postAIHubFuturesGridCreate | POST /bot/futures-grid/create | Create a contract grid |
| postAIHubSpotMartingaleCreate | POST /bot/spot-martingale/create | Create Spot Martin |
| postAIHubContractMartingaleCreate | POST /bot/contract-martingale/create | Create contract martin |
| getAIHubPortfolioRunning | GET /bot/portfolio/running | List running strategies. |
| getAIHubPortfolioDetail | GET /bot/portfolio/detail | Query order policy details |
| postAIHubPortfolioStop | POST /bot/portfolio/stop | Terminate a single running policy |
| postAIHubSmartPositionCreate | POST /bot/smart-position/create | Create rebalance bot |
| postAIHubFuturesComboCreate | POST /bot/futures-combo/create | Create futures-combo bot |
\GateApi\Model\AIHubDiscoverSuccessResponse getAIHubStrategyRecommend($market, $strategy_type, $direction, $invest_amount, $scene, $refresh_recommendation_id, $limit, $max_drawdown_lte, $backtest_apr_gte, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id, $exclude_recommendation_id)
Get AIHub strategy recommendations
Six real official source types. Exact rebalance asset membership is filtered before ranking. contract_martingale and futures_combo are manual-only. Legacy APR/drawdown and ordinary two-segment refresh remain compatible. Exclusion binds one prior logical candidate before ranking; no alternative returns an empty list without relaxing constraints.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$associate_array['market'] = 'market_example'; // string | Trading pair, such as `BTC_USDT`
$associate_array['strategy_type'] = 'strategy_type_example'; // string | Recommended target policy type; `contract_martingale` not allowed
$associate_array['direction'] = 'direction_example'; // string | Market direction
$associate_array['invest_amount'] = 'invest_amount_example'; // string | Context only. No budget eligibility filter; reported unsupported when not consumed.
$associate_array['scene'] = 'scene_example'; // string | Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic.
$associate_array['refresh_recommendation_id'] = 'refresh_recommendation_id_example'; // string | It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type|market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored.
$associate_array['limit'] = 56; // int | Actual maximum result count, 1–10; defaults to 10.
$associate_array['max_drawdown_lte'] = 'max_drawdown_lte_example'; // string | Maximum drawdown limit
$associate_array['backtest_apr_gte'] = 'backtest_apr_gte_example'; // string | Backtest annualized lower limit
$associate_array['x_gate_service_id'] = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$associate_array['x_gate_app_lang'] = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$associate_array['x_request_id'] = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$associate_array['x_trace_id'] = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
$associate_array['exclude_recommendation_id'] = 'exclude_recommendation_id_example'; // string | Refresh-only previous returned identity: type|market|backtest_id, with an optional stable parameter discriminator for colliding source IDs. Ambiguous old identities are rejected; metric-only changes do not produce a new plan.
try {
$result = $apiInstance->getAIHubStrategyRecommend($associate_array);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->getAIHubStrategyRecommend: ', $e->getMessage(), PHP_EOL;
}
?>Note: the input parameter is an associative array with the keys listed as the parameter name below.
| Name | Type | Description | Notes |
|---|---|---|---|
| market | string | Trading pair, such as `BTC_USDT` | [optional] |
| strategy_type | string | Recommended target policy type; `contract_martingale` not allowed | [optional] |
| direction | string | Market direction | [optional] |
| invest_amount | string | Context only. No budget eligibility filter; reported unsupported when not consumed. | [optional] |
| scene | string | Recommended scenario; when empty, bot-service can automatically infer according to the implementation logic. | [optional] |
| refresh_recommendation_id | string | It is recommended to refresh the context. Used when `scene=refresh` is used; when `scene` is empty but the field exists, bot-service will also automatically determine as `refresh`. The official minimum format is `strategy_type | market`; if the `recommendation_id` of the previous recommendation is directly passed through, the third paragraph `backtest_id` will be ignored. |
| limit | int | Actual maximum result count, 1–10; defaults to 10. | [optional] |
| max_drawdown_lte | string | Maximum drawdown limit | [optional] |
| backtest_apr_gte | string | Backtest annualized lower limit | [optional] |
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
| exclude_recommendation_id | string | Refresh-only previous returned identity: type | market |
\GateApi\Model\AIHubDiscoverSuccessResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubSpotGridCreate($spot_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create spot grid
Create a spot grid strategy based on the incoming parameters.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$spot_grid_create_request = new \GateApi\Model\SpotGridCreateRequest(); // \GateApi\Model\SpotGridCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubSpotGridCreate($spot_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubSpotGridCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| spot_grid_create_request | \GateApi\Model\SpotGridCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubMarginGridCreate($margin_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create a lever grid
Create a leverage grid strategy based on the passed parameters.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$margin_grid_create_request = new \GateApi\Model\MarginGridCreateRequest(); // \GateApi\Model\MarginGridCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubMarginGridCreate($margin_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubMarginGridCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| margin_grid_create_request | \GateApi\Model\MarginGridCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubInfiniteGridCreate($infinite_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create infinite grid
Create an infinite grid strategy based on passed parameters.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$infinite_grid_create_request = new \GateApi\Model\InfiniteGridCreateRequest(); // \GateApi\Model\InfiniteGridCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubInfiniteGridCreate($infinite_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubInfiniteGridCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| infinite_grid_create_request | \GateApi\Model\InfiniteGridCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubFuturesGridCreate($futures_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create a contract grid
Create a contract grid strategy based on the incoming parameters.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$futures_grid_create_request = new \GateApi\Model\FuturesGridCreateRequest(); // \GateApi\Model\FuturesGridCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubFuturesGridCreate($futures_grid_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubFuturesGridCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| futures_grid_create_request | \GateApi\Model\FuturesGridCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubSpotMartingaleCreate($spot_martingale_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create Spot Martin
Create a spot martingale strategy from the given parameters. Stop-loss semantics match the app / MartingaleBot: - Use create_params.stop_loss_per_cycle (ratio per round as a decimal string) for creation-side stop-loss; do not use stop_loss_price for creation logic. - Stop-loss prices shown on detail pages are computed per round by the engine; creation accepts optional create_params.trigger_price (trigger price).
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$spot_martingale_create_request = new \GateApi\Model\SpotMartingaleCreateRequest(); // \GateApi\Model\SpotMartingaleCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubSpotMartingaleCreate($spot_martingale_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubSpotMartingaleCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| spot_martingale_create_request | \GateApi\Model\SpotMartingaleCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubContractMartingaleCreate($contract_martingale_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create contract martin
Create a contract Martin strategy based on the input parameters.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$contract_martingale_create_request = new \GateApi\Model\ContractMartingaleCreateRequest(); // \GateApi\Model\ContractMartingaleCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubContractMartingaleCreate($contract_martingale_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubContractMartingaleCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| contract_martingale_create_request | \GateApi\Model\ContractMartingaleCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubPortfolioRunningSuccessResponse getAIHubPortfolioRunning($strategy_type, $market, $page, $page_size, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
List running strategies.
Query the list of AIHub strategies currently running by the user, and support filtering by strategy type, trading pair and paging conditions.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$associate_array['strategy_type'] = 'strategy_type_example'; // string | Filter by policy type
$associate_array['market'] = 'market_example'; // string | Filter by trading pair
$associate_array['page'] = 1; // int | Page number, default 1
$associate_array['page_size'] = 20; // int | Paging size, default 20, maximum 50
$associate_array['x_gate_service_id'] = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$associate_array['x_gate_app_lang'] = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$associate_array['x_request_id'] = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$associate_array['x_trace_id'] = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->getAIHubPortfolioRunning($associate_array);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->getAIHubPortfolioRunning: ', $e->getMessage(), PHP_EOL;
}
?>Note: the input parameter is an associative array with the keys listed as the parameter name below.
| Name | Type | Description | Notes |
|---|---|---|---|
| strategy_type | string | Filter by policy type | [optional] |
| market | string | Filter by trading pair | [optional] |
| page | int | Page number, default 1 | [optional] [default to 1] |
| page_size | int | Paging size, default 20, maximum 50 | [optional] [default to 20] |
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubPortfolioRunningSuccessResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubPortfolioDetailSuccessResponse getAIHubPortfolioDetail($strategy_id, $strategy_type, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Query order policy details
Both strategy_id and strategy_type must be passed in the request, where strategy_type is used to distribute to the underlying detailed implementation by strategy type.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$associate_array['strategy_id'] = 'strategy_id_example'; // string | Policy ID
$associate_array['strategy_type'] = 'strategy_type_example'; // string | Policy type; used for underlying detail distribution
$associate_array['x_gate_service_id'] = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$associate_array['x_gate_app_lang'] = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$associate_array['x_request_id'] = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$associate_array['x_trace_id'] = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->getAIHubPortfolioDetail($associate_array);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->getAIHubPortfolioDetail: ', $e->getMessage(), PHP_EOL;
}
?>Note: the input parameter is an associative array with the keys listed as the parameter name below.
| Name | Type | Description | Notes |
|---|---|---|---|
| strategy_id | string | Policy ID | |
| strategy_type | string | Policy type; used for underlying detail distribution | |
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubPortfolioDetailSuccessResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubPortfolioStopSuccessResponse postAIHubPortfolioStop($ai_hub_portfolio_stop_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Terminate a single running policy
Only one policy is allowed to be terminated per request. Risk warning and secondary confirmation are borne by the upper layer of OpenClaw; this interface is only responsible for executing stop.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$ai_hub_portfolio_stop_request = new \GateApi\Model\AIHubPortfolioStopRequest(); // \GateApi\Model\AIHubPortfolioStopRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubPortfolioStop($ai_hub_portfolio_stop_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubPortfolioStop: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| ai_hub_portfolio_stop_request | \GateApi\Model\AIHubPortfolioStopRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubPortfolioStopSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubSmartPositionCreate($ai_hub_rebalance_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create rebalance bot
Typed AIHub adapter; authenticated owner comes only from trusted gateway context.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$ai_hub_rebalance_create_request = new \GateApi\Model\AIHubRebalanceCreateRequest(); // \GateApi\Model\AIHubRebalanceCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubSmartPositionCreate($ai_hub_rebalance_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubSmartPositionCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| ai_hub_rebalance_create_request | \GateApi\Model\AIHubRebalanceCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\GateApi\Model\AIHubCreateSuccessResponse postAIHubFuturesComboCreate($ai_hub_futures_combo_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id)
Create futures-combo bot
Typed AIHub adapter; authenticated owner comes only from trusted gateway context.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Gate APIv4 authorization: apiv4
$config = GateApi\Configuration::getDefaultConfiguration()->setKey('YOUR_API_KEY')->setSecret('YOUR_API_SECRET');
$apiInstance = new GateApi\Api\BotApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$ai_hub_futures_combo_create_request = new \GateApi\Model\AIHubFuturesComboCreateRequest(); // \GateApi\Model\AIHubFuturesComboCreateRequest |
$x_gate_service_id = 'x_gate_service_id_example'; // string | Call source identifier; injected by APIv4 if necessary
$x_gate_app_lang = 'x_gate_app_lang_example'; // string | Language context, such as `zh-CN` / `en-US`
$x_request_id = 'x_request_id_example'; // string | Request link ID; caller can transmit transparently
$x_trace_id = 'x_trace_id_example'; // string | trace header; can be generated uniformly by APIv4
try {
$result = $apiInstance->postAIHubFuturesComboCreate($ai_hub_futures_combo_create_request, $x_gate_service_id, $x_gate_app_lang, $x_request_id, $x_trace_id);
print_r($result);
} catch (GateApi\GateApiException $e) {
echo "Gate API Exception: label: {$e->getLabel()}, message: {$e->getMessage()}" . PHP_EOL;
} catch (Exception $e) {
echo 'Exception when calling BotApi->postAIHubFuturesComboCreate: ', $e->getMessage(), PHP_EOL;
}
?>| Name | Type | Description | Notes |
|---|---|---|---|
| ai_hub_futures_combo_create_request | \GateApi\Model\AIHubFuturesComboCreateRequest | ||
| x_gate_service_id | string | Call source identifier; injected by APIv4 if necessary | [optional] |
| x_gate_app_lang | string | Language context, such as `zh-CN` / `en-US` | [optional] |
| x_request_id | string | Request link ID; caller can transmit transparently | [optional] |
| x_trace_id | string | trace header; can be generated uniformly by APIv4 | [optional] |
\GateApi\Model\AIHubCreateSuccessResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]