import os
from datetime import datetime
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
cost_report_detailed = client.cloud.cost_reports.get_detailed(
time_from=datetime.fromisoformat("2023-01-01T00:00:00"),
time_to=datetime.fromisoformat("2023-02-01T00:00:00"),
)
print(cost_report_detailed.count)package main
import (
"context"
"fmt"
"time"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
costReportDetailed, err := client.Cloud.CostReports.GetDetailed(context.TODO(), cloud.CostReportGetDetailedParams{
TimeFrom: time.Now(),
TimeTo: time.Now(),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", costReportDetailed.Count)
}
curl --request POST \
--url https://api.gcore.com/cloud/v2/cost_report/resources \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"time_from": "2023-01-01T00:00:00Z",
"time_to": "2023-02-01T00:00:00Z",
"enable_last_day": false,
"limit": 10,
"offset": 0,
"order_by": [
"cost.desc"
],
"project_ids": [
16,
17,
18,
19,
20
],
"region_ids": [
0,
76
],
"response_format": "csv_records",
"search": "amsterdam",
"tags": {
"condition_type": "OR",
"conditions": [
{
"key": "os_version",
"strict": true,
"value": "22.04"
},
{
"key": "os_version",
"strict": true,
"value": "23.04"
}
]
},
"types": [
"egress_traffic",
"instance"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
time_from: '2023-01-01T00:00:00Z',
time_to: '2023-02-01T00:00:00Z',
enable_last_day: false,
limit: 10,
offset: 0,
order_by: ['cost.desc'],
project_ids: [16, 17, 18, 19, 20],
region_ids: [0, 76],
response_format: 'csv_records',
search: 'amsterdam',
tags: {
condition_type: 'OR',
conditions: [
{key: 'os_version', strict: true, value: '22.04'},
{key: 'os_version', strict: true, value: '23.04'}
]
},
types: ['egress_traffic', 'instance']
})
};
fetch('https://api.gcore.com/cloud/v2/cost_report/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v2/cost_report/resources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'time_from' => '2023-01-01T00:00:00Z',
'time_to' => '2023-02-01T00:00:00Z',
'enable_last_day' => false,
'limit' => 10,
'offset' => 0,
'order_by' => [
'cost.desc'
],
'project_ids' => [
16,
17,
18,
19,
20
],
'region_ids' => [
0,
76
],
'response_format' => 'csv_records',
'search' => 'amsterdam',
'tags' => [
'condition_type' => 'OR',
'conditions' => [
[
'key' => 'os_version',
'strict' => true,
'value' => '22.04'
],
[
'key' => 'os_version',
'strict' => true,
'value' => '23.04'
]
]
],
'types' => [
'egress_traffic',
'instance'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v2/cost_report/resources")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"time_from\": \"2023-01-01T00:00:00Z\",\n \"time_to\": \"2023-02-01T00:00:00Z\",\n \"enable_last_day\": false,\n \"limit\": 10,\n \"offset\": 0,\n \"order_by\": [\n \"cost.desc\"\n ],\n \"project_ids\": [\n 16,\n 17,\n 18,\n 19,\n 20\n ],\n \"region_ids\": [\n 0,\n 76\n ],\n \"response_format\": \"csv_records\",\n \"search\": \"amsterdam\",\n \"tags\": {\n \"condition_type\": \"OR\",\n \"conditions\": [\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"22.04\"\n },\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"23.04\"\n }\n ]\n },\n \"types\": [\n \"egress_traffic\",\n \"instance\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v2/cost_report/resources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_from\": \"2023-01-01T00:00:00Z\",\n \"time_to\": \"2023-02-01T00:00:00Z\",\n \"enable_last_day\": false,\n \"limit\": 10,\n \"offset\": 0,\n \"order_by\": [\n \"cost.desc\"\n ],\n \"project_ids\": [\n 16,\n 17,\n 18,\n 19,\n 20\n ],\n \"region_ids\": [\n 0,\n 76\n ],\n \"response_format\": \"csv_records\",\n \"search\": \"amsterdam\",\n \"tags\": {\n \"condition_type\": \"OR\",\n \"conditions\": [\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"22.04\"\n },\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"23.04\"\n }\n ]\n },\n \"types\": [\n \"egress_traffic\",\n \"instance\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 45,
"price_status": "error",
"results": [
{
"error": null,
"project_id": 101,
"region_id": 76,
"resource": {
"flavor": "bm2-infrastructure-medium",
"name": "bm-amsterdam-1fe6",
"tags": [
{
"os_distro": "ubuntu"
},
{
"os_version": "22.04"
}
],
"type": "baremetal",
"uuid": "066e202a-fc9a-43f2-a74d-be34afbee5c9"
},
"usage": {
"cost": 163.190753,
"currency": "EUR",
"first_seen": "2026-07-17T00:00:30Z",
"last_seen": "2026-07-23T23:59:30Z",
"unit": "gb_hours",
"value": 6688
}
}
]
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}Get cost report resources sorted by cost (pay-as-you-go only)
Get a detailed cost report for a given period and specific resources, sorted by cost by default. Requested period should not exceed 31 days. Costs and usages are always returned at full precision.
Note: This report assumes there are no active commit features in the billing plan.
If there are active commit features (pre-paid resources) in your plan, use /v1/reservation_cost_report/totals,
as the results from this report will not be accurate.
Data from the past hour may not reflect the full set of statistics. For the most complete and accurate results, we recommend accessing the data at least one hour after the relevant time period. Updates are generally available within a 24-hour window, though timing can vary. Scheduled maintenance or other exceptions may occasionally cause delays beyond 24 hours.
import os
from datetime import datetime
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
cost_report_detailed = client.cloud.cost_reports.get_detailed(
time_from=datetime.fromisoformat("2023-01-01T00:00:00"),
time_to=datetime.fromisoformat("2023-02-01T00:00:00"),
)
print(cost_report_detailed.count)package main
import (
"context"
"fmt"
"time"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
costReportDetailed, err := client.Cloud.CostReports.GetDetailed(context.TODO(), cloud.CostReportGetDetailedParams{
TimeFrom: time.Now(),
TimeTo: time.Now(),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", costReportDetailed.Count)
}
curl --request POST \
--url https://api.gcore.com/cloud/v2/cost_report/resources \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"time_from": "2023-01-01T00:00:00Z",
"time_to": "2023-02-01T00:00:00Z",
"enable_last_day": false,
"limit": 10,
"offset": 0,
"order_by": [
"cost.desc"
],
"project_ids": [
16,
17,
18,
19,
20
],
"region_ids": [
0,
76
],
"response_format": "csv_records",
"search": "amsterdam",
"tags": {
"condition_type": "OR",
"conditions": [
{
"key": "os_version",
"strict": true,
"value": "22.04"
},
{
"key": "os_version",
"strict": true,
"value": "23.04"
}
]
},
"types": [
"egress_traffic",
"instance"
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
time_from: '2023-01-01T00:00:00Z',
time_to: '2023-02-01T00:00:00Z',
enable_last_day: false,
limit: 10,
offset: 0,
order_by: ['cost.desc'],
project_ids: [16, 17, 18, 19, 20],
region_ids: [0, 76],
response_format: 'csv_records',
search: 'amsterdam',
tags: {
condition_type: 'OR',
conditions: [
{key: 'os_version', strict: true, value: '22.04'},
{key: 'os_version', strict: true, value: '23.04'}
]
},
types: ['egress_traffic', 'instance']
})
};
fetch('https://api.gcore.com/cloud/v2/cost_report/resources', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v2/cost_report/resources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'time_from' => '2023-01-01T00:00:00Z',
'time_to' => '2023-02-01T00:00:00Z',
'enable_last_day' => false,
'limit' => 10,
'offset' => 0,
'order_by' => [
'cost.desc'
],
'project_ids' => [
16,
17,
18,
19,
20
],
'region_ids' => [
0,
76
],
'response_format' => 'csv_records',
'search' => 'amsterdam',
'tags' => [
'condition_type' => 'OR',
'conditions' => [
[
'key' => 'os_version',
'strict' => true,
'value' => '22.04'
],
[
'key' => 'os_version',
'strict' => true,
'value' => '23.04'
]
]
],
'types' => [
'egress_traffic',
'instance'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v2/cost_report/resources")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"time_from\": \"2023-01-01T00:00:00Z\",\n \"time_to\": \"2023-02-01T00:00:00Z\",\n \"enable_last_day\": false,\n \"limit\": 10,\n \"offset\": 0,\n \"order_by\": [\n \"cost.desc\"\n ],\n \"project_ids\": [\n 16,\n 17,\n 18,\n 19,\n 20\n ],\n \"region_ids\": [\n 0,\n 76\n ],\n \"response_format\": \"csv_records\",\n \"search\": \"amsterdam\",\n \"tags\": {\n \"condition_type\": \"OR\",\n \"conditions\": [\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"22.04\"\n },\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"23.04\"\n }\n ]\n },\n \"types\": [\n \"egress_traffic\",\n \"instance\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v2/cost_report/resources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"time_from\": \"2023-01-01T00:00:00Z\",\n \"time_to\": \"2023-02-01T00:00:00Z\",\n \"enable_last_day\": false,\n \"limit\": 10,\n \"offset\": 0,\n \"order_by\": [\n \"cost.desc\"\n ],\n \"project_ids\": [\n 16,\n 17,\n 18,\n 19,\n 20\n ],\n \"region_ids\": [\n 0,\n 76\n ],\n \"response_format\": \"csv_records\",\n \"search\": \"amsterdam\",\n \"tags\": {\n \"condition_type\": \"OR\",\n \"conditions\": [\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"22.04\"\n },\n {\n \"key\": \"os_version\",\n \"strict\": true,\n \"value\": \"23.04\"\n }\n ]\n },\n \"types\": [\n \"egress_traffic\",\n \"instance\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 45,
"price_status": "error",
"results": [
{
"error": null,
"project_id": 101,
"region_id": 76,
"resource": {
"flavor": "bm2-infrastructure-medium",
"name": "bm-amsterdam-1fe6",
"tags": [
{
"os_distro": "ubuntu"
},
{
"os_version": "22.04"
}
],
"type": "baremetal",
"uuid": "066e202a-fc9a-43f2-a74d-be34afbee5c9"
},
"usage": {
"cost": 163.190753,
"currency": "EUR",
"first_seen": "2026-07-17T00:00:30Z",
"last_seen": "2026-07-23T23:59:30Z",
"unit": "gb_hours",
"value": 6688
}
}
]
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}{
"detail": "<string>",
"exception_class": "<string>",
"hint": "<string>",
"message": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"trace_id": "<string>",
"type": "internal-server-error",
"context": {
"allowed_methods": [
"<string>"
],
"blocking_count": 123,
"blocking_resources": [
{
"resource_id": "<string>",
"resource_type": "<string>",
"resource_name": "<string>"
}
],
"client_id": 123,
"operation": "<string>",
"project_id": 123,
"quotas": [
{
"available": 123,
"limit": 123,
"name": "<string>",
"overflow": 123,
"region_id": 123,
"requested": 123,
"resulting_usage": 123,
"scope": "global",
"unit": "<string>",
"usage": 123
}
],
"reason": "account",
"region_id": 123,
"resource_id": "<string>",
"resource_status": "<string>",
"resource_type": "<string>",
"retry_after": 123
},
"errors": [
{
"code": "<string>",
"detail": "<string>",
"loc": [
"<string>"
],
"ctx": {}
}
],
"info": null,
"invalid_fields": null
}Authorizations
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
The start date of the report period (ISO 8601). The report starts from the beginning of this day in UTC.
"2023-01-01T00:00:00Z"
The end date of the report period (ISO 8601). The report ends just before the beginning of this day in UTC.
"2023-02-01T00:00:00Z"
Expenses for the last specified day are taken into account. As the default, False.
false
The response resources limit. Defaults to 10. Maximum 1000 for the json format, 10000 for the csv_records format.
x <= 100010
The response resources offset.
x >= 00
List of sorting criteria in 'field.direction' format.
v1's sort fields plus cost, renamed to say which field is actually sorted on.
There is no region sort: prebilling can only order by region name, and the response exposes
region_id, so no token here could honestly describe it.
Tokens are flat, not response paths: flavor -> resource.flavor, resource_name -> resource.name,
usage -> usage.value, cost -> usage.cost, first_seen/last_seen -> usage.first_seen/usage.last_seen.
cost.asc, cost.desc, first_seen.asc, first_seen.desc, flavor.asc, flavor.desc, last_seen.asc, last_seen.desc, project_id.asc, project_id.desc, resource_name.asc, resource_name.desc, usage.asc, usage.desc ["cost.desc"]
List of project IDs. Omit for all accessible projects; an empty list is rejected.
1[16, 17, 18, 19, 20]
List of region IDs. Omit for all regions and global usage; an empty list is rejected. Use 0 for global usage that has no region.
1[0, 76]
Format of the response: json (default) or csv_records.
csv_records, json "csv_records"
"json"
Partial, case-insensitive search over region names, project names, resource names, flavors and tags.
2 - 256"amsterdam"
"web-01"
Filter by tags
Show child attributes
Show child attributes
{
"condition_type": "OR",
"conditions": [
{
"key": "os_version",
"strict": true,
"value": "22.04"
},
{
"key": "os_version",
"strict": true,
"value": "23.04"
}
]
}
List of resource types. Omit for all types; an empty list is rejected.
1Resource types for prebilling report
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, inference_public_models, instance, load_balancer, log_index, snapshot, volume ["egress_traffic", "instance"]
Response
Cost report resources
Count of all the resources
x >= 045
'show' when the client may see prices, 'hide' for trial clients, clients with no product status, and clients of a reseller that does not expose prices.
error, hide, show Show child attributes
Show child attributes
Was this page helpful?