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

# Purchase a commitment for a virtual machine

> Commits a virtual machine to a longer-term plan in exchange for a lower hourly rate. The virtual machine must not already be in a committed term.



## OpenAPI

````yaml /openapi.json post /v1/projects/{projectId}/vm/{id}/commit
openapi: 3.0.3
info:
  description: >-
    The CUDO Compute API is organized around
    [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer). Our
    API uses predictable resource-oriented URLs, accepts and returns
    [JSON](http://www.json.org/)-encoded requests and responses, and uses
    standard HTTP response codes, authentication, and verbs where possible.
  title: CUDO Compute service
  version: 1.0.0
servers:
  - url: https://rest.compute.cudo.org/
security:
  - bearerAuth: []
tags:
  - description: API keys allow you to authenticate requests with the CUDO Compute API.
    name: API keys
  - description: >
      Billing accounts hold all billing related information such as credit
      balance, payment methods & transaction history. You can use the same
      billing account for multiple projects.


      Related guide: [Billing](https://www.cudocompute.com/docs/billing)
    name: Billing
  - description: >
      Clusters are high-performance computing environments that can be used to
      run large-scale parallel and distributed applications.


      Related guide: [Clusters](https://www.cudocompute.com/docs/clusters)
    name: Clusters
  - description: >
      Storage disks are virtual disks that operate just like physical disks. You
      can attach & detach created storage disks to and from virtual machines in
      the same data center.


      Related guide: [Disks](https://www.cudocompute.com/docs/disks)
    name: Disks
  - description: |
      Images are boot disk templates used to create virtual machines.

      Related guide: [Images](https://www.cudocompute.com/docs/images)
    name: Images
  - description: >
      Bare-metal machines are dedicated physical servers for high-performance
      computing, offering full control and isolation from other users.


      Related guide: [Bare metal](https://www.cudocompute.com/docs/bare-metal)
    name: Machines
  - description: >
      Private networks allow you to securely connect your virtual machines
      together.


      Related guide: [Networks](https://www.cudocompute.com/docs/networks)
    name: Networks
  - description: >
      Store large amounts of unstructured data, including audio, video and user
      uploaded files.


      Related guide: [Object
      storage](https://www.cudocompute.com/docs/object-storage)
    name: Object storage
  - description: >
      Projects are containers for cloud resources, such as virtual machines &
      clusters.
    name: Projects
  - description: Operations for searching available compute resources.
    name: Resources
  - description: >
      SSH keys are access credentials that are automatically added to bare-metal
      and virtual machines you create.
    name: SSH keys
  - description: Operations related to user accounts and identity verification.
    name: Users
  - description: >
      A virtual machine (VM) is a software emulation of a physical computer.


      Related guide: [Virtual
      machines](https://www.cudocompute.com/docs/virtual-machines)
    name: Virtual machines
  - description: >
      Volumes are high-performance Network File Systems that allow cluster
      machines to share training data and model checkpoints.


      Related guide: [Volumes](https://www.cudocompute.com/docs/volumes)
    name: Volumes
paths:
  /v1/projects/{projectId}/vm/{id}/commit:
    post:
      tags:
        - Virtual machines
      summary: Purchase a commitment for a virtual machine
      description: >-
        Commits a virtual machine to a longer-term plan in exchange for a lower
        hourly rate. The virtual machine must not already be in a committed
        term.
      operationId: CommitVM
      parameters:
        - in: path
          name: projectId
          required: true
          schema:
            type: string
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommitVMBody'
        required: true
        x-originalParamName: body
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: A successful response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
          description: An unexpected error response.
components:
  schemas:
    CommitVMBody:
      properties:
        commitmentTerm:
          $ref: '#/components/schemas/CommitmentTerm'
      type: object
    Status:
      properties:
        code:
          format: int32
          type: integer
        details:
          items:
            $ref: '#/components/schemas/Any'
          type: array
        message:
          type: string
      type: object
    CommitmentTerm:
      default: COMMITMENT_TERM_NONE
      enum:
        - COMMITMENT_TERM_NONE
        - COMMITMENT_TERM_1_MONTH
        - COMMITMENT_TERM_3_MONTHS
        - COMMITMENT_TERM_6_MONTHS
        - COMMITMENT_TERM_12_MONTHS
        - COMMITMENT_TERM_24_MONTHS
        - COMMITMENT_TERM_36_MONTHS
        - COMMITMENT_TERM_60_MONTHS
      type: string
    Any:
      additionalProperties: {}
      properties:
        '@type':
          type: string
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        API key authentication. API keys should be passed using the format
        `Bearer API_KEY`.
      in: header
      name: Authorization
      type: apiKey

````