Skip to content

Billing

Our APIs also expose platform usage, this information is available in two formats:

  • CSV
  • JSON

Usage information is divided by Server and by Template

Server Usage

To receive server usage, the following endpoint is exposed:

HTTP Request

GET /ecs/v2/billing/servers/<year>/<month>
Remember to replace year and month with the desired month, future dates are not allowed.

Server Usage CSV

To obtain usage in CSV format, the "type" parameter must be used in the request query:

HTTP Request

GET /ecs/v2/billing/servers/<year>/<month>?type=csv

A response of type text/csv containing the requested usage will be received

Server Usage JSON

To obtain usage in JSON format, the "type" parameter must be used in the request query:

HTTP Request

GET /ecs/v2/billing/servers/<year>/<month>?type=json
HTTP Response
[
  {
        "plan": "ECS1",
        "name": "ec200200",
        "group": null,
        "notes": "centos-ecs1-it-fr2-1713866700891",
        "status": "Booted",
        "year": 2024,
        "month": 4,
        "creation_date": "2024-04-23T10:06:22.973332+00:00",
        "deletion_date": null,
        "billed_hours": 182,
        "cost": 2.64,
        "summary": {
            "online_hour": 1,
            "online_price": 0.02,
            "offline_hour": 0,
            "offline_discount": 20,
            "offline_price": 0.0,
            "offline_reduction": 0.0,
            "reserved_discounts": [
                {
                    "reserved_plan": 26,
                    "reserved_hour": 181,
                    "reserved_discount": 15,
                    "reserved_price": 2.62,
                    "reserved_reduction": 0.46,
                    "reserved_start_date": "2024-04-23T10:06:22.973332+00:00",
                    "reserved_end_date": "2024-10-23T10:06:22.973332+00:00"
                }
            ],
            "original_cost": 3.09
        }
    },
]

Template Usage

To receive template usage, the following endpoint is exposed:

HTTP Request

GET /ecs/v2/billing/templates/<year>/<month>
Remember to replace year and month with the desired month, future dates are not allowed.

Template Usage CSV

To obtain usage in CSV format, the "type" parameter must be used in the request query:

HTTP Request

GET /ecs/v2/billing/templates/<year>/<month>?type=csv

A response of type text/csv containing the requested usage will be received

Template Usage JSON

To obtain usage in JSON format, the "type" parameter must be used in the request query:

HTTP Request

GET /ecs/v2/billing/templates/<year>/<month>?type=json

HTTP Response

[
    {
        "cost": 0.18,
        "name": "ei200112",
        "status": "Created",
        "creation_date": "2025-02-05T08:10:49.938995+00:00",
        "deletion_date": null,
        "notes": "MyDemo",
        "year": 2025,
        "month": 2,
        "hours": 55,
        "size_on_disk": 1510080
    },
]

Snapshot Usage

To retrieve the usage of snapshots, the following endpoint is exposed:

HTTP Request

GET /ecs/v2/billing/snapshots/<year>/<month>
Remember to replace year and month with the desired month. Future dates are not allowed.

Snapshot Usage CSV

To obtain the usage in CSV format, you need to use the "type" parameter in the request query:

HTTP Request

GET /ecs/v2/billing/snapshots/<year>/<month>?type=csv

You will receive a text/csv response containing the requested usage data.

Snapshot Usage JSON

To obtain the usage in JSON format, you need to use the "type" parameter in the request query:

HTTP Request

GET /ecs/v2/billing/snapshots/<year>/<month>?type=json

HTTP Response

{
    "year": 2025,
    "month": 2,
    "total_cost": 3.7,
    "rows_count": 37,
    "snapshots": [
        {
            "snapshot": 58,
            "snapshot_name": "ec200404-SNP-6",
            "snapshot_status": "DD",
            "snapshot_status_label": "Deleted",
            "snapshot_description": "periodic snapshot - 2025-01-31T12:00:00.104930+00:00",
            "snapshot_created_at": "2025-01-31T12:00:00.129801+00:00",
            "snapshot_deleted_at": "2025-02-03T16:36:55.938131+00:00",
            "size_on_disk": 1571400,
            "hours": 65,
            "final_cost": 0.1
        },
    ],
}