Get Infrastructure Inventory
curl --request GET \
--url https://api.wistx.ai/v1/infrastructure/inventoryimport requests
url = "https://api.wistx.ai/v1/infrastructure/inventory"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/infrastructure/inventory', 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.wistx.ai/v1/infrastructure/inventory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.wistx.ai/v1/infrastructure/inventory"
req, _ := http.NewRequest("GET", url, nil)
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.wistx.ai/v1/infrastructure/inventory")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/infrastructure/inventory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"repository_url": "https://github.com/myorg/infrastructure",
"environment_name": "prod",
"status": "indexed",
"resource_id": "res_xyz789",
"resources": [
{
"resource_type": "aws_rds_instance",
"name": "main-db",
"monthly_cost": 150.0,
"service": "rds"
}
],
"resources_count": 15,
"total_monthly_cost": 2500.0,
"total_annual_cost": 30000.0,
"cost_breakdown": {
"by_service": {
"rds": 150.0,
"ec2": 2000.0,
"s3": 350.0
}
},
"cost_optimizations": [
{
"type": "reserved_instances",
"potential_savings": 500.0
}
],
"compliance_summary": {
"PCI-DSS": {
"compliant_count": 40,
"non_compliant_count": 5,
"compliance_rate": 88.9
}
},
"compliance_status": "partial",
"recommendations": [
"Consider cost optimization - current spending: $2500.00/month",
"Review partial compliance issues"
],
"context_for_agents": "Existing Infrastructure Context:\n\n- Total Resources: 15\n- Monthly Cost: $2500.00\n\nCompliance Status:\n- PCI-DSS: 88.9% compliant (40/45)\n\nRecommendations:\n- Consider cost optimization - current spending: $2500.00/month\n- Review partial compliance issues"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123,
"query_time_ms": 320
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "repository_url or inventory_id is required"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired token"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Query quota exceeded",
"details": {
"limit_type": "queries_per_month",
"current": 1000,
"limit": 1000
}
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "DATABASE_ERROR",
"message": "Database connection failed"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
Infrastructure
Get Infrastructure Inventory
Get existing infrastructure context for coding agents
GET
/
v1
/
infrastructure
/
inventory
Get Infrastructure Inventory
curl --request GET \
--url https://api.wistx.ai/v1/infrastructure/inventoryimport requests
url = "https://api.wistx.ai/v1/infrastructure/inventory"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wistx.ai/v1/infrastructure/inventory', 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.wistx.ai/v1/infrastructure/inventory",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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.wistx.ai/v1/infrastructure/inventory"
req, _ := http.NewRequest("GET", url, nil)
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.wistx.ai/v1/infrastructure/inventory")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wistx.ai/v1/infrastructure/inventory")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"repository_url": "https://github.com/myorg/infrastructure",
"environment_name": "prod",
"status": "indexed",
"resource_id": "res_xyz789",
"resources": [
{
"resource_type": "aws_rds_instance",
"name": "main-db",
"monthly_cost": 150.0,
"service": "rds"
}
],
"resources_count": 15,
"total_monthly_cost": 2500.0,
"total_annual_cost": 30000.0,
"cost_breakdown": {
"by_service": {
"rds": 150.0,
"ec2": 2000.0,
"s3": 350.0
}
},
"cost_optimizations": [
{
"type": "reserved_instances",
"potential_savings": 500.0
}
],
"compliance_summary": {
"PCI-DSS": {
"compliant_count": 40,
"non_compliant_count": 5,
"compliance_rate": 88.9
}
},
"compliance_status": "partial",
"recommendations": [
"Consider cost optimization - current spending: $2500.00/month",
"Review partial compliance issues"
],
"context_for_agents": "Existing Infrastructure Context:\n\n- Total Resources: 15\n- Monthly Cost: $2500.00\n\nCompliance Status:\n- PCI-DSS: 88.9% compliant (40/45)\n\nRecommendations:\n- Consider cost optimization - current spending: $2500.00/month\n- Review partial compliance issues"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123,
"query_time_ms": 320
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "repository_url or inventory_id is required"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired token"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Query quota exceeded",
"details": {
"limit_type": "queries_per_month",
"current": 1000,
"limit": 1000
}
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "DATABASE_ERROR",
"message": "Database connection failed"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
Get existing infrastructure context for coding agents, including resources, costs, and compliance status.
string
GitHub repository URL
string
Environment name (dev, stage, prod, etc.)
string
Inventory ID
boolean
default:"true"
Include compliance status
boolean
default:"true"
Include cost information
Request Example
curl -X GET "https://api.wistx.ai/v1/infrastructure/inventory?repository_url=https://github.com/myorg/infrastructure&include_compliance=true&include_costs=true" \
-H "Authorization: Bearer YOUR_API_KEY"
import requests
url = "https://api.wistx.ai/v1/infrastructure/inventory"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
params = {
"repository_url": "https://github.com/myorg/infrastructure",
"include_compliance": True,
"include_costs": True
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
const url = new URL("https://api.wistx.ai/v1/infrastructure/inventory");
url.searchParams.append("repository_url", "https://github.com/myorg/infrastructure");
url.searchParams.append("include_compliance", "true");
url.searchParams.append("include_costs", "true");
const response = await fetch(url, {
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
const data = await response.json();
console.log(data);
package main
import (
"net/http"
"net/url"
)
func main() {
baseURL := "https://api.wistx.ai/v1/infrastructure/inventory"
u, _ := url.Parse(baseURL)
q := u.Query()
q.Set("repository_url", "https://github.com/myorg/infrastructure")
q.Set("include_compliance", "true")
q.Set("include_costs", "true")
u.RawQuery = q.Encode()
req, _ := http.NewRequest("GET", u.String(), nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}
require 'net/http'
require 'uri'
uri = URI('https://api.wistx.ai/v1/infrastructure/inventory')
params = {
repository_url: "https://github.com/myorg/infrastructure",
include_compliance: true,
include_costs: true
}
uri.query = URI.encode_www_form(params)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'Bearer YOUR_API_KEY'
response = http.request(request)
puts response.body
<?php
$url = "https://api.wistx.ai/v1/infrastructure/inventory";
$params = [
"repository_url" => "https://github.com/myorg/infrastructure",
"include_compliance" => true,
"include_costs" => true
];
$ch = curl_init($url . "?" . http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_API_KEY"
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
HttpClient client = HttpClient.newHttpClient();
String url = "https://api.wistx.ai/v1/infrastructure/inventory?repository_url=https://github.com/myorg/infrastructure&include_compliance=true&include_costs=true";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer YOUR_API_KEY")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response Example
{
"data": {
"repository_url": "https://github.com/myorg/infrastructure",
"environment_name": "prod",
"status": "indexed",
"resource_id": "res_xyz789",
"resources": [
{
"resource_type": "aws_rds_instance",
"name": "main-db",
"monthly_cost": 150.0,
"service": "rds"
}
],
"resources_count": 15,
"total_monthly_cost": 2500.0,
"total_annual_cost": 30000.0,
"cost_breakdown": {
"by_service": {
"rds": 150.0,
"ec2": 2000.0,
"s3": 350.0
}
},
"cost_optimizations": [
{
"type": "reserved_instances",
"potential_savings": 500.0
}
],
"compliance_summary": {
"PCI-DSS": {
"compliant_count": 40,
"non_compliant_count": 5,
"compliance_rate": 88.9
}
},
"compliance_status": "partial",
"recommendations": [
"Consider cost optimization - current spending: $2500.00/month",
"Review partial compliance issues"
],
"context_for_agents": "Existing Infrastructure Context:\n\n- Total Resources: 15\n- Monthly Cost: $2500.00\n\nCompliance Status:\n- PCI-DSS: 88.9% compliant (40/45)\n\nRecommendations:\n- Consider cost optimization - current spending: $2500.00/month\n- Review partial compliance issues"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123,
"query_time_ms": 320
}
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"details": "repository_url or inventory_id is required"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired token"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "QUOTA_EXCEEDED",
"message": "Query quota exceeded",
"details": {
"limit_type": "queries_per_month",
"current": 1000,
"limit": 1000
}
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
{
"error": {
"code": "DATABASE_ERROR",
"message": "Database connection failed"
},
"metadata": {
"request_id": "req_123",
"timestamp": 1234567890.123
}
}
Rate Limits
- Professional: 2,000 queries/month
- Team: 10,000 queries/month
- Enterprise: Unlimited queries/month