CI
AutoPilot for CI savings over time
What AutoPilot for CI saved and added per UTC day or month, clipped to the period, plus the period total, in the same shape as the Kubernetes AutoPilot savings series. Figures are measured the same way as the savings totals; net_usd subtracts what the routing jobs cost. Defaults to the last 30 days by day; a period over 400 days is rejected.
GET
/
api
/
v1
/
tenant
/
ci
/
autopilot
/
savings
/
series
AutoPilot for CI savings over time
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series', 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.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"from": "<string>",
"granularity": "day",
"periods": [
{
"added": {
"usd": 123,
"wall_seconds": 123
},
"end": "<string>",
"estimated_jobs": 123,
"net_usd": 123,
"no_baseline_jobs": 123,
"routed_jobs": 123,
"routing_cost_usd": 123,
"saved": {
"usd": 123,
"wall_seconds": 123
},
"start": "<string>"
}
],
"to": "<string>",
"total": {
"added": {
"usd": 123,
"wall_seconds": 123
},
"end": "<string>",
"estimated_jobs": 123,
"net_usd": 123,
"no_baseline_jobs": 123,
"routed_jobs": 123,
"routing_cost_usd": 123,
"saved": {
"usd": 123,
"wall_seconds": 123
},
"start": "<string>"
}
}
}{
"message": "some message",
"status": "error"
}Authorizations
Enter "Bearer {token}"
Headers
Tenant ID
Query Parameters
First day, YYYY-MM-DD
Day after the last day, YYYY-MM-DD
Entry size: day (default) or month
owner/name
Workflow file
Runner provider the jobs were routed to
Was this page helpful?
⌘I
AutoPilot for CI savings over time
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series"
headers = {
"X-CostGraph-Tenant-ID": "<x-costgraph-tenant-id>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-CostGraph-Tenant-ID': '<x-costgraph-tenant-id>', Authorization: '<api-key>'}
};
fetch('https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series', 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.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series")
.header("X-CostGraph-Tenant-ID", "<x-costgraph-tenant-id>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/api/v1/tenant/ci/autopilot/savings/series")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-CostGraph-Tenant-ID"] = '<x-costgraph-tenant-id>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": {
"from": "<string>",
"granularity": "day",
"periods": [
{
"added": {
"usd": 123,
"wall_seconds": 123
},
"end": "<string>",
"estimated_jobs": 123,
"net_usd": 123,
"no_baseline_jobs": 123,
"routed_jobs": 123,
"routing_cost_usd": 123,
"saved": {
"usd": 123,
"wall_seconds": 123
},
"start": "<string>"
}
],
"to": "<string>",
"total": {
"added": {
"usd": 123,
"wall_seconds": 123
},
"end": "<string>",
"estimated_jobs": 123,
"net_usd": 123,
"no_baseline_jobs": 123,
"routed_jobs": 123,
"routing_cost_usd": 123,
"saved": {
"usd": 123,
"wall_seconds": 123
},
"start": "<string>"
}
}
}{
"message": "some message",
"status": "error"
}