CI
List cheaper CI runners for a repository
Lists up to three cheaper runners for a GitHub repository’s CI jobs, the best one per runner shape in use, ordered by monthly savings. Each is no slower at the 75th percentile of job time than the current runner, going by the repository’s own runs there or, when caveats include speed_estimated, by public CPU and queue-time benchmarks applied to the jobs’ measured time; wall_time_change_percent is that change. routable is false for a suggestion CostGraph cannot route jobs to yet; its saving is not counted in any total. Alternatives not refreshed in the last two days are left out.
GET
/
api
/
v1
/
tenant
/
ci
/
runner-alternatives
List cheaper CI runners for a repository
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/runner-alternatives \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/runner-alternatives"
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/runner-alternatives', 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/runner-alternatives",
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/runner-alternatives"
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/runner-alternatives")
.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/runner-alternatives")
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": {
"alternatives": [
{
"alternative": {
"monthly_cost": 123,
"sku": "<string>",
"vendor": "<string>",
"vendor_name": "<string>"
},
"candidate_class": "<string>",
"caveats": [
"<string>"
],
"current": {
"arch": "<string>",
"billed_minutes": 123,
"cores": 123,
"monthly_cost": 123,
"os": "<string>",
"vendor": "<string>",
"vendor_name": "<string>"
},
"routable": true,
"savings_monthly": 123,
"savings_percent": 123,
"uses_included_compute": true,
"wall_time_change_percent": 123
}
]
}
}{
"message": "some message",
"status": "error"
}{
"code": "subscription_required",
"message": "some message",
"status": "error"
}Query Parameters
Was this page helpful?
⌘I
List cheaper CI runners for a repository
curl --request GET \
--url https://api.costgraph.ai/api/v1/tenant/ci/runner-alternatives \
--header 'Authorization: <api-key>' \
--header 'X-CostGraph-Tenant-ID: <x-costgraph-tenant-id>'import requests
url = "https://api.costgraph.ai/api/v1/tenant/ci/runner-alternatives"
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/runner-alternatives', 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/runner-alternatives",
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/runner-alternatives"
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/runner-alternatives")
.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/runner-alternatives")
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": {
"alternatives": [
{
"alternative": {
"monthly_cost": 123,
"sku": "<string>",
"vendor": "<string>",
"vendor_name": "<string>"
},
"candidate_class": "<string>",
"caveats": [
"<string>"
],
"current": {
"arch": "<string>",
"billed_minutes": 123,
"cores": 123,
"monthly_cost": 123,
"os": "<string>",
"vendor": "<string>",
"vendor_name": "<string>"
},
"routable": true,
"savings_monthly": 123,
"savings_percent": 123,
"uses_included_compute": true,
"wall_time_change_percent": 123
}
]
}
}{
"message": "some message",
"status": "error"
}{
"code": "subscription_required",
"message": "some message",
"status": "error"
}