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

# [GPU] Attach a GPU to an instance

> Attach an available GPU to the instance. The instance is stopped and restarted as part of the operation. Billing starts on attachment and is charged per started hour. The operation is asynchronous; monitor the returned task for completion.



## OpenAPI

````yaml https://api.onetsolutions.net/schema post /v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/attach
openapi: 3.0.3
info:
  title: OnetSolutions API
  version: v1 (v1)
  description: >

    ## Overview


    The OnetSolutions API provides programmatic access to manage your cloud
    infrastructure, domains, and web hosting services.


    ## Authentication


    All API requests require authentication using one of the following methods:


    - **JWT Token**: Obtain a token via login endpoints and include it in the
    `Authorization: Bearer <token>` header

    - **API Key**: Generate an API key from your account settings and use it as
    `Authorization: Bearer sk-onetsolutions-...`


    ## Rate Limiting


    API requests are rate-limited to ensure fair usage:

    - **Standard**: 1000 requests per minute

    - **Burst**: 100 requests per second


    ## Pagination


    List endpoints return paginated results. Use `page` and `page_size` query
    parameters.


    ## Error Handling


    The API uses standard HTTP status codes:

    - `200` Success

    - `201` Created

    - `400` Bad Request

    - `401` Unauthorized

    - `403` Forbidden

    - `404` Not Found

    - `429` Too Many Requests
servers:
  - url: https://api.onetsolutions.net
    description: Production
security: []
tags:
  - name: Authentication
    description: >-
      Login, passwordless authentication, MFA, OAuth providers, and token
      management.
  - name: Organizations
    description: >-
      Organization management, members, roles, modules, audit logs, and
      notification settings.
  - name: Projects
    description: Project management, team members, and project-scoped resources.
  - name: Compute
    description: >-
      Cloud instances, volumes, snapshots, backups, VPCs, firewalls, SSH keys,
      uptime monitors, and instance tasks.
  - name: Domains
    description: >-
      Domain availability, registration, transfers, DNS zones, DNS records, and
      TLD information.
  - name: Web Hosting
    description: >-
      cPanel-based web hosting, emails, databases, subdomains, FTP accounts,
      addon domains, and SSL certificates.
paths:
  /v1/organizations/{organization_id}/projects/{project_id}/compute/instances/{id}/gpus/attach:
    post:
      tags:
        - Compute
      summary: '[GPU] Attach a GPU to an instance'
      description: >-
        Attach an available GPU to the instance. The instance is stopped and
        restarted as part of the operation. Billing starts on attachment and is
        charged per started hour. The operation is asynchronous; monitor the
        returned task for completion.
      operationId: attach_gpu
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          description: A UUID string identifying this Instance.
          required: true
        - in: path
          name: instance_id
          schema:
            type: string
          description: Unique identifier of the compute instance.
          required: true
        - in: path
          name: organization_id
          schema:
            type: string
          description: Unique identifier of the organization that owns the resource.
          required: true
        - in: path
          name: project_id
          schema:
            type: string
          description: Unique identifier of the project containing the resource.
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Instance'
        required: true
      responses:
        '202':
          description: GPU attachment initiated successfully
        '400':
          description: GPU unavailable or quota exceeded
        '401':
          description: Authentication credentials missing or invalid
        '403':
          description: Insufficient permissions
        '404':
          description: Instance or GPU not found
        '409':
          description: Instance has another task in progress
      security:
        - BearerAuth: []
components:
  schemas:
    Instance:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        legacy_id:
          type: integer
          readOnly: true
        organization_id:
          type: string
          format: uuid
          readOnly: true
        project_id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: Instance hostname
          maxLength: 255
        status:
          enum:
            - pending
            - provisioning
            - active
            - suspended
            - terminated
            - cancelled
            - error
          type: string
          x-spec-enum-id: 61c0ec0d4afc3ad7
          readOnly: true
          description: |-
            Billing status

            * `pending` - Pending
            * `provisioning` - Provisioning
            * `active` - Active
            * `suspended` - Suspended
            * `terminated` - Terminated
            * `cancelled` - Cancelled
            * `error` - Error
        size:
          allOf:
            - $ref: '#/components/schemas/InstanceSize'
          readOnly: true
        size_id:
          type: string
          format: uuid
          writeOnly: true
        location:
          allOf:
            - $ref: '#/components/schemas/DatacenterLocation'
          readOnly: true
        location_id:
          type: string
          format: uuid
          writeOnly: true
        vpc:
          allOf:
            - $ref: '#/components/schemas/VPC'
          readOnly: true
        vpc_id:
          type: string
          format: uuid
          writeOnly: true
          nullable: true
        image:
          allOf:
            - $ref: '#/components/schemas/InstanceImage'
          readOnly: true
        image_id:
          type: string
          format: uuid
          writeOnly: true
        os_name:
          type: string
          description: Operating system name
          maxLength: 100
        primary_ipv4:
          type: string
          readOnly: true
          nullable: true
        primary_ipv6:
          type: string
          readOnly: true
          nullable: true
        ip_addresses:
          type: array
          items:
            $ref: '#/components/schemas/IPAddress'
          readOnly: true
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/VolumeSummary'
          readOnly: true
        billing_cycle:
          enum:
            - free
            - one_time
            - hourly
            - monthly
            - quarterly
            - semi_annually
            - annually
            - biennially
            - triennially
          type: string
          description: |-
            * `free` - Free
            * `one_time` - One Time
            * `hourly` - Hourly
            * `monthly` - Monthly
            * `quarterly` - Quarterly
            * `semi_annually` - Semi-Annually
            * `annually` - Annually
            * `biennially` - Biennially
            * `triennially` - Triennially
          x-spec-enum-id: 99741277a111fd11
        billing_start_date:
          type: string
          format: date-time
          readOnly: true
        billing_end_date:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: For prepaid only
        next_billing_date:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        cancellation_requested_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: When cancellation was requested, effective at billing_end_date
        cancellation_reason:
          type: string
          readOnly: true
          description: Reason provided for cancellation request
        bandwidth_used_gb:
          type: string
          pattern: ^-?\d{0,13}(?:\.\d{0,2})?$
          readOnly: true
        tags:
          type: array
          items:
            type: string
            maxLength: 50
          description: Custom tags
        is_active:
          type: boolean
          readOnly: true
        is_installed:
          type: boolean
          readOnly: true
          description: Whether the instance OS/service has been installed
        snapshot_enabled:
          type: boolean
          readOnly: true
          description: Snapshot option active on the service
        backup_enabled:
          type: boolean
          readOnly: true
          description: Backup option active on the service
        active_addons:
          type: array
          items:
            type: object
            additionalProperties:
              type: string
          readOnly: true
        gpu_capable:
          type: boolean
          readOnly: true
        state_sync:
          allOf:
            - $ref: '#/components/schemas/InstanceStateSync'
          readOnly: true
        agent_info:
          allOf:
            - $ref: '#/components/schemas/InstanceAgentInfo'
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - active_addons
        - agent_info
        - backup_enabled
        - bandwidth_used_gb
        - billing_end_date
        - billing_start_date
        - cancellation_reason
        - cancellation_requested_at
        - created
        - gpu_capable
        - id
        - image
        - image_id
        - ip_addresses
        - is_active
        - is_installed
        - legacy_id
        - location
        - location_id
        - modified
        - name
        - next_billing_date
        - organization_id
        - os_name
        - primary_ipv4
        - primary_ipv6
        - project_id
        - size
        - size_id
        - snapshot_enabled
        - state_sync
        - status
        - volumes
        - vpc
    InstanceSize:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: 'Ex: VPS-S, VPS-M, VPS-L'
          maxLength: 100
        slug:
          type: string
          description: 'Ex: vps-s, vps-m'
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        cpu_model:
          enum:
            - e5-2680-v4
            - epyc-7443
            - epyc-9554
          type: string
          x-spec-enum-id: e52bd36ae707aae4
          description: |-
            CPU model

            * `e5-2680-v4` - E5-2680 v4
            * `epyc-7443` - AMD EPYC 7443
            * `epyc-9554` - AMD EPYC 9554
        vcpu:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Number of vCPUs
        ram_mb:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: RAM in MB
        bandwidth_mbps:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Bandwidth in Mb/s
        is_active:
          type: boolean
        description:
          type: string
        available_volumes:
          type: array
          items:
            $ref: '#/components/schemas/InstanceSizeVolume'
          readOnly: true
        pricing_options:
          type: array
          items:
            $ref: '#/components/schemas/InstanceSizePricing'
          readOnly: true
        available_addons:
          type: array
          items:
            $ref: '#/components/schemas/InstanceSizeAddon'
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - available_addons
        - available_volumes
        - bandwidth_mbps
        - created
        - id
        - modified
        - name
        - pricing_options
        - ram_mb
        - slug
        - vcpu
    DatacenterLocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          description: 'Ex: Paris DC1, Frankfurt DC2'
          maxLength: 100
        slug:
          type: string
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        country_code:
          type: string
          description: 'Ex: FR, DE'
          maxLength: 2
        is_active:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - country_code
        - created
        - id
        - modified
        - name
        - slug
    VPC:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        cidr_block:
          type: string
          description: 'Ex: 10.0.0.0/16'
          maxLength: 50
        location:
          allOf:
            - $ref: '#/components/schemas/DatacenterLocation'
          readOnly: true
        location_id:
          type: string
          format: uuid
          writeOnly: true
        is_active:
          type: boolean
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - cidr_block
        - created
        - id
        - location
        - modified
        - name
    InstanceImage:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        organization_id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        name:
          type: string
          description: 'Ex: Ubuntu 22.04 LTS, Debian 12'
          maxLength: 255
        slug:
          type: string
          description: 'Ex: ubuntu-22-04, debian-12'
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        description:
          type: string
        visibility:
          enum:
            - public
            - private
          type: string
          x-spec-enum-id: 076d8e197dd30156
          description: |-
            Public images are available to all, private to organization only

            * `public` - Public
            * `private` - Private
        os_name:
          type: string
          description: 'Ex: Ubuntu, Debian, CentOS'
          maxLength: 100
        os_version:
          type: string
          description: 'Ex: 22.04, 12, 8'
          maxLength: 50
        os_architecture:
          type: string
          description: 'Ex: x86_64, aarch64'
          maxLength: 20
        language:
          type: string
          readOnly: true
          description: Language code (fr, en, cn, etc.)
        is_active:
          type: boolean
        is_featured:
          type: boolean
          description: Featured public images
        is_windows:
          type: boolean
          readOnly: true
        requires_license_addon:
          type: boolean
          readOnly: true
        min_disk_gb:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Minimum disk size required (GB)
        min_ram_mb:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Minimum RAM required (MB)
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - created
        - id
        - is_windows
        - language
        - modified
        - name
        - organization_id
        - os_name
        - os_version
        - requires_license_addon
        - slug
    IPAddress:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        address:
          type: string
        ip_type:
          enum:
            - ipv4
            - ipv6
          type: string
          description: |-
            * `ipv4` - IPv4
            * `ipv6` - IPv6
          x-spec-enum-id: 7aa5eccc95045be6
        interface:
          type: integer
          readOnly: true
          description: Network interface index (0=net0, 1=net1, etc.)
        netmask:
          type: string
          readOnly: true
          nullable: true
        gateway:
          type: string
          readOnly: true
        network_id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        vlan:
          type: integer
          readOnly: true
          nullable: true
        mac_address:
          type: string
          readOnly: true
        is_primary:
          type: boolean
          readOnly: true
        reverse_dns:
          type: string
          maxLength: 255
        created:
          type: string
          format: date-time
          readOnly: true
        modified:
          type: string
          format: date-time
          readOnly: true
      required:
        - address
        - created
        - gateway
        - id
        - interface
        - ip_type
        - is_primary
        - mac_address
        - modified
        - netmask
        - network_id
        - vlan
    VolumeSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          readOnly: true
          description: Volume name
        size_gb:
          type: integer
          readOnly: true
          description: Volume size in GB
        status:
          enum:
            - pending
            - creating
            - available
            - attached
            - detached
            - deleting
            - deleted
            - error
          type: string
          description: |-
            * `pending` - Pending
            * `creating` - Creating
            * `available` - Available
            * `attached` - Attached
            * `detached` - Detached
            * `deleting` - Deleting
            * `deleted` - Deleted
            * `error` - Error
          x-spec-enum-id: 846eb9b3e36e98dc
          readOnly: true
        disk_name:
          type: string
          readOnly: true
          description: 'Disk name in hypervisor (ex: scsi0)'
        location:
          allOf:
            - $ref: '#/components/schemas/DatacenterLocation'
          readOnly: true
        price_monthly:
          type: string
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          readOnly: true
          description: Prix mensuel
        is_active:
          type: boolean
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
      required:
        - created
        - disk_name
        - id
        - is_active
        - location
        - name
        - price_monthly
        - size_gb
        - status
    InstanceStateSync:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        vm_status:
          type: string
          description: Statut réel dans Hypervisor (running, stopped, etc.)
          maxLength: 20
        uptime:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Uptime en secondes
        cpu_usage:
          type: string
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          description: Usage CPU en %
        memory_usage_mb:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Mémoire utilisée en MB
        disk_usage_gb:
          type: string
          pattern: ^-?\d{0,8}(?:\.\d{0,2})?$
          description: Disque utilisé en GB
        network_in_bytes:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          description: Bytes reçus
        network_out_bytes:
          type: integer
          maximum: 9223372036854776000
          minimum: -9223372036854776000
          format: int64
          description: Bytes envoyés
        last_synced_at:
          type: string
          format: date-time
          readOnly: true
          description: Dernière synchronisation avec Hypervisor
        sync_source:
          type: string
          description: Worker qui a effectué la sync
          maxLength: 100
      required:
        - id
        - last_synced_at
        - vm_status
    InstanceAgentInfo:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        agent_available:
          type: boolean
          readOnly: true
          description: Guest agent a répondu lors de la dernière collecte
        os_id:
          type: string
          readOnly: true
          description: ID OS (ubuntu, debian, ...)
        os_name:
          type: string
          readOnly: true
          description: Nom OS
        os_pretty_name:
          type: string
          readOnly: true
          description: Nom complet OS
        os_version:
          type: string
          readOnly: true
          description: Version OS
        kernel_release:
          type: string
          readOnly: true
          description: Version du kernel
        kernel_version:
          type: string
          readOnly: true
          description: Build du kernel
        machine:
          type: string
          readOnly: true
          description: Architecture (x86_64, ...)
        hostname:
          type: string
          readOnly: true
          description: Hostname rapporté par l'agent
        timezone:
          type: string
          readOnly: true
          description: Fuseau horaire de la VM
        filesystems:
          readOnly: true
          description: Systèmes de fichiers (mountpoint, usage)
        network_interfaces:
          readOnly: true
          description: Interfaces réseau (nom, mac, IPs)
        users:
          readOnly: true
          description: Utilisateurs connectés (user, login_time)
        last_collected_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
          description: Dernière collecte réussie
      required:
        - agent_available
        - filesystems
        - hostname
        - id
        - kernel_release
        - kernel_version
        - last_collected_at
        - machine
        - network_interfaces
        - os_id
        - os_name
        - os_pretty_name
        - os_version
        - timezone
        - users
    InstanceSizeVolume:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        volume_type:
          enum:
            - ssd
            - nvme
          type: string
          description: |-
            * `ssd` - SSD
            * `nvme` - NVMe
          x-spec-enum-id: defa042735ff9392
        disk_gb:
          type: integer
          maximum: 4294967295
          minimum: 0
          format: int64
          description: Disk size in GB
        is_default:
          type: boolean
          description: Default volume option for this size
        is_active:
          type: boolean
      required:
        - disk_gb
        - id
        - volume_type
    InstanceSizePricing:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        billing_cycle:
          enum:
            - hourly
            - monthly
            - quarterly
            - semi_annually
            - annually
            - biennially
            - triennially
          type: string
          description: |-
            * `hourly` - Hourly
            * `monthly` - Monthly
            * `quarterly` - Quarterly
            * `semi_annually` - Semi-Annually
            * `annually` - Annually
            * `biennially` - Biennially
            * `triennially` - Triennially
          x-spec-enum-id: 39fc1593b115d859
        price:
          type: string
          pattern: ^-?\d{0,6}(?:\.\d{0,4})?$
        discount_percent:
          type: string
          pattern: ^-?\d{0,3}(?:\.\d{0,2})?$
          description: Discount percentage compared to monthly
        is_default:
          type: boolean
        is_active:
          type: boolean
      required:
        - billing_cycle
        - id
        - price
    InstanceSizeAddon:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        addon:
          allOf:
            - $ref: '#/components/schemas/Addon'
          readOnly: true
        pricing_options:
          type: array
          items:
            $ref: '#/components/schemas/InstanceSizeAddonPricing'
          readOnly: true
        is_included:
          type: boolean
          description: If true, addon is included in the base price
        is_default:
          type: boolean
          description: Pre-selected by default in cart
        is_active:
          type: boolean
      required:
        - addon
        - id
        - pricing_options
    Addon:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        slug:
          type: string
          maxLength: 50
          pattern: ^[-a-zA-Z0-9_]+$
        name:
          type: string
          description: Name in English (default)
          maxLength: 100
        name_fr:
          type: string
          description: Name in French
          maxLength: 100
        description:
          type: string
          description: Description in English (default)
        description_fr:
          type: string
          description: Description in French
        billing_type:
          enum:
            - recurring
            - one_time
          type: string
          description: |-
            * `recurring` - Recurring
            * `one_time` - One Time
          x-spec-enum-id: 62c1b9d6ecb52382
        is_active:
          type: boolean
      required:
        - id
        - name
        - slug
    InstanceSizeAddonPricing:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        billing_cycle:
          enum:
            - hourly
            - monthly
            - quarterly
            - semi_annually
            - annually
            - biennially
            - triennially
          type: string
          description: |-
            * `hourly` - Hourly
            * `monthly` - Monthly
            * `quarterly` - Quarterly
            * `semi_annually` - Semi-Annually
            * `annually` - Annually
            * `biennially` - Biennially
            * `triennially` - Triennially
          x-spec-enum-id: 39fc1593b115d859
        price:
          type: string
          pattern: ^-?\d{0,6}(?:\.\d{0,4})?$
        is_active:
          type: boolean
      required:
        - billing_cycle
        - id
        - price
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: >-
        Use `Authorization: Bearer <token>` header. Token can be a JWT token or
        an API key (format: `sk-onetsolutions-...`).

````