POST
/
cloud
/
v1
/
usage_report
Python
from datetime import datetime
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
usage_report = client.cloud.usage_reports.get(
    time_from=datetime.fromisoformat("2023-01-01T00:00:00"),
    time_to=datetime.fromisoformat("2023-02-01T00:00:00"),
)
print(usage_report.count)
{
  "count": 1,
  "resources": [
    {
      "billing_metric_name": "bm3-ai-1xlarge-h100-80-8_min",
      "billing_value": 1000,
      "billing_value_unit": "minutes",
      "first_seen": "2024-07-01T00:00:30Z",
      "flavor": "bm3-ai-1xlarge-h100-80-8",
      "last_name": "ai_cluster_name",
      "last_seen": "2024-07-30T23:59:30Z",
      "project_id": 10,
      "region": 76,
      "region_id": 76,
      "tags": [
        {
          "os_distro": "ubuntu"
        },
        {
          "os_version": "22.04"
        }
      ],
      "type": "<string>",
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "totals": [
    {
      "billing_metric_name": "bm3-ai-1xlarge-h100-80-8_min",
      "billing_value": 1000,
      "billing_value_unit": "minutes",
      "flavor": "bm3-ai-1xlarge-h100-80-8",
      "region": 76,
      "region_id": 76,
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Body

application/json

Response

200 - application/json

OK

The response is of type object.