Skip to content

Resolve a free size

Answers which server a free choice of vCPU and memory gets in one location of Aitronos servers: the cheapest server that can be ordered there with at least that many vCPUs and at least that much memory, with its price and the strings to show. A provider sells fixed server types only, so 16 vCPU with 192 GB is a 48 vCPU · 192 GB server, and the note says so.

Get offering options already answers every pair of its cpu_choices and memory_choices in resolutions; use this for any other pair (16 vCPU and 200 GB as readily as 16 and 64). When no server in the location has both, machine_type_id is null, note names the largest server there, and alternatives lists the other locations where the choice fits. The answer is never a refusal for that.

To create the server, send the answer's machine_type_id (or the same vcpu and memory_gb) to Create a server, with machine_type.prices[0].hourly, currency and catalog_version as the quote.

It acts for a person: it requires a bearer token whose user holds the use_forge capability in the acting organization, and Forge cloud compute switched on for the organization. Free sizing is offered for Aitronos servers only.

POSThttps://api.aitronos.com/v1/forge/compute/offerings/{offering_id}/options/resolve

Path Parameters

offering_id string required

aitronos. A bring-your-own offering is refused: order one of its sizes instead.

Query Parameters

organization_id string optional

The organization to act in. Defaults to your current organization. You must be an active member of it, or the request is refused with 403 ORGANIZATION_ACCESS_DENIED.

Headers

X-Organization-Id string optional

The same as organization_id, as a header. When both are sent, the query parameter wins.

Body Parameters

location_id string required

A location id from the options, e.g. eu-central.

vcpu integer required

The vCPUs wanted, 1 to 4096.

memory_gb integer required

The memory wanted in GB, 1 to 65536.

Unknown fields are refused.


Returns

catalog_version string — send it back inside the quote of the create.

currency string — CHF.

location_id, vcpu, memory_gb — the choice, as asked.

machine_type_id string or null — the server to create, as a machine_types id of the options (a size's id, e.g. std-16, when a size has exactly that vCPU and memory); null when no server in the location has both.

note string or null — a sentence to show: why a larger server was chosen ("No server in Germany has exactly 16 vCPU and 192 GB, so this is the cheapest one with at least that much."), or the largest server there when none fits ("The largest server in Germany has 48 vCPU and 192 GB."); null for an exact match.

machine_type object or null — the chosen server in the shape of an options sizes entry, priced in this location only: prices[0] carries hourly, monthly_cap, summary, option_label, button_label and can_create.

alternatives array — only when nothing fits here: the other locations where the choice fits, each {location_id, size_id, hourly, currency}; empty otherwise.

Errors

StatusCodeWhen
401AUTHENTICATION_REQUIREDNo credential, or a credential with no user (an organization API key).
403ORGANIZATION_ACCESS_DENIEDorganization_id or X-Organization-Id names an organization you are not an active member of.
403INSUFFICIENT_PERMISSIONSThe user does not hold use_forge in the acting organization.
403FORGE_COMPUTE_DISABLEDForge cloud compute is not switched on for the organization.
403FORGE_COMPUTE_OFFERING_BLOCKEDAitronos servers cannot be used in this environment.
403FORGE_COMPUTE_OFFERING_NOT_OFFEREDThe offering is not offered to you right now. details.offering_id is its id.
404FORGE_COMPUTE_OFFERING_NOT_FOUNDNo offering has this id.
422INVALID_FIELD_VALUElocation_id is not a location of Aitronos servers (details.field location_id).
422VALIDATION_ERRORA body of the wrong shape, an unknown field, a value out of range, or a bring-your-own offering (details.reason free_sizing_unsupported).
502FORGE_COMPUTE_PROVIDER_UNREACHABLEThe servers' prices could not be read. Try again in a moment.
cURL
curl -X POST "https://api.aitronos.com/v1/forge/compute/offerings/aitronos/options/resolve" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"location_id": "eu-central", "vcpu": 16, "memory_gb": 192}'

Response:

{
  "catalog_version": "fc-3b8e1f0a9c42",
  "currency": "CHF",
  "location_id": "eu-central",
  "vcpu": 16,
  "memory_gb": 192,
  "machine_type_id": "ded-x86-48c-192g",
  "note": "No server in Germany has exactly 16 vCPU and 192 GB, so this is the cheapest one with at least that much.",
  "machine_type": {
    "id": "ded-x86-48c-192g",
    "label": "48 vCPU · 192 GB",
    "vcpu": 48,
    "memory_gb": 192,
    "disk_gb": 960,
    "arch": "x86_64",
    "dedicated_cpu": true,
    "order": 0,
    "prices": [
      {
        "location_id": "eu-central",
        "hourly": "2.58",
        "monthly_cap": "1607.04",
        "includes_vat": false,
        "available": true,
        "price_verified": true,
        "summary": "48 vCPU · 192 GB · Germany",
        "option_label": "48 vCPU · 192 GB · CHF 2.58/h",
        "button_label": "Create · 48 vCPU · 192 GB · Germany · CHF 2.58/h, at most CHF 1,607.04/month",
        "can_create": true
      }
    ]
  },
  "alternatives": []
}