---
title: "Find cheaper machines"
method: POST
path: "/v1/recommendations/compute"
tags: ["recommendations"]
---

# Find cheaper machines

`POST /v1/recommendations/compute`

## Request

- Base URL: `https://pricing.baselinehq.cloud`
- URL: `https://pricing.baselinehq.cloud/v1/recommendations/compute`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `Authorization`
- TypeScript: <https://skmtc.dev/baselinehq/apis/costgraph-pricing-api/docs/v1/recommendations/compute/post.ts> (a function with typed inputs; its response is checked against the schema)

Return the cheapest machine per provider that still meets the requested shape, with the saving against the machine you asked about.

## Request body

- ComputeRecommendationRequest
  - `include_metadata` boolean
  - `instance` GithubComBaselinehqGolangSharedTypesInstance
    - `availability_zone` string
    - `fallback_to_base_pricing` boolean
    - `id` string
    - `instance_type` string
    - `operating_system` string
    - `provider` 'GCP' | 'AWS' | 'DigitalOcean' | 'Azure' | 'Hetzner' | 'OVHCloud' | 'PlanetScale' | 'STACKIT' | 'Linode' | 'Base' | 'Akash' | 'Alibaba' | 'Baseten' | 'Beam' | 'Cerebrium' | 'CIRunners' | 'Civo' | 'Clore' | 'CoreWeave' | 'Crusoe' | 'CUDO' | 'DataCrunch' | 'DeepInfra' | 'Denvr' | 'E2ENetworks' | 'Exoscale' | 'Fal' | 'HotAisle' | 'Hyperbolic' | 'Hyperstack' | 'IBM' | 'Lambda' | 'Latitude' | 'MassedCompute' | 'Modal' | 'Nebius' | 'Novita' | 'Oblivus' | 'OCI' | 'OpenTelekom' | 'PrimeIntellect' | 'Replicate' | 'RunPod' | 'Salad' | 'Scaleway' | 'Sesterce' | 'Shadeform' | 'ThunderCompute' | 'UpCloud' | 'Vast' | 'Vultr'
    - `region` string
    - `service` 'ComputeEngine' | 'AmazonEC2' | 'Droplet' | 'AzureCompute' | 'AzureManagedDisks' | 'HetznerCompute' | 'OVHPublicCloud' | 'BaseCompute' | 'BaseDisks' | 'AmazonEBS' | 'AmazonRDS' | 'AuroraDSQL' | 'CloudSQL' | 'AlloyDB' | 'CloudSpanner' | 'AzureDatabaseForPostgreSQL' | 'AzureDatabaseForMySQL' | 'AzureSQLDatabase' | 'AzureSQLManagedInstance' | 'PlanetScale' | 'ComputeEnginePersistentDisk' | 'STACKITCompute' | 'STACKITBlockStorage' | 'STACKITDatabase' | 'AkamaiLinode' | 'AkamaiBlockStorage' | 'AkamaiDatabase' | 'AkashCompute' | 'AlibabaCompute' | 'AlibabaBlockStorage' | 'BasetenCompute' | 'BeamCompute' | 'CerebriumCompute' | 'CivoCompute' | 'CivoBlockStorage' | 'CloreCompute' | 'CoreWeaveCompute' | 'CrusoeCompute' | 'CUDOCompute' | 'DataCrunchCompute' | 'DeepInfraCompute' | 'DenvrCompute' | 'E2ENetworksCompute' | 'ExoscaleCompute' | 'ExoscaleBlockStorage' | 'FalCompute' | 'HotAisleCompute' | 'HyperbolicCompute' | 'HyperstackCompute' | 'IBMCompute' | 'IBMBlockStorage' | 'LambdaCompute' | 'LatitudeCompute' | 'MassedComputeCompute' | 'ModalCompute' | 'NebiusCompute' | 'NovitaCompute' | 'OblivusCompute' | 'OCICompute' | 'OCIBlockStorage' | 'OpenTelekomCompute' | 'PrimeIntellectCompute' | 'ReplicateCompute' | 'RunPodCompute' | 'SaladCompute' | 'ScalewayCompute' | 'ScalewayBlockStorage' | 'SesterceCompute' | 'ShadeformCompute' | 'ThunderComputeCompute' | 'UpCloudCompute' | 'UpCloudBlockStorage' | 'VastCompute' | 'VultrCompute' | 'VultrBlockStorage'
    - `usage_type` 'SPOT_PREEMPTIBLE' | 'ONDEMAND' | 'RESERVED' | 'ONDEMAND_CUSTOM' | 'SPOT_PREEMPTIBLE_CUSTOM' | 'RESERVED_CUSTOM' | 'SOLE_TENANCY' | 'CUSTOM' | 'EXTENDED'
    - `vm` GithubComBaselinehqGolangSharedTypesVM
      - `cpu_cores` number
      - `ram_gb` number
  - `predicates` TypesPredicates
    - `availability_zones` string[]
    - `disk_types` string[]
    - `instance_types` string[]
    - `operating_systems` string[]
    - `providers` string[]
    - `regions` string[]
    - `services` string[]
    - `usage_types` string[]
  - `usage` GithubComBaselinehqGolangSharedTypesVM
    - `cpu_cores` number
    - `ram_gb` number
  - `workload_class` string: WorkloadClass selects which accelerator gates a compute recommendation applies: inference_single, inference_multi or training_distributed. Empty means inference_multi, which is what the recommender did before the classes existed. Disk requests do not carry one.

## Response `200`

The cheapest candidate per provider

- ComputeRecommendation[]
  - `cost_per_work_unit` number
  - `cpu_class` string
  - `pricing` ComputePrice
    - `architecture` string
    - `availability_zone` string
    - `cost_per_hour` number: On-demand-equivalent hourly USD; multiply by provider_pricing_rules.month_hours for monthly.
    - `cpu_cores` number
    - `cpu_cores_cost_per_hour` number
    - `created_at` string
    - `currency` string: Currency the provider published this price in. Cost columns are always normalized USD.
    - `gpu_cost_per_hour` number
    - `gpu_count` number
    - `gpu_type` string
    - `id` string
    - `instance_type` string
    - `native_cost_per_hour` number: cost_per_hour as published, before FX normalization. Zero when currency is USD.
    - `operating_system` string
    - `period_billing_hours` number: Commitment term the raw price covers: 1=hourly on-demand; 8640/25920/43200=1mo/3mo/1yr buckets. cost_per_hour is already normalized to hourly.
    - `provider` string
    - `ram_gb` number
    - `ram_gb_cost_per_hour` number
    - `raw_pricing_data` object
    - `region` string
    - `resizable` boolean: True when the row carries per-vCPU and per-GB rates for a shape sized at launch; resolution stores and returns a row priced at the requested vCPU and memory. NULL or false is a fixed-size shape.
    - `service` string
    - `tags` object
    - `updated_at` string
    - `usage_type` string: Pricing tier token (ONDEMAND, RESERVED, SPOT_*, *_HBP, *_BYOL, Commit1Yr/3Yr). Filter to ONDEMAND for normal pricing.
  - `savings` TypesSavings
    - `amount_per_hour` number
    - `amount_per_month` number
    - `amount_per_year` number
    - `percentage` number
  - `work_unit` string

## Other responses

- `400`: Invalid request body
- `401`: Unauthenticated
- `404`: No candidate matches the machine
- `422`: Validation failed
- `500`: Internal server error

## Changes

- **2026-10-05** `506d14bb78ca`: 1 info
  - added the new `CIRunners` enum value to the request property `instance/provider`
- **2026-10-05** `a60168add03d`: 5 info
  - added the optional property `affected` to the response with the `400` status
  - added the optional property `affected` to the response with the `401` status
  - added the optional property `affected` to the response with the `404` status
  - added the optional property `affected` to the response with the `422` status
  - …1 more
- **2026-10-05** `baaed9359752`: 1 breaking, 1 info
  - removed the enum value `Akamai` of the request property `instance/provider`
  - added the new `Linode` enum value to the request property `instance/provider`
- **2026-10-04** `73c38af41209`: 17 info
  - added the new `Alibaba` enum value to the request property `instance/provider`
  - added the new `AlibabaBlockStorage` enum value to the request property `instance/service`
  - added the new `AlibabaCompute` enum value to the request property `instance/service`
  - added the new `Civo` enum value to the request property `instance/provider`
  - …13 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/baselinehq/apis/costgraph-pricing-api/changes/v1/recommendations/compute/post.md)

---

[API](https://skmtc.dev/baselinehq/apis/costgraph-pricing-api.md) - [All operations](https://skmtc.dev/baselinehq/apis/costgraph-pricing-api/llms.txt) - [OpenAPI document](https://skmtc.dev/baselinehq/apis/costgraph-pricing-api/revisions/506d14bb78ca?raw)
