Retrieve CPU credit usage#
About#
Returns information about used, available and left credits
GET /users/current/accounts/:accountId/credits
For more information see Swagger documentation
Headers#
Name | Type | Required | Description |
---|---|---|---|
auth-token | string | Yes | authorization token. See Authentication & authorization |
Path parameters#
Name | Type | Required | Description |
---|---|---|---|
accountId | string | Yes | MetaTrader account id. You can retrieve account id from Web application after you add your MetaTrader account to our platform. The account id can also be obtained via Provisioning API |
Responses:
- 200 - Symbol specification returned successfully. Response schema: CreditUsage
- 401 - Authorization failed. Response schema: Error
- 404 - MetaTrader account not found or not provisioned yet or symbol is not defined for this broker. Response schema: Error
Examples#
Example request:
curl -X GET --header 'Accept: application/json' --header 'auth-token: token' 'https://mt-client-api-v1.project-stock.v3.agiliumlabs.cloud/users/current/accounts/83387573-d48c-481c-92b1-ab8471af9c20/credits'
Example response:
{
"perDeployedAccounts": [
{
"periodInSeconds": 1,
"creditsUsed": 50,
"creditsLeft": 1950,
"creditsAvailable": 2000
},
{
"periodInSeconds": 60,
"creditsUsed": 50,
"creditsLeft": 17950,
"creditsAvailable": 18000
},
{
"periodInSeconds": 3600,
"creditsUsed": 50,
"creditsLeft": 179950,
"creditsAvailable": 180000
},
{
"periodInSeconds": 21600,
"creditsUsed": 50,
"creditsLeft": 431950,
"creditsAvailable": 432000
}
],
"perAccount": [
{
"periodInSeconds": 1,
"creditsUsed": 50,
"creditsLeft": 1950,
"creditsAvailable": 2000
},
{
"periodInSeconds": 60,
"creditsUsed": 50,
"creditsLeft": 17950,
"creditsAvailable": 18000
},
{
"periodInSeconds": 3600,
"creditsUsed": 50,
"creditsLeft": 179950,
"creditsAvailable": 180000
},
{
"periodInSeconds": 21600,
"creditsUsed": 50,
"creditsLeft": 431950,
"creditsAvailable": 432000
}
],
"perUserOnServer": [
{
"periodInSeconds": 10,
"creditsUsed": 50,
"creditsLeft": 4950,
"creditsAvailable": 5000
}
]
}