# Modify instance

> Modify a running compute instance's resources
The optional mode field is retained for legacy compatibility. If supplied, routing is derived from the requested or existing GPU count, not the mode value. New integrations should omit mode and configure resources using GPU type, GPU count, CPU, and storage.



## OpenAPI

````yaml ${THUNDER_API_BASE}/openapi.json post /instances/{id}/modify
openapi: 3.1.0
info:
  contact:
    email: support@thundercompute.one
    name: Thunder Compute API Support
    url: https://www.thundercompute.one/contact
  description: >-
    Retrieve current GPU availability using mode-less spec keys

    Recommended for new integrations. The /status and /v1/status endpoints
    retain their legacy configuration keys for compatibility.
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://swagger.io/terms/
  title: Thunder Compute API
  version: '1.0'
servers:
  - description: Production server
    url: ${THUNDER_API_BASE}/v1
  - description: Production server
    url: ${THUNDER_API_BASE}
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /instances/{id}/modify:
    post:
      tags:
        - Instances
      summary: Modify instance
      description: >-
        Modify a running compute instance's resources

        The optional mode field is retained for legacy compatibility. If
        supplied, routing is derived from the requested or existing GPU count,
        not the mode value. New integrations should omit mode and configure
        resources using GPU type, GPU count, CPU, and storage.
      parameters:
        - description: Instance ID (index)
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/thundertypes.InstanceModifyRequest'
              summary: request
              description: Instance modification parameters
        description: Instance modification parameters
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.InstanceModifyResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.QuotaExceededResponse'
          description: The change would exceed one of the organization's quotas
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/thundertypes.ErrorResponse'
          description: >-
            The organization's quotas could not be checked, or concurrent
            changes kept the request from committing; retry
      security:
        - ApiKeyAuth: []
components:
  schemas:
    thundertypes.InstanceModifyRequest:
      properties:
        add_ports:
          items:
            type: integer
          type: array
          uniqueItems: false
        cpu_cores:
          type: integer
        disk_size_gb:
          type: integer
        gpu_type:
          type: string
        mode:
          $ref: '#/components/schemas/thundertypes.InstanceMode'
          deprecated: true
          description: >-
            Deprecated: retained for legacy compatibility. Omit in new
            integrations. Behavior is specific to each endpoint; see its
            operation description.
        num_gpus:
          type: integer
        remove_ports:
          items:
            type: integer
          type: array
          uniqueItems: false
      type: object
    thundertypes.InstanceModifyResponse:
      properties:
        gpu_type:
          type: string
        identifier:
          type: string
        instance_name:
          type: string
        num_gpus:
          type: integer
      required:
        - identifier
        - instance_name
      type: object
    thundertypes.ErrorResponse:
      properties:
        code:
          example: 400
          type: integer
        error:
          example: invalid_request
          type: string
        message:
          example: The request is malformed
          type: string
      type: object
    thundertypes.QuotaExceededResponse:
      properties:
        code:
          example: 409
          type: integer
        error:
          example: quota_exceeded
          type: string
        message:
          type: string
        quota:
          $ref: '#/components/schemas/thundertypes.QuotaExceeded'
      type: object
    thundertypes.InstanceMode:
      enum:
        - prototyping
        - production
      type: string
      x-enum-varnames:
        - InstanceMode_Prototyping
        - InstanceMode_Production
    thundertypes.QuotaExceeded:
      properties:
        key:
          enum:
            - standard_gpus
            - premium_gpus
            - instances
            - sandboxes
            - sandbox_memory_gib
            - max_gpus_per_instance
          example: instances
          type: string
        limit:
          example: 10
          type: integer
        requested:
          example: 1
          type: integer
        usage:
          example: 10
          type: integer
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: >-
        Bearer token authentication. Provide your API token prefixed with
        "Bearer ", e.g. "Bearer your-api-token".
      in: header
      name: Authorization
      type: apiKey

````
