Skip to main content
POST
/
cloud
/
v1
/
cost_report
/
resources
Get cost report resources (pay-as-you-go only)
curl --request POST \
  --url https://api.gcore.com/cloud/v1/cost_report/resources \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "time_from": "2023-11-07T05:31:56Z",
  "time_to": "2023-11-07T05:31:56Z",
  "enable_last_day": false,
  "limit": 10,
  "offset": 0,
  "projects": [
    123
  ],
  "regions": [
    123
  ],
  "response_format": "json",
  "schema_filter": {
    "field": "flavor",
    "type": "instance",
    "values": [
      "g1-standard-1-2"
    ]
  },
  "sorting": [
    {
      "project": "asc"
    }
  ],
  "tags": {
    "conditions": [
      {
        "key": "<string>",
        "strict": true,
        "value": "<string>"
      }
    ],
    "condition_type": "OR"
  },
  "types": [
    "ai_cluster"
  ]
}
'
{
  "count": 1,
  "price_status": "error",
  "results": [
    {
      "billing_feature_name": "AI Infrastructure: bm3-ai-1xlarge-h100-80-8 (2 x Intel Xeon 8480+, 2TB RAM, 8x3.84 TB NVMe, 8x Nvidia H100, IB 3.2 Tbit/s, 2x100Gbit/s Ethernet)  Luxembourg-2 - PAYG",
      "billing_metric_name": "<string>",
      "billing_value": 123,
      "billing_value_unit": "<string>",
      "cost": 1000,
      "currency": "EUR",
      "err": null,
      "first_seen": "2023-11-07T05:31:56Z",
      "flavor": "<string>",
      "last_name": "<string>",
      "last_seen": "2023-11-07T05:31:56Z",
      "project_id": 123,
      "region": 123,
      "region_id": 123,
      "tags": [
        {
          "os_distro": "ubuntu"
        },
        {
          "os_version": "22.04"
        }
      ],
      "type": "<string>",
      "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ]
}

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
time_from
string<date-time>
required

The start date of the report period (ISO 8601). The report starts from the beginning of this day.

Example:

"2023-01-01T00:00:00Z"

time_to
string<date-time>
required

The end date of the report period (ISO 8601). The report ends just before the beginning of this day.

Example:

"2023-02-01T00:00:00Z"

enable_last_day
boolean
default:false

Expenses for the last specified day are taken into account. As the default, False.

Example:

false

limit
integer
default:10

The response resources limit. Defaults to 10.

Example:

10

offset
integer
default:0

The response resources offset.

Required range: x >= 0
Example:

0

projects
integer[]

List of project IDs

Example:
[16, 17, 18, 19, 20]
regions
integer[]

List of region IDs.

Example:
[1, 2, 3]
response_format
enum<string>
default:json

Format of the response (csv or json).

Available options:
csv_records,
json
Examples:

"csv_records"

"json"

schema_filter
SchemaFilterSnapshotSerializer · object

Extended filter for field filtering.

Example:
{
  "field": "flavor",
  "type": "instance",
  "values": ["g1-standard-1-2"]
}
sorting
CostReportResourcesSortingRequestSerializer · object[]

List of sorting filters (JSON objects) fields: project. directions: asc, desc.

tags
TagsFilterSerializer · object

Filter by tags

Example:
{
  "condition_type": "OR",
  "conditions": [
    {
      "key": "os_version",
      "strict": true,
      "value": "22.04"
    },
    {
      "key": "os_version",
      "strict": true,
      "value": "23.04"
    }
  ]
}
types
enum<string>[]

List of resource types to be filtered in the report.

Resource types for prebilling report

Available options:
ai_cluster,
ai_virtual_cluster,
backup,
baremetal,
basic_vm,
containers,
dbaas_postgresql_connection_pooler,
dbaas_postgresql_cpu,
dbaas_postgresql_memory,
dbaas_postgresql_public_network,
dbaas_postgresql_volume,
egress_traffic,
external_ip,
file_share,
floatingip,
functions,
functions_calls,
functions_traffic,
image,
inference,
instance,
load_balancer,
log_index,
snapshot,
volume
Example:
["egress_traffic", "instance"]

Response

200 - application/json

OK

count
integer
required

Count of all the resources

Required range: x >= 0
Example:

1

price_status
enum<string>
required

Price status for the UI, type: string

Available options:
error,
hide,
show
results
(ResourceAiClusterWithCostSerializer · object | ResourceAiVirtualClusterWithCostSerializer · object | ResourceBaremetalWithCostSerializer · object | ResourceBasicVmWithCostSerializer · object | ResourceBackupWithCostSerializer · object | ResourceContainerWithCostSerializer · object | ResourceEgressTrafficWithCostSerializer · object | ResourceExternalIpWithCostSerializer · object | ResourceFileShareWithCostSerializer · object | ResourceFloatingIpWithCostSerializer · object | ResourceFunctionsWithCostSerializer · object | ResourceFunctionCallsWithCostSerializer · object | ResourceFunctionEgressTrafficWithCostSerializer · object | ResourceImagesWithCostSerializer · object | ResourceInferenceWithCostSerializer · object | ResourceInstanceWithCostSerializer · object | ResourceLoadBalancerWithCostSerializer · object | ResourceLogIndexWithCostSerializer · object | ResourceSnapshotWithCostSerializer · object | ResourceVolumeWithCostSerializer · object | ResourceDBAASPostgreSQLPoolerWithCostSerializer · object | ResourceDBAASPostgreSQLMemoryWithCostSerializer · object | ResourceDBAASPostgreSQLPublicNetworkWithCostSerializer · object | ResourceDBAASPostgreSQLCPUWithCostSerializer · object | ResourceDBAASPostgreSQLVolumeWithCostSerializer · object)[]
required