POST
/
recommendations
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
      }
    }
  ]
}
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

availability_zone
string
required
The availability zone where the resource will be deployed.Example: us-east-1a
instance_type
string
required
The type of instance to get recommendations for.Example: t2.micro
operating_system
string
required
The operating system of the instance.Example: linux
predicates
object
required
Filter criteria for recommendations. Used to limit the scope of recommendations to specific providers, regions, instance types, etc.
provider
string
required
The cloud provider of the current instance.Example: aws
region
string
required
The region where the current instance is deployed.Example: us-east-1
include_metadata
boolean
Whether to include raw pricing metadata with the response.Default: false
service
string
required
The cloud service name of the current instance.Example: AmazonEC2
usage
object
required
Current usage specifications of the instance.
usage_type
string
required
The type of usage for the current instance.Example: ondemand
vm
object
required
Virtual machine specifications of the current instance.

Response

The response contains recommendations grouped by instance type. Each recommendation includes:
instance_pricing
object
Pricing information for the recommended instance.
vm
object
Virtual machine specifications for the recommendation.
savings
object
Cost savings information.