Integrations
Update an AI gateway connection
Amends the pricing and collection settings of an AI gateway connection. Every field is optional: an omitted field is left alone, and an empty one clears it. A gateway that runs the model itself is amortized from the containers of the very pods it is scraped from, so scrape_namespace and scrape_label_selector are what an unpriced model falls back to. tenant_map turns raw sub-account values into display names. Setting cluster_id moves the connection to telemetry so the operator scrapes it, and setting instance_id moves it to telemetry the host agent scrapes; clearing both moves the connection back to push.
PATCH
/
integrations
/
connections
/
{id}
/
ai-gateway
Update an AI gateway connection
curl --request PATCH \
--url https://api.costgraph.ai/integrations/connections/{id}/ai-gateway \
--header 'Content-Type: application/json' \
--data '
{
"cluster_id": "<string>",
"instance_id": "<string>",
"scrape_label_selector": "<string>",
"scrape_namespace": "<string>",
"scrape_port": 123,
"tenant_map": {}
}
'import requests
url = "https://api.costgraph.ai/integrations/connections/{id}/ai-gateway"
payload = {
"cluster_id": "<string>",
"instance_id": "<string>",
"scrape_label_selector": "<string>",
"scrape_namespace": "<string>",
"scrape_port": 123,
"tenant_map": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cluster_id: '<string>',
instance_id: '<string>',
scrape_label_selector: '<string>',
scrape_namespace: '<string>',
scrape_port: 123,
tenant_map: {}
})
};
fetch('https://api.costgraph.ai/integrations/connections/{id}/ai-gateway', 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/integrations/connections/{id}/ai-gateway",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cluster_id' => '<string>',
'instance_id' => '<string>',
'scrape_label_selector' => '<string>',
'scrape_namespace' => '<string>',
'scrape_port' => 123,
'tenant_map' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/integrations/connections/{id}/ai-gateway"
payload := strings.NewReader("{\n \"cluster_id\": \"<string>\",\n \"instance_id\": \"<string>\",\n \"scrape_label_selector\": \"<string>\",\n \"scrape_namespace\": \"<string>\",\n \"scrape_port\": 123,\n \"tenant_map\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.costgraph.ai/integrations/connections/{id}/ai-gateway")
.header("Content-Type", "application/json")
.body("{\n \"cluster_id\": \"<string>\",\n \"instance_id\": \"<string>\",\n \"scrape_label_selector\": \"<string>\",\n \"scrape_namespace\": \"<string>\",\n \"scrape_port\": 123,\n \"tenant_map\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/integrations/connections/{id}/ai-gateway")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cluster_id\": \"<string>\",\n \"instance_id\": \"<string>\",\n \"scrape_label_selector\": \"<string>\",\n \"scrape_namespace\": \"<string>\",\n \"scrape_port\": 123,\n \"tenant_map\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": "<unknown>"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}Path Parameters
Connection id
Body
application/json
Gateway settings
Was this page helpful?
⌘I
Update an AI gateway connection
curl --request PATCH \
--url https://api.costgraph.ai/integrations/connections/{id}/ai-gateway \
--header 'Content-Type: application/json' \
--data '
{
"cluster_id": "<string>",
"instance_id": "<string>",
"scrape_label_selector": "<string>",
"scrape_namespace": "<string>",
"scrape_port": 123,
"tenant_map": {}
}
'import requests
url = "https://api.costgraph.ai/integrations/connections/{id}/ai-gateway"
payload = {
"cluster_id": "<string>",
"instance_id": "<string>",
"scrape_label_selector": "<string>",
"scrape_namespace": "<string>",
"scrape_port": 123,
"tenant_map": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cluster_id: '<string>',
instance_id: '<string>',
scrape_label_selector: '<string>',
scrape_namespace: '<string>',
scrape_port: 123,
tenant_map: {}
})
};
fetch('https://api.costgraph.ai/integrations/connections/{id}/ai-gateway', 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/integrations/connections/{id}/ai-gateway",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cluster_id' => '<string>',
'instance_id' => '<string>',
'scrape_label_selector' => '<string>',
'scrape_namespace' => '<string>',
'scrape_port' => 123,
'tenant_map' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.costgraph.ai/integrations/connections/{id}/ai-gateway"
payload := strings.NewReader("{\n \"cluster_id\": \"<string>\",\n \"instance_id\": \"<string>\",\n \"scrape_label_selector\": \"<string>\",\n \"scrape_namespace\": \"<string>\",\n \"scrape_port\": 123,\n \"tenant_map\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.costgraph.ai/integrations/connections/{id}/ai-gateway")
.header("Content-Type", "application/json")
.body("{\n \"cluster_id\": \"<string>\",\n \"instance_id\": \"<string>\",\n \"scrape_label_selector\": \"<string>\",\n \"scrape_namespace\": \"<string>\",\n \"scrape_port\": 123,\n \"tenant_map\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.costgraph.ai/integrations/connections/{id}/ai-gateway")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cluster_id\": \"<string>\",\n \"instance_id\": \"<string>\",\n \"scrape_label_selector\": \"<string>\",\n \"scrape_namespace\": \"<string>\",\n \"scrape_port\": 123,\n \"tenant_map\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "some message",
"status": "success",
"data": "<unknown>"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}{
"message": "some message",
"status": "error"
}