> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Placements

> Simulates placing the specified number of machines into regions, depending on available capacity and limits.



## OpenAPI

````yaml /api/machines/openapi.json post /v1/platform/placements
openapi: 3.1.0
info:
  title: Machines API
  description: >-
    This site hosts documentation generated from the Fly.io Machines API OpenAPI
    specification. Visit our complete [Machines API
    docs](https://fly.io/docs/machines/api/) for how to get started, more
    information about each endpoint, parameter descriptions, and examples.
  contact: {}
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://api.machines.dev
security:
  - FlyBearerAuth: []
tags:
  - name: Apps
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/apps-resource/) for details about
      using the Apps resource.
  - name: Machines
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/machines-resource/) for details
      about using the Machines resource.
  - name: TLS Certificates
    description: >
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/certificates-resource/) for details
      about using the TLS Certificates resource.
  - name: Volumes
    description: >-
      This site hosts documentation generated from the Fly.io Machines API
      OpenAPI specification. Visit our complete [Machines API
      docs](https://fly.io/docs/machines/api/volumes-resource/) for details
      about using the Volumes resource.
  - name: Postgres Clusters
    description: >-
      Create and manage Postgres clusters, including databases, users,
      extensions, backups, and app attachments.
externalDocs:
  url: https://fly.io/docs/machines/working-with-machines/
paths:
  /v1/platform/placements:
    post:
      tags:
        - Platform
      summary: Get Placements
      description: >-
        Simulates placing the specified number of machines into regions,
        depending on available capacity and limits.
      operationId: Platform_placements_post
      requestBody:
        description: Get placements request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/main.getPlacementsRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/main.getPlacementsResponse'
components:
  schemas:
    main.getPlacementsRequest:
      required:
        - org_slug
      type: object
      properties:
        compute:
          type: object
          description: >-
            Resource requirements for the Machine to simulate. Defaults to a
            performance-1x machine
          allOf:
            - $ref: '#/components/schemas/fly.MachineGuest'
        count:
          type: integer
          description: |-
            Number of machines to simulate placement.
            Defaults to 0, which returns the org-specific limit for each region.
        org_slug:
          type: string
          description: >-
            Slug of the organization to place Machines for, or `personal`.
            Required.
          example: personal
        region:
          type: string
          description: >-
            Region expression for placement as a comma-delimited set of regions
            or aliases.

            Defaults to the API endpoint's local region. When `count` is greater
            than 0, `any` is

            added as a fallback.
          example: lhr,eu
        volume_name:
          type: string
          description: Currently unused.
          example: ''
        volume_size_bytes:
          type: integer
          description: >-
            Size of a volume each Machine will need, in bytes. Only hosts with
            room for it are

            considered.
        weights:
          type: object
          description: Optional weights to override default placement preferences.
          example:
            region: 1000
            spread: 0
          allOf:
            - $ref: '#/components/schemas/placement.Weights'
    main.getPlacementsResponse:
      type: object
      properties:
        Regions:
          type: array
          description: >-
            The regions Machines would be placed in. With `count` 0, every
            requested region with the

            organization's Machine limit in it.
          items:
            $ref: '#/components/schemas/placement.RegionPlacement'
    fly.MachineGuest:
      type: object
      properties:
        cpu_kind:
          type: string
          description: >-
            Kind of CPU: shared or performance. Performance CPUs must be enabled
            for the organization.

            Defaults to shared when `guest` is omitted
        cpus:
          type: integer
          description: >-
            Number of CPUs: 1, 2, 4, 6, 8, 10, 12, 14, 16, 32, 64 or 128, up to
            8 for shared and 16 for

            performance CPUs unless the organization's limit is higher. Defaults
            to 1 when `guest` is

            omitted
        gpu_kind:
          type: string
          description: No longer supported. Requests that set it are rejected
        gpus:
          type: integer
          description: No longer supported. Requests that set it are rejected
        host_dedication_id:
          type: string
          description: >-
            Place the Machine on hosts dedicated to the organization under this
            ID. Only available to

            organizations with dedicated hosts
        kernel_args:
          type: array
          description: Extra arguments appended to the guest kernel command line
          items:
            type: string
        max_memory_mb:
          type: integer
          description: >-
            Memory in MiB that the Machine's memory limit can later be raised to
            without a restart, using

            the memory endpoints. Must be at least memory_mb and at most the
            per-CPU maximum. The Machine

            starts with a limit of memory_mb
        memory_mb:
          type: integer
          description: >-
            Memory in MiB. Must be a multiple of 256 for shared and 1024 for
            performance CPUs, and

            between 256 and 2048 (shared) or 2048 and 8192 (performance) per
            CPU. Defaults to 256 when

            `guest` is omitted
        persist_rootfs:
          type: string
          description: 'Deprecated: use MachineConfig.Rootfs instead'
          enum:
            - never
            - always
            - restart
        required_host_features:
          type: array
          description: >-
            Host features the Machine's host must have, such as
            `storage-tier-1`. At most 16, each made

            of lowercase letters, digits and dashes. Each feature must be
            enabled for the organization
          items:
            type: string
    placement.Weights:
      type: object
      additionalProperties:
        type: integer
        format: int64
    placement.RegionPlacement:
      type: object
      properties:
        Concurrency:
          type: integer
          description: >-
            Number of distinct hosts those Machines would be spread over. 0 when
            the request's count

            is 0.
        Count:
          type: integer
          description: >-
            Number of Machines that would be placed in the region. When the
            request's count is 0, the

            organization's Machine limit for the region instead.
        Region:
          type: string
          description: Code of the region.
  securitySchemes:
    FlyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Fly API token with access to the requested organization or resource.
        Send it as `Authorization: Bearer <Fly API token>`.

````