---
title: "Update a resource using a right-sizing hint"
method: POST
path: "/simulations/{simulationId}/apply-right-sizing"
tags: ["Simulations"]
---

# Update a resource using a right-sizing hint

`POST /simulations/{simulationId}/apply-right-sizing`

## Request

- Base URL: `https://www.cloudworldmodel.ai/api`
- URL: `https://www.cloudworldmodel.ai/api/simulations/{simulationId}/apply-right-sizing`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-PAYMENT`
  - API key in header `PAYMENT-SIGNATURE`

Applies a right-sizing recommendation from
`GET /simulations/{simulationId}/right-sizing-hint` to the targeted
resource in one call. Pass the `affectedResourceId` and
`recommendedSlug` from the hint response; the server validates the
slug against the resource's available sizes before mutating anything.

**Validation:** Returns `400 UNKNOWN_SIZE` with a list of valid slugs
if `recommendedSlug` is not recognized for the resource's provider and
type — so callers can pass the hint slug directly without a separate
size lookup.

**Supported resource types:** compute, database, storage (any
provider). GPU node-count hints (`gpu-underutilized`, `gpu-saturated`)
and managed-API breakeven hints (`gpu-api-breakeven`) produce
non-slug `recommendedSlug` values and cannot be applied via this
endpoint. SQL Server Express databases are also excluded: their
instance class and CPU-credit billing configuration must remain
consistent. This route returns `400 UNSUPPORTED_RESIZE` without
changing the simulation for those resources.

**Cross-provider alternatives:** DigitalOcean slugs returned as
cross-provider alternatives in right-sizing hints are accepted for
non-DO resources; the resource's cost characteristics are updated to
the DO tier without changing the provider field.

Requires `write` scope and ownership.

## Path parameters

- `simulationId` string, required

## Request body

- object
  - `resourceId` string, required: ID of the resource to resize — use `affectedResourceId` from a right-sizing-hint response
  - `recommendedSlug` string, required: Size slug to apply — use `recommendedSlug` from a right-sizing-hint response (e.g. `t3.small`, `n1-standard-1`, `s-1vcpu-2gb`)

## Response `200`

Size applied successfully

- object
  - `resourceId` string: ID of the resized resource
  - `resourceName` string: Display name of the resized resource
  - `appliedSlug` string: The size slug that was applied
  - `costMultiplier` number: Cost multiplier for the new size tier
  - `isDoAlternative` boolean: True when the applied slug is a DigitalOcean cross-provider alternative

## Other responses

- `400`: Unknown size slug or resource not found
- `401`: No credentials provided to an API-key-protected endpoint. The response body includes a machine-readable `apiKeyAuth` block pointing to the key creation endpoint so agents can self-serve an API key without consulting the spec.
- `403`: Access denied
- `404`: Resource not found

---

[API](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api.md) · [All operations](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cloudworldmodel/apis/cloud-world-model-agent-api/revisions/ecc3ad1ff07f?raw)
