curl -X 'POST' \
'https://pricing.baselinehq.cloud/recommendations' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <your-api-key>' \
-H 'Content-Type: application/json' \
-d '{
"availability_zone": "us-east-1a",
"instance_type": "t2.micro",
"operating_system": "linux",
"predicates": {
"availability_zones": ["string"],
"instance_types": ["string"],
"providers": ["string"],
"regions": ["string"],
"usage_types": ["string"]
},
"provider": "aws",
"region": "us-east-1",
"service": "AmazonEC2",
"usage": {
"cpu_cores": 1,
"ram_gb": 10
},
"usage_type": "ondemand",
"vm": {
"cpu_cores": 1,
"ram_gb": 10
}
}'
{
"base": [
{
"instance_pricing": {
"cpu_cores_cost_per_hour": 0.031611,
"ram_gb_cost_per_hour": 0.004237,
"cost_per_hour": 0.073981,
"usage_type": "ONDEMAND",
"instance_type": "N2",
"region": "us-east1",
"provider": "GCP",
"service": "ComputeEngine",
"operating_system": "",
"availability_zone": ""
},
"vm": null,
"savings": {
"percentage": 0,
"amount_per_hour": 0,
"amount_per_month": 0,
"amount_per_year": 0
}
}
],
"c-2": [
{
"instance_pricing": {
"cpu_cores_cost_per_hour": 0.024671,
"ram_gb_cost_per_hour": 0.003289,
"cost_per_hour": 0.0625,
"usage_type": "ONDEMAND",
"instance_type": "c-2",
"region": "nyc1",
"provider": "DigitalOcean",
"service": "Droplet",
"operating_system": "",
"availability_zone": ""
},
"vm": {
"cpu_cores": 2,
"ram_gb": 4
},
"savings": {
"percentage": 15.518,
"amount_per_hour": 0.011481,
"amount_per_month": 8.381,
"amount_per_year": 100.573
}
}
]
}
Get cost-saving recommendations for cloud instances
Request Body
The availability zone where the resource will be deployed.Example: us-east-1a
The type of instance to get recommendations for.Example: t2.micro
The operating system of the instance.Example: linux
Filter criteria for recommendations. Used to limit the scope of recommendations to specific providers, regions, instance types, etc.Show Predicates Properties
List of availability zones to consider for recommendations. If empty, all availability zones will be considered.Example: ["us-east-1a", "us-east-1b"]
List of instance types to consider for recommendations. If empty, all instance types will be considered.Example: ["t2.micro", "t3.micro"]
List of cloud providers to consider for recommendations. If empty, all supported providers will be considered.Example: ["aws", "gcp"]
List of regions to consider for recommendations. If empty, all regions will be considered.Example: ["us-east-1", "us-west-1"]
List of usage types to consider for recommendations. If empty, all usage types will be considered.Example: ["ondemand", "reserved"]
The cloud provider of the current instance.Example: aws
The region where the current instance is deployed.Example: us-east-1
Whether to include raw pricing metadata with the response.Default: false
The cloud service name of the current instance.Example: AmazonEC2
Current usage specifications of the instance.
Number of CPU cores currently in use.Example: 1
Amount of RAM in gigabytes currently in use.Example: 10
The type of usage for the current instance.Example: ondemand
Virtual machine specifications of the current instance.
Number of CPU cores allocated to the instance.Example: 1
Amount of RAM in gigabytes allocated to the instance.Example: 10
Response
The response contains recommendations grouped by instance type. Each recommendation includes:
Pricing information for the recommended instance.Show Instance Pricing Properties
Cost per hour for CPU cores.Example: 0.031611
Cost per hour for RAM.Example: 0.004237
Total cost per hour.Example: 0.073981
Type of usage (e.g., ONDEMAND).
Type of instance.Example: N2
Region where the instance is located.Example: us-east1
Cloud provider.Example: GCP
Cloud service name.Example: ComputeEngine
Virtual machine specifications for the recommendation.
Number of CPU cores.Example: 2
Amount of RAM in gigabytes.Example: 4
Cost savings information.
Percentage of cost savings.Example: 15.518
Amount saved per hour.Example: 0.011481
Amount saved per month.Example: 8.381
Amount saved per year.Example: 100.573