{
  "openapi": "3.1.0",
  "info": {
    "title": "Vast.ai API",
    "description": "API for managing cloud GPU instances, volumes, and resources on Vast.ai",
    "version": "1.0.0",
    "contact": {
      "name": "Vast.ai Support",
      "url": "https://discord.gg/hSuEbSQ4X8"
    }
  },
  "servers": [
    {
      "url": "https://console.vast.ai",
      "description": "Production API server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
 "paths": {
    "/api/v0/network_disk/": {
      "post": {
        "summary": "add network-disk",
        "description": "Adds a network disk to be used to create network volume offers, or adds machines to an existing network disk.\nCLI Usage: vast add network_disk <machine_id>... <mount_point> [options]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "mount_point"
                ],
                "properties": {
                  "machine_id": {
                    "type": "integer",
                    "description": "ID of the machine to add network disk to"
                  },
                  "machine_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    },
                    "description": "IDs of machines to add network disk to"
                  },
                  "mount_point": {
                    "type": "string",
                    "description": "Path to mount point of networked storage on machine or machines"
                  },
                  "disk_id": {
                    "type": "integer",
                    "description": "ID of network disk, if adding machines to existing disk"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "disk_id": {
                      "type": "integer",
                      "description": "ID of disk created or added to machines"
                    }
                  },
                  "example": {
                    "success": true,
                    "disk_id": 2
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid machine id"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_authorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Only machine owner can add network disk"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Network Volumes"
        ]
      }
    },
    "/api/v0/instances/{id}/ssh/": {
      "post": {
        "summary": "attach ssh-key",
        "description": "Attaches an SSH key to the specified instance, allowing SSH access using the provided key.\n\nCLI Usage: vast attach instance_id ssh_key",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the instance to attach the SSH key to"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ssh_key": {
                    "type": "string",
                    "description": "The SSH key to attach to the instance",
                    "example": "ssh-rsa AAAAB3NzaC1yc2EAAA..."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSH key attached successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "example": "SSH key attached successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/commands/copy_direct/": {
      "delete": {
        "summary": "cancel copy",
        "description": "Cancel a remote copy operation specified by the destination ID (dst_id).",
        "operationId": "cancelRemoteRsync",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dst_id": {
                    "type": "string",
                    "description": "ID of the copy instance target to cancel."
                  }
                },
                "required": [
                  "dst_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remote copy canceled successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments provided.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid dst_id."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Destination ID not found or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "no_such_user"
                    },
                    "msg": {
                      "type": "string",
                      "example": "No such user."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-rateLimit": 3.5,
        "tags": [
          "Instances"
        ]
      },
      "put": {
        "summary": "copy",
        "description": "Initiate a remote copy operation to transfer data from one instance to another or between an instance and the local machine.",
        "operationId": "initiateRemoteRsync",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "src_id": {
                    "type": "string",
                    "description": "ID of the source instance."
                  },
                  "dst_id": {
                    "type": "string",
                    "description": "ID of the destination instance."
                  },
                  "src_path": {
                    "type": "string",
                    "description": "Path of the source data."
                  },
                  "dst_path": {
                    "type": "string",
                    "description": "Path of the destination data."
                  }
                },
                "required": [
                  "src_path",
                  "dst_path"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Remote copy initiated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "example": "Remote to Remote copy initiated - check instance status bar for progress updates (~30 seconds delayed)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid arguments provided.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid src_path."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Source or destination ID not found or access denied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "no_such_user"
                    },
                    "msg": {
                      "type": "string",
                      "example": "No such user."
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "x-rateLimit": 3.5,
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/cancel_maint": {
      "put": {
        "summary": "cancel maint",
        "description": "Cancel a scheduled maintenance window for a specified machine.",
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "description": "ID of the machine to cancel maintenance for.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Maintenance window successfully canceled.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ctime": {
                      "type": "number",
                      "format": "float",
                      "description": "Current time in seconds since the epoch."
                    },
                    "machine_id": {
                      "type": "integer",
                      "description": "ID of the machine."
                    },
                    "msg": {
                      "type": "string",
                      "example": "deleted 1 scheduled maintenance window(s) on machine 1234"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Machine not found or does not belong to the user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "msg": {
                      "type": "string",
                      "example": "No such machine id"
                    },
                    "machine_id": {
                      "type": "integer"
                    },
                    "user_id": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/commands/rclone/": {
      "delete": {
        "summary": "cancel sync",
        "description": "Cancels an in-progress remote sync operation identified by the destination instance ID.\nThis operation cannot be resumed once canceled and must be restarted if needed.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dst_id": {
                    "type": "integer",
                    "description": "The destination instance ID of the sync operation to cancel."
                  }
                },
                "required": [
                  "dst_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sync operation canceled successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "example": "Remote copy canceled - check instance status bar for progress updates (~30 seconds delayed)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request due to missing or incorrect parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid dst_id."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Instance not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "no_such_instance"
                    },
                    "msg": {
                      "type": "string",
                      "example": "No such instance."
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      },
      "post": {
        "summary": "cloud copy",
        "description": "Starts a cloud copy operation by sending a command to the remote server. The operation can transfer data between an instance and a cloud service.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "instance_id": {
                    "type": "string",
                    "description": "ID of the instance."
                  },
                  "src": {
                    "type": "string",
                    "description": "Source path for the copy operation."
                  },
                  "dst": {
                    "type": "string",
                    "description": "Destination path for the copy operation."
                  },
                  "selected": {
                    "type": "string",
                    "description": "ID of the cloud connection."
                  },
                  "transfer": {
                    "type": "string",
                    "description": "Type of transfer (e.g., \"Instance To Cloud\" or \"Cloud To Instance\")."
                  },
                  "flags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Additional flags for the operation."
                  },
                  "api_key": {
                    "type": "string",
                    "description": "API key for authentication."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cloud copy operation initiated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "result_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request due to invalid parameters or cloud service.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/instances/bid_price/{id}/": {
      "put": {
        "summary": "change bid",
        "description": "Change the current bid price of an instance to a specified price.\nCLI Usage: vastai change bid id [--price PRICE]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "Instance ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id",
                  "price"
                ],
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "Client identifier (usually \"me\")",
                    "example": "me"
                  },
                  "price": {
                    "type": "number",
                    "description": "Bid price in $/hour",
                    "minimum": 0.001,
                    "maximum": 32.0,
                    "example": 0.17
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Please set a bid price >= 0.001."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "no_such_instance"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Instance with that ID does not exist."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/cleanup": {
      "put": {
        "summary": "cleanup machine",
        "description": "This endpoint removes expired contracts on a specified machine, freeing up space.\n\nCLI Usage: vast-ai cleanup machine {machine_id}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID of the machine to clean up."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "An empty JSON object is expected."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ctime": {
                      "type": "number",
                      "format": "float",
                      "example": 1633036800.0
                    },
                    "machine_id": {
                      "type": "integer",
                      "example": 123
                    },
                    "user_id": {
                      "type": "integer",
                      "example": 456
                    },
                    "num_deleted": {
                      "type": "integer",
                      "example": 5
                    },
                    "msg": {
                      "type": "string",
                      "example": "deleted 5 expired contracts on machine 123"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=8"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/auth/apikeys/": {
      "post": {
        "summary": "create api-key",
        "description": "Creates a new API key with specified permissions for the authenticated user.\n\nCLI Usage: vast create api-key --name NAME --permission_file PERMISSIONS [--key_params PARAMS]\n\nExample:\nvast create api-key --name \"read-only\" --permission_file permissions.json",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name for the API key",
                    "example": "read-only-key"
                  },
                  "permissions": {
                    "type": "object",
                    "description": "JSON object containing permission definitions",
                    "example": {
                      "read": true,
                      "write": false
                    }
                  },
                  "key_params": {
                    "type": "object",
                    "description": "Optional wildcard parameters for advanced keys",
                    "example": {
                      "ip_whitelist": [
                        "1.2.3.4"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "API key created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The ID of the created API key",
                      "example": 12345
                    },
                    "key": {
                      "type": "string",
                      "description": "The newly generated API key",
                      "example": "vast-123456789abcdef"
                    },
                    "permissions": {
                      "anyOf": [
                        {
                          "type": "boolean",
                          "description": "False when permissions are disabled",
                          "example": false
                        },
                        {
                          "type": "object",
                          "description": "Object defining the permissions when enabled",
                          "example": {
                            "read": true,
                            "write": false
                          }
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_permissions",
                        "missing_permissions"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid permission format"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "msg": {
                      "type": "string",
                      "example": "Unauthorized"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "get": {
        "summary": "show api keys",
        "description": "Retrieves all API keys associated with the authenticated user.\n\nCLI Usage: vastai show api-keys",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "API keys successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "apikeys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 123
                          },
                          "user_id": {
                            "type": "integer",
                            "example": 456
                          },
                          "key": {
                            "type": "string",
                            "example": "your-api-key-value"
                          },
                          "rights": {
                            "type": "string",
                            "example": "read"
                          },
                          "team_id": {
                            "type": "integer",
                            "example": 789
                          },
                          "team_name": {
                            "type": "string",
                            "example": "Team Alpha"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - API Key not provided or not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "API Key not provided as bearer token."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/workergroups/": {
      "post": {
        "summary": "create workergroup",
        "description": "Creates a new workergroup configuration that manages worker instances for a serverless endpoint.\n\nCLI Usage: vast-ai create workergroup --template_hash <HASH> --endpoint_name <NAME> [options]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint_name": {
                    "type": "string",
                    "description": "Name of the endpoint group",
                    "example": "vLLM-Qwen3-8B"
                  },
                  "endpoint_id": {
                    "type": "integer",
                    "description": "ID of existing endpoint group (alternative to endpoint_name)",
                    "example": 123
                  },
                  "template_hash": {
                    "type": "string",
                    "description": "Hash ID of template to use for worker instances",
                    "example": "abc123def456"
                  },
                  "template_id": {
                    "type": "integer",
                    "description": "ID of template (alternative to template_hash)",
                    "example": 456
                  },
                  "search_params": {
                    "type": "string",
                    "description": "Search query for finding worker instances (alternative to template)",
                    "default": "verified=true rentable=true rented=false",
                    "example": "gpu_name=RTX_3090 rentable=true"
                  },
                  "launch_args": {
                    "type": "string",
                    "description": "Additional launch arguments for worker instances",
                    "example": "--env VAR=value"
                  },
                  "min_load": {
                    "type": "number",
                    "description": "Minimum load threshold for scaling",
                    "default": 1.0,
                    "example": 1.0
                  },
                  "target_util": {
                    "type": "number",
                    "description": "Target GPU utilization",
                    "default": 0.9,
                    "example": 0.9
                  },
                  "cold_mult": {
                    "type": "number",
                    "description": "Cold start multiplier",
                    "default": 3.0,
                    "example": 3.0
                  },
                  "cold_workers": {
                    "type": "integer",
                    "description": "Number of cold workers to maintain",
                    "default": 3,
                    "example": 3
                  },
                  "max_workers": {
                    "type": "integer",
                    "description": "Maximum number of worker instances",
                    "default": 20,
                    "example": 20
                  },
                  "test_workers": {
                    "type": "integer",
                    "description": "Number of test workers",
                    "default": 3,
                    "example": 3
                  },
                  "gpu_ram": {
                    "type": "integer",
                    "description": "Minimum GPU RAM in GB",
                    "default": 24,
                    "example": 24
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created workergroup",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "id": {
                      "type": "integer",
                      "description": "ID of created autoscaling job",
                      "example": 789
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Please assign your workergroup to a valid endpoint identifier"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=4.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      },
      "get": {
        "summary": "show workergroup",
        "description": "Retrieves the list of workergroups associated with the authenticated user.\n\nCLI Usage: vastai show workergroups",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 123
                          },
                          "min_load": {
                            "type": "number",
                            "example": 1.0
                          },
                          "target_util": {
                            "type": "number",
                            "example": 0.9
                          },
                          "cold_mult": {
                            "type": "number",
                            "example": 3.0
                          },
                          "test_workers": {
                            "type": "integer",
                            "example": 3
                          },
                          "template_hash": {
                            "type": "string",
                            "example": "abc123def456"
                          },
                          "template_id": {
                            "type": "integer",
                            "example": 456
                          },
                          "search_query": {
                            "type": "object",
                            "description": "Parsed search parameters as JSON object",
                            "example": "verified=true rentable=true rented=false"
                          },
                          "launch_args": {
                            "type": "string",
                            "example": "--env VAR=value"
                          },
                          "gpu_ram": {
                            "type": "number",
                            "example": 24
                          },
                          "endpoint_name": {
                            "type": "string",
                            "example": "my_endpoint"
                          },
                          "endpoint_id": {
                            "type": "integer",
                            "example": 789
                          },
                          "api_key": {
                            "type": "string",
                            "example": "your_api_key_here"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-10-01T12:00:00Z"
                          },
                          "user_id": {
                            "type": "integer",
                            "example": 456
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/api/v0/endptjobs/": {
      "post": {
        "summary": "create endpoint",
        "description": "This endpoint creates a new job processing endpoint with specified parameters.\n\nCLI Usage: vast-ai create endpoint",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "min_load": {
                    "type": "number",
                    "description": "Minimum load for the endpoint.",
                    "default": 10.0,
                    "example": 50.0
                  },
                  "target_util": {
                    "type": "number",
                    "description": "Target utilization for the endpoint.",
                    "default": 0.9,
                    "example": 0.75
                  },
                  "cold_mult": {
                    "type": "number",
                    "description": "Multiplier for cold start.",
                    "default": 2.5,
                    "example": 2.0
                  },
                  "cold_workers": {
                    "type": "integer",
                    "description": "Number of cold workers.",
                    "default": 5,
                    "example": 5
                  },
                  "max_workers": {
                    "type": "integer",
                    "description": "Maximum number of workers.",
                    "default": 20,
                    "example": 20
                  },
                  "endpoint_name": {
                    "type": "string",
                    "description": "Name of the endpoint.",
                    "default": "default-endpoint",
                    "example": "my_endpoint"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "result": {
                      "type": "integer",
                      "description": "The ID of the created endpoint",
                      "example": 12345
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error",
                      "properties": {
                        "error": {
                          "type": "string",
                          "enum": [
                            "invalid_args"
                          ]
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=4.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      },
      "get": {
        "summary": "show endpoints",
        "description": "Retrieve a list of endpoint jobs for the authenticated user.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A list of endpoint jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 123
                          },
                          "min_load": {
                            "type": "number",
                            "example": 0.0
                          },
                          "target_util": {
                            "type": "number",
                            "example": 0.9
                          },
                          "cold_mult": {
                            "type": "number",
                            "example": 2.5
                          },
                          "cold_workers": {
                            "type": "integer",
                            "example": 5
                          },
                          "max_workers": {
                            "type": "integer",
                            "example": 20
                          },
                          "endpoint_name": {
                            "type": "string",
                            "example": "vLLM-Qwen3-8B"
                          },
                          "api_key": {
                            "type": "string",
                            "example": "your_api_key_here"
                          },
                          "user_id": {
                            "type": "integer",
                            "example": 456
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-10-01T12:00:00Z"
                          },
                          "endpoint_state": {
                            "type": "string",
                            "example": "active"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "No endpoints for user found"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/api/v0/secrets/": {
      "post": {
        "summary": "create env-var",
        "description": "Creates a new encrypted environment variable for the authenticated user.\nKeys are automatically converted to uppercase. Values are encrypted before storage.\nThere is a limit on the total number of environment variables per user.\n\nCLI Usage: vast create env-var KEY VALUE",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "value"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Environment variable key name (will be converted to uppercase)",
                    "example": "API_TOKEN"
                  },
                  "value": {
                    "type": "string",
                    "description": "Secret value to be encrypted and stored",
                    "pattern": "^[a-zA-Z0-9_\\-\\.]+$",
                    "example": "abc123xyz"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Environment variable created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "example": "Environment variable added successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "missing_input",
                        "max_secrets",
                        "existing_key"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Both 'key' and 'value' are required."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "delete": {
        "summary": "delete env var",
        "description": "Deletes an environment variable associated with the authenticated user.\nThe variable must exist and belong to the requesting user.\n\nCLI Usage: vastai delete env-var <name>",
        "operationId": "deleteUserSecret",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Name of the environment variable to delete",
                    "example": "MY_API_KEY"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Environment variable deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "enum": [
                            "missing_input",
                            "nonexistent_key"
                          ],
                          "example": "missing_input"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests - rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "get": {
        "summary": "show env vars",
        "description": "Retrieve a list of environment variables (secrets) for the authenticated user.\n\nCLI Usage: vast-ai show env-vars [-s]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with user secrets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "secrets": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "example": "*****"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "put": {
        "summary": "update env var",
        "description": "Updates the value of an existing environment variable for the authenticated user.\n\nCLI Usage: vast-ai set env-var KEY VALUE",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "key",
                  "value"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "The key of the environment variable to update (will be converted to uppercase)",
                    "example": "MY_API_KEY",
                    "pattern": "^[a-zA-Z_]\\w*$"
                  },
                  "value": {
                    "type": "string",
                    "description": "The new value for the environment variable",
                    "example": "xyz123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Environment variable updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "example": "Environment variable updated successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "missing_input",
                        "empty_input",
                        "input_too_long",
                        "invalid_characters",
                        "nonexistent_key"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/asks/{id}/": {
      "put": {
        "summary": "create instance",
        "description": "Creates a new instance by accepting an \"ask\" contract from a provider. This is the main endpoint for launching new instances on Vast.ai.\nCLI Usage: vast create instance <offer_id> [options]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the offer to accept"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template_id": {
                    "type": "integer",
                    "description": "Optional template ID to use for instance configuration",
                    "example": 89
                  },
                  "template_hash_id": {
                    "type": "string",
                    "description": "Optional template hash ID to use for instance configuration",
                    "example": "abc123def456"
                  },
                  "image": {
                    "type": "string",
                    "description": "Docker image to use for the instance",
                    "example": "tensorflow/tensorflow:latest-gpu",
                    "maxLength": 1024
                  },
                  "disk": {
                    "type": "number",
                    "description": "Storage space in GB",
                    "minimum": 8.0,
                    "default": 10.0,
                    "example": 32.0
                  },
                  "env": {
                    "type": "object",
                    "description": "Environment variables and port mappings",
                    "example": {
                      "JUPYTER_TOKEN": "abc123",
                      "PORTAL_CONFIG": "{\"ports\": [8080, 8081]}"
                    },
                    "maxLength": 256
                  },
                  "runtype": {
                    "type": "string",
                    "description": "Instance run type",
                    "enum": [
                      "ssh",
                      "jupyter",
                      "args",
                      "ssh_proxy",
                      "ssh_direct",
                      "jupyter_proxy",
                      "jupyter_direct"
                    ],
                    "example": "jupyter"
                  },
                  "onstart": {
                    "type": "string",
                    "description": "Commands to run when instance starts",
                    "maxLength": 4096,
                    "example": "pip install -r requirements.txt"
                  },
                  "label": {
                    "type": "string",
                    "description": "User-defined label for the instance",
                    "maxLength": 256,
                    "example": "training-job-1"
                  },
                  "image_login": {
                    "type": "string",
                    "description": "Docker registry credentials if needed",
                    "example": "-u username -p password docker.io"
                  },
                  "price": {
                    "type": "number",
                    "description": "Bid price per hour for interruptible instances",
                    "minimum": 0.001,
                    "maximum": 128.0,
                    "example": 0.4
                  },
                  "target_state": {
                    "type": "string",
                    "description": "Desired initial state of the instance",
                    "enum": [
                      "running",
                      "stopped"
                    ],
                    "default": "running",
                    "example": "running"
                  },
                  "cancel_unavail": {
                    "type": "boolean",
                    "description": "Whether to cancel if instance cannot start immediately. Defaults to false for interruptibles, true for on-demand with target_state='running'",
                    "example": true
                  },
                  "vm": {
                    "type": "boolean",
                    "description": "Whether this is a VM instance",
                    "default": false
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Client identifier (usually \"me\")",
                    "example": "me"
                  },
                  "apikey_id": {
                    "type": "string",
                    "description": "Optional API key identifier for audit logging"
                  },
                  "args": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Arguments to pass to the container entrypoint",
                    "example": [
                      "-c",
                      "echo hello; sleep infinity;"
                    ]
                  },
                  "entrypoint": {
                    "type": "string",
                    "description": "Override entrypoint for args launch instance",
                    "example": "bash"
                  },
                  "use_ssh": {
                    "type": "boolean",
                    "description": "Launch as an SSH instance type (deprecated, use runtype instead)"
                  },
                  "python_utf8": {
                    "type": "boolean",
                    "description": "Set python's locale to C.UTF-8"
                  },
                  "lang_utf8": {
                    "type": "boolean",
                    "description": "Install and generate locales before instance launch, set locale to C.UTF-8"
                  },
                  "use_jupyter_lab": {
                    "type": "boolean",
                    "description": "Launch instance with jupyter lab instead of notebook"
                  },
                  "jupyter_dir": {
                    "type": "string",
                    "description": "Directory in instance to use to launch jupyter"
                  },
                  "force": {
                    "type": "boolean",
                    "description": "Skip sanity checks when creating from an existing instance"
                  },
                  "user": {
                    "type": "string",
                    "description": "User to use with docker create (breaks some images, use with caution)"
                  },
                  "volume_info": {
                    "type": "object",
                    "description": "Volume creation/linking information",
                    "properties": {
                      "create_new": {
                        "type": "boolean",
                        "description": "Whether to create a new volume"
                      },
                      "volume_id": {
                        "type": "integer",
                        "description": "ID of existing volume to link or volume offer ID for new volume"
                      },
                      "size": {
                        "type": "integer",
                        "description": "Size of the volume in GB (for new volumes)"
                      },
                      "mount_path": {
                        "type": "string",
                        "description": "Mount path for the volume inside the container"
                      },
                      "name": {
                        "type": "string",
                        "description": "Label for the new volume"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Instance created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "new_contract": {
                      "type": "integer",
                      "description": "ID of the newly created instance contract",
                      "example": 1234568
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args",
                        "invalid_price",
                        "no_ssh_key_for_vm"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "error 400/3467: Invalid args: 'id' is required and must be a valid offer ID"
                    },
                    "ask_id": {
                      "type": "integer",
                      "example": 1234567
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "error 403/3586: Offer 1234567 is not your own. Hosts can only rent their own machines."
                    },
                    "ask_id": {
                      "type": "integer",
                      "example": 1234567
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Offer not found or not available",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "error 404/3603: no_such_ask Instance type by id 1234567 is not available."
                    },
                    "ask_id": {
                      "type": "integer",
                      "example": 1234567
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "Offer no longer available (when cancel_unavail is true and instance cannot start)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "no_such_ask"
                    },
                    "msg": {
                      "type": "string",
                      "example": "error 410/3907: no_such_ask Instance type 1234567 is no longer available."
                    },
                    "ask_id": {
                      "type": "integer",
                      "example": 1234567
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=4.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/network_volume/": {
      "put": {
        "summary": "create network-volume",
        "description": "Creates a network volume from an offer\nCLI Usage: vast create network-volume <offer_id>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "size"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of network volume ask being accepted"
                  },
                  "size": {
                    "type": "integer",
                    "description": "size of network volume in GB being created"
                  },
                  "name": {
                    "type": "string",
                    "description": "optional name for network volume being created"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "volume_name": {
                      "type": "string",
                      "description": "name of network volume created"
                    },
                    "volume_size": {
                      "type": "integer",
                      "description": "size of network volume created"
                    }
                  },
                  "example": {
                    "success": true,
                    "id": 6,
                    "msg": "Deleted network volume listing"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "You must pass in `id` in the body of the request"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_authorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Authorization Error. Check that you have proper privileges to perform this action."
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Network Volumes"
        ]
      },
      "post": {
        "summary": "list network-volume",
        "description": "Lists a network disk for rent as network volumes, or updates an existing listing with a new price/size/end date/discount\nCLI Usage: vast list network-volume <disk_id> [options]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "disk_id"
                ],
                "properties": {
                  "price_disk": {
                    "type": "number",
                    "format": "float",
                    "description": "Price per GB of network volume storage"
                  },
                  "disk_id": {
                    "type": "integer",
                    "description": "ID of network disk for which offer is being created"
                  },
                  "size": {
                    "type": "integer",
                    "description": "Size in GB of the amount of space available to be rented"
                  },
                  "credit_discount_max": {
                    "type": "number",
                    "format": "float",
                    "description": "Maximum discount rate allowed for prepaid credits"
                  },
                  "end_date": {
                    "type": "number",
                    "format": "float",
                    "description": "Unix timestamp for when the listing expires"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "msg": {
                      "type": "string",
                      "description": "status message"
                    }
                  },
                  "example": {
                    "success": true,
                    "disk_id": "created network volume ask with id 6 and size 24"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid disk_id"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_authorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Could not find network disk with id 6 associated with user"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Network Volumes"
        ]
      }
    },
    "/api/v0/ssh/": {
      "post": {
        "summary": "create ssh-key",
        "description": "Creates a new SSH key and associates it with your account.\nThe key will be automatically added to all your current instances.\n\nCLI Usage: vast create ssh-key <ssh_key>\nExample: vast create ssh-key \"ssh-rsa AAAAB3NzaC1...\"",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ssh_key"
                ],
                "properties": {
                  "ssh_key": {
                    "type": "string",
                    "description": "The public SSH key to add (from .pub file)",
                    "example": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC..."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSH key created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "key": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "The ID of the created SSH key",
                          "example": 123
                        },
                        "user_id": {
                          "type": "integer",
                          "description": "The user ID who owns the key",
                          "example": 456
                        },
                        "public_key": {
                          "type": "string",
                          "description": "The public SSH key content",
                          "example": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC..."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "example": "2023-01-01T12:00:00Z"
                        },
                        "deleted_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "example": null
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "no_ssh_key"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "No ssh key provided"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "get": {
        "summary": "show ssh keys",
        "description": "Retrieve a list of SSH keys associated with the authenticated user's account.",
        "operationId": "getSshKeysUser",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "Bearer token for user authentication.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of SSH keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "The unique identifier of the SSH key."
                      },
                      "user_id": {
                        "type": "integer",
                        "description": "The ID of the user to whom the SSH key belongs."
                      },
                      "key": {
                        "type": "string",
                        "description": "The SSH public key."
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The timestamp when the SSH key was created."
                      },
                      "deleted_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true,
                        "description": "The timestamp when the SSH key was deleted, if applicable."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized access due to invalid or missing authentication token."
          },
          "404": {
            "description": "No SSH keys found for the user."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/users/": {
      "post": {
        "summary": "create subaccount",
        "description": "Creates either a standalone user account or a subaccount under a parent account.\nSubaccounts can be restricted to host-only functionality.\n\nCLI Usage: vastai create subaccount --email EMAIL --username USERNAME --password PASSWORD --type host",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "username",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "User's email address",
                    "maxLength": 64,
                    "example": "user@example.com",
                    "pattern": "^(?!.*@vast)[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
                  },
                  "username": {
                    "type": "string",
                    "description": "Desired username",
                    "maxLength": 64,
                    "example": "testuser123"
                  },
                  "password": {
                    "type": "string",
                    "description": "Account password",
                    "maxLength": 256,
                    "example": "securepass123"
                  },
                  "host_only": {
                    "type": "boolean",
                    "description": "If true, account is restricted to host functionality only",
                    "example": true
                  },
                  "parent_id": {
                    "type": "string",
                    "description": "Parent account ID for subaccounts. Use \"me\" for current user.",
                    "example": "me"
                  },
                  "ssh_key": {
                    "type": "string",
                    "description": "Optional SSH public key",
                    "maxLength": 4096
                  },
                  "captcha": {
                    "type": "string",
                    "description": "Captcha token (required for non-subaccounts)",
                    "maxLength": 8192
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "User ID"
                    },
                    "username": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "api_key": {
                      "type": "string",
                      "description": "API key for the new account"
                    }
                  },
                  "example": {
                    "id": 12345,
                    "username": "testuser",
                    "email": "user@example.com",
                    "api_key": "abc123def456"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_email",
                        "invalid_request",
                        "missing_auth_value"
                      ]
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "error": "invalid_email",
                    "msg": "Email address not allowed"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - billing blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "User already exists",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "user_exists"
                      ]
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "example": {
                    "error": "user_exists",
                    "msg": "user already exists."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "put": {
        "summary": "set user",
        "description": "Updates the user data for the authenticated user.\n\nCLI Usage: vast set user --file {file_path}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "normalized_email": {
                    "type": "string",
                    "description": "Normalized email address.",
                    "example": "user@example.com"
                  },
                  "username": {
                    "type": "string",
                    "description": "Username of the user.",
                    "example": "johndoe"
                  },
                  "fullname": {
                    "type": "string",
                    "description": "Full name of the user.",
                    "example": "John Doe"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "missing_input",
                        "empty_input",
                        "input_too_long",
                        "invalid_characters",
                        "nonexistent_key"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/team": {
      "post": {
        "summary": "create team",
        "description": "Creates a new team with the authenticated user as the owner. The user's existing API key\nbecomes the owner key for the team. The user cannot already be a team or be a member of another team.\n\nThe operation:\n1. Converts the user into a team\n2. Creates default team roles (member, manager, owner)\n3. Converts user's API key into the owner key\n4. Adds the creating user as a team member\n\nCLI Usage: vast create team --name <team_name>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Team"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "team_name",
                  "permissions"
                ],
                "properties": {
                  "team_name": {
                    "type": "string",
                    "description": "Name for the new team",
                    "example": "my-awesome-team"
                  },
                  "permissions": {
                    "type": "object",
                    "description": "JSON object containing role and permission definitions. https://vast.ai/docs/cli/roles-and-permissions",
                    "example": {
                      "api": {
                        "misc": {},
                        "user_read": {},
                        "instance_read": {},
                        "instance_write": {},
                        "billing_read": {},
                        "billing_write": {}
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Team Successfully Created!"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "already_team",
                        "team_member"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Cannot create a team within a team"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "User's master API key not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v0/team/role": {
      "post": {
        "summary": "create team role",
        "description": "Creates a new role within a team. Only team owners or managers with the appropriate permissions can perform this operation.\n\nCLI Usage: vast create team role --name <role_name> --permissions <permissions_json>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Team"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "permissions"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Name for the new role",
                    "example": "developer"
                  },
                  "permissions": {
                    "type": "object",
                    "description": "JSON object containing permission definitions",
                    "example": {
                      "api": {
                        "user_read": {},
                        "instance_write": {}
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Role created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Role Successfully Created!"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_role_name"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Role name is invalid"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User lacks permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v0/template/": {
      "post": {
        "summary": "create template",
        "description": "Creates a new template for launching instances. If an identical template already exists,\nreturns the existing template instead of creating a duplicate.\n\nCLI Usage: vast create template [options]",
        "tags": [
          "Templates"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "description": "Docker image path",
                    "example": "ghcr.io/huggingface/text-generation-inference:1.0.3"
                  },
                  "tag": {
                    "type": "string",
                    "description": "Docker image tag"
                  },
                  "env": {
                    "type": "string",
                    "description": "Docker environment variables and run arguments",
                    "example": "-p 3000:3000 -e MODEL_ARGS='--model-id TheBloke/Llama-2-7B-chat-GPTQ'"
                  },
                  "onstart": {
                    "type": "string",
                    "description": "Command to run on instance startup"
                  },
                  "jup_direct": {
                    "type": "boolean",
                    "description": "Enable direct Jupyter connection"
                  },
                  "ssh_direct": {
                    "type": "boolean",
                    "description": "Enable direct SSH connection"
                  },
                  "use_jupyter_lab": {
                    "type": "boolean",
                    "description": "Use JupyterLab instead of Jupyter Notebook"
                  },
                  "runtype": {
                    "type": "string",
                    "enum": [
                      "jupyter",
                      "ssh",
                      "args"
                    ],
                    "description": "Type of instance runtime"
                  },
                  "use_ssh": {
                    "type": "boolean",
                    "description": "Enable SSH access"
                  },
                  "jupyter_dir": {
                    "type": "string",
                    "description": "Jupyter notebook directory"
                  },
                  "docker_login_repo": {
                    "type": "string",
                    "description": "Docker repository requiring authentication"
                  },
                  "extra_filters": {
                    "type": "object",
                    "description": "Additional machine search filters"
                  },
                  "recommended_disk_space": {
                    "type": "number",
                    "description": "Recommended disk space in GB"
                  }
                },
                "required": [
                  "image"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Template created or existing template found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Whether operation was successful"
                    },
                    "msg": {
                      "type": "string",
                      "description": "Status message"
                    },
                    "template": {
                      "type": "object",
                      "description": "Template details",
                      "properties": {
                        "id": {
                          "type": "integer",
                          "description": "Template ID"
                        },
                        "hash_id": {
                          "type": "string",
                          "description": "Template hash identifier"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "msg": {
                      "type": "string",
                      "example": "Template Failed to be Created"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key"
          }
        }
      },
      "get": {
        "summary": "search templates",
        "description": "Searches for templates based on query parameters and retrieves matching templates.\n\nCLI Usage: vast search templates",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search query string to match against template fields."
          },
          {
            "name": "select_filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "object"
            },
            "description": "Filters to apply on the search results."
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Column to order the results by."
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "templates_found",
                    "templates"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "templates_found": {
                      "type": "integer",
                      "description": "Number of templates found.",
                      "example": 5
                    },
                    "templates": {
                      "type": "array",
                      "description": "List of templates matching the search criteria.",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/api/v0/auth/apikeys/{id}/": {
      "delete": {
        "summary": "delete api key",
        "description": "Deletes an existing API key belonging to the authenticated user.\nThe API key is soft-deleted by setting a deleted_at timestamp.\n\nCLI Usage: vastai delete api-key ID",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the API key to delete",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 123
          }
        ],
        "responses": {
          "200": {
            "description": "API key successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "Successfully Deleted API Key"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - API key ID not provided",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "API Key ID not provided."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key belongs to a different user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "You do not have permission to delete this API Key."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - API key does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "API Key not found."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "get": {
        "summary": "show api key",
        "description": "Retrieves an existing API key belonging to the authenticated user.\n\nCLI Usage: vastai show api-key ID",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the API key to retrieve",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 123
          }
        ],
        "responses": {
          "200": {
            "description": "API key successfully retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "your-api-key-value"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - API key belongs to a different user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "You do not have permission to access this key."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - API key does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "API Key not found."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/workergroups/{id}/": {
      "delete": {
        "summary": "delete workergroup",
        "description": "Deletes an existing workergroup.\n\nCLI Usage: vastai delete workergroup <ID>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the workergroup to delete",
            "schema": {
              "type": "integer",
              "example": 4242
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workergroup deleted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "deleted_workers": {
                      "type": "array",
                      "description": "List of worker instances that were deleted",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        1001,
                        1002
                      ]
                    },
                    "failed_workers": {
                      "type": "array",
                      "description": "List of worker instances that failed to delete",
                      "items": {
                        "type": "integer"
                      },
                      "example": []
                    },
                    "msg": {
                      "type": "string",
                      "description": "Additional information about the deletion",
                      "example": "Deleted workergroup and 2 workers"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid autojob ID"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Workergroup not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "no_such_workergroup"
                    },
                    "msg": {
                      "type": "string",
                      "example": "No workergroup by that id is available."
                    },
                    "id": {
                      "type": "integer",
                      "example": 4242
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      },
      "put": {
        "summary": "update workergroup",
        "description": "Updates the properties of an existing workergroup based on the provided parameters.\n\nCLI Usage: vastai update workergroup <ID> [OPTIONS]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The ID of the workergroup to update.",
            "schema": {
              "type": "integer",
              "example": 4242
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "min_load": {
                    "type": "number",
                    "description": "Minimum load for the workergroup.",
                    "example": 1.0
                  },
                  "target_util": {
                    "type": "number",
                    "description": "Target utilization for the workergroup.",
                    "example": 0.9
                  },
                  "cold_mult": {
                    "type": "number",
                    "description": "Cold multiplier for the workergroup.",
                    "example": 3.0
                  },
                  "test_workers": {
                    "type": "integer",
                    "description": "Number of test workers for performance estimation.",
                    "default": 3,
                    "example": 3
                  },
                  "template_hash": {
                    "type": "string",
                    "description": "Template hash for the workergroup.",
                    "example": "abc123def456"
                  },
                  "template_id": {
                    "type": "integer",
                    "description": "Template ID for the workergroup.",
                    "example": 456
                  },
                  "search_params": {
                    "type": "string",
                    "description": "Search parameters for offers (JSON object or query string).",
                    "default": "verified=true rentable=true rented=false",
                    "example": "gpu_name=RTX_3090 rentable=true"
                  },
                  "launch_args": {
                    "type": "string",
                    "description": "Launch arguments for creating instances.",
                    "example": "--env VAR=value"
                  },
                  "gpu_ram": {
                    "type": "number",
                    "description": "Estimated GPU RAM requirement.",
                    "example": 24
                  },
                  "endpoint_name": {
                    "type": "string",
                    "description": "Deployment endpoint name.",
                    "example": "vLLM-Qwen3-8B"
                  },
                  "endpoint_id": {
                    "type": "integer",
                    "description": "Deployment endpoint ID.",
                    "example": 123
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated the workergroup.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Workgroup not found for user"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/api/v0/endptjobs/{id}/": {
      "delete": {
        "summary": "delete endpoint",
        "description": "Deletes an endpoint group by ID. Associated workergroups will also be deleted.\n\nCLI Usage: vastai delete endpoint <ID>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the endpoint group to delete",
            "schema": {
              "type": "integer",
              "example": 4242
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Endpoint group successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "deleted_workers": {
                      "type": "array",
                      "description": "List of worker instances that were deleted (if any)",
                      "items": {
                        "type": "integer"
                      },
                      "example": [
                        1001,
                        1002
                      ]
                    },
                    "failed_workers": {
                      "type": "array",
                      "description": "List of worker instances that failed to delete (if any)",
                      "items": {
                        "type": "integer"
                      },
                      "example": []
                    },
                    "msg": {
                      "type": "string",
                      "description": "Additional information about the deletion",
                      "example": "Deleted endpoint job and 2 workers"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Routegroup not found for user"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      },
      "put": {
        "summary": "update endpoint",
        "description": "Updates the specified endpoint group with the provided parameters.\n\nCLI Usage: vastai update endpoint ID [OPTIONS]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the endpoint group to update",
            "schema": {
              "type": "integer",
              "example": 4242
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "min_load": {
                    "type": "number",
                    "description": "Minimum floor load in perf units/s (token/s for LLMs)",
                    "example": 0.0
                  },
                  "target_util": {
                    "type": "number",
                    "description": "Target capacity utilization (fraction, max 1.0)",
                    "example": 0.9
                  },
                  "cold_mult": {
                    "type": "number",
                    "description": "Cold/stopped instance capacity target as multiple of hot capacity target",
                    "example": 2.5
                  },
                  "cold_workers": {
                    "type": "integer",
                    "description": "Min number of workers to keep 'cold' when you have no load",
                    "example": 5
                  },
                  "max_workers": {
                    "type": "integer",
                    "description": "Max number of workers your endpoint group can have",
                    "example": 20
                  },
                  "endpoint_name": {
                    "type": "string",
                    "description": "Deployment endpoint name",
                    "example": "my_endpoint"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Endpointgroup not found for user"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/api/v0/ssh/{id}/": {
      "delete": {
        "summary": "delete ssh key",
        "description": "Removes an SSH key from the authenticated user's account\nCLI Usage: vastai delete ssh-key <id>`",
        "operationId": "deleteSshKey",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the SSH key to delete",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSH key successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  },
                  "required": [
                    "success"
                  ]
                },
                "example": {
                  "success": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or SSH key not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "no_ssh_key"
                    },
                    "msg": {
                      "type": "string",
                      "example": "No ssh key provided"
                    }
                  },
                  "required": [
                    "success",
                    "error",
                    "msg"
                  ]
                },
                "examples": {
                  "not_found": {
                    "value": {
                      "success": false,
                      "error": "no_ssh_key",
                      "msg": "No ssh key provided"
                    }
                  },
                  "invalid": {
                    "value": {
                      "success": false,
                      "error": "invalid_request",
                      "msg": "Invalid request parameters"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "put": {
        "summary": "update ssh key",
        "description": "Updates the specified SSH key with the provided value.\n\nCLI Usage: vastai update ssh-key id ssh_key",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the SSH key to update"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ssh_key"
                ],
                "properties": {
                  "ssh_key": {
                    "type": "string",
                    "description": "The new value for the SSH key",
                    "example": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3..."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSH key updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "key": {
                      "type": "object",
                      "description": "The updated SSH key data"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/volumes": {
      "delete": {
        "summary": "delete volume",
        "description": "Delete a volume by its ID. CLI Usage: vastai delete volume VOLUME_ID",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the volume to delete",
                    "example": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Please provide a valid volume ID."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "no_such_volume"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Volume with that ID does not exist."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Volumes"
        ]
      }
    },
    "/api/v0/instances/{id}/": {
      "delete": {
        "summary": "destroy instance",
        "description": "Destroys/deletes an instance permanently. This is irreversible and will delete all data.\n\nCLI Usage: vast-ai destroy instance <id>\nExample: vast-ai destroy instance 4242",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the instance to destroy",
            "example": 4242
          }
        ],
        "responses": {
          "200": {
            "description": "Instance destroyed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true,
                      "description": "Whether the destruction was successful"
                    },
                    "msg": {
                      "type": "string",
                      "description": "Optional status message",
                      "example": "Instance destroyed successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid instance ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "invalid instance_id"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Instance not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "not_found"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Instance not found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "rate_limit_exceeded"
                    },
                    "msg": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Instances"
        ]
      },
      "put": {
        "summary": "manage instance",
        "description": "Manage instance state and labels. The operation is determined by the request body parameters.\n\nCLI Usage:\n- To stop: vastai stop instance <ID>\n- To start: vastai start instance <ID>\n- To label: vastai label instance <ID> <label>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the instance to modify",
            "example": 1234
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "At least one of these parameters should be provided",
                "properties": {
                  "state": {
                    "type": "string",
                    "description": "Change instance state (optional)",
                    "enum": [
                      "stopped",
                      "running"
                    ],
                    "example": "stopped"
                  },
                  "label": {
                    "type": "string",
                    "description": "Text label to assign to the instance (optional)",
                    "maxLength": 1024,
                    "example": "My ML Training Job"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimpleBooleanSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      },
      "get": {
        "summary": "show instance",
        "description": "Retrieves the details of a specific instance for the authenticated user.\nThis endpoint returns detailed information including SSH connection parameters, instance state, resource utilization, template data, and pricing details.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The ID of the instance to retrieve.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 123
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with instance details.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "instances": {
                      "$ref": "#/components/schemas/Instance"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request – Invalid instance ID or invalid arguments.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – Invalid or missing authentication.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests – API requests are too frequent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/team/": {
      "delete": {
        "summary": "destroy team",
        "description": "Deletes a team and all associated data including API keys, rights, invitations,\nmemberships and metadata. The team owner's master API key is converted to a normal client key.\n\nCLI Usage: vast-ai destroy team",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Team successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Team Successfully Deleted!"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Team does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "enum": [
                            "no_such_user"
                          ]
                        },
                        "msg": {
                          "type": "string",
                          "example": "No such user."
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/instances/{id}/ssh/{key}/": {
      "delete": {
        "summary": "detach ssh-key",
        "description": "Detaches an SSH key from a specified instance, removing SSH access for\nthat key.\n\n\nCLI Usage: vastai detach <instance_id> <ssh_key_id>\n\nExample: vastai detach 99999 12345",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the instance to detach the SSH key from",
            "schema": {
              "type": "integer",
              "example": 99999
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "description": "Numeric ID of the SSH key to detach",
            "schema": {
              "type": "integer",
              "example": 12345
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSH key successfully detached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "example": "SSH key removed from instance."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_request"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid request parameters"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Instance or SSH key not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "no_such_instance",
                        "no_such_ssh_key"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Instance not found."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "delete_ssh_from_instance"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Error deleting SSH key from instance"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/instances/command/{id}/": {
      "put": {
        "summary": "execute",
        "description": "Executes a constrained remote command on a specified instance.\nThe command output can be retrieved from the returned result URL.\n\nCLI Usage: vastai execute <instance_id> <command>\nExample: vastai execute 12345 \"ls -l\"",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the instance to execute command on",
            "schema": {
              "type": "integer",
              "example": 12345
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "command"
                ],
                "properties": {
                  "command": {
                    "type": "string",
                    "description": "Command to execute on the instance",
                    "example": "ls -l",
                    "maxLength": 512
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Command queued successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "writeable_path": {
                      "type": "string",
                      "description": "Container writeable path",
                      "example": "/workspace"
                    },
                    "result_url": {
                      "type": "string",
                      "description": "URL to fetch command execution results",
                      "example": "https://s3.amazonaws.com/vast.ai/instance_logs/abc123.log"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Command is executing, wait a few seconds and then view the result_url"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args",
                        "invalid_container_id",
                        "invalid_container"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid command given."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.5"
                    }
                  }
                }
              }
            }
          },
          "483": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid json_body"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/get_workergroup_logs/": {
      "post": {
        "servers": [
          {
            "url": "https://run.vast.ai",
            "description": "Production server"
          }
        ],
        "summary": "get workergroup logs",
        "description": "Retrieves logs for a specific workergroup by ID.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the worker group",
                    "default": 12345,
                    "example": 12345,
                    "minimum": 1
                  },
                  "tail": {
                    "type": "integer",
                    "description": "Number of log lines to retrieve from the end",
                    "default": 10000,
                    "example": 1000,
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Logs successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Success - Logs Retrieved",
                      "type": "object",
                      "properties": {
                        "logs": {
                          "type": "string",
                          "description": "The workergroup logs",
                          "example": "2023-10-01 12:00:00 - Workergroup started\n2023-10-01 12:01:00 - Instance scaled up"
                        }
                      }
                    },
                    {
                      "title": "Error Response",
                      "type": "string",
                      "description": "Error message when workergroup not found or authentication fails",
                      "example": "authenticate_workergroup_apikey: invalid api_key or workergroup 12345 not found"
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/get_workergroup_workers/": {
      "post": {
        "servers": [
          {
            "url": "https://run.vast.ai",
            "description": "Production server"
          }
        ],
        "summary": "get workergroup workers",
        "description": "Retrieves the current list and status of workers for a specific workergroup.\n\nUseful for monitoring, debugging connectivity issues, and understanding resource usage within a workergroup.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the workergroup to monitor",
                    "default": 12345,
                    "example": 12345,
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workers successfully retrieved.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Success - Workers Retrieved",
                      "type": "object",
                      "properties": {
                        "workers": {
                          "type": "array",
                          "description": "List of workers in this workergroup",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "description": "Workergroup instance ID",
                                "example": 67890
                              },
                              "status": {
                                "type": "string",
                                "description": "Current worker status",
                                "example": "running"
                              },
                              "url": {
                                "type": "string",
                                "description": "Worker instance URL",
                                "example": "http://192.168.1.10:8000"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "When the worker was created",
                                "example": "2023-10-01T12:00:00Z"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Error Response",
                      "type": "string",
                      "description": "Error message when workergroup not found or authentication fails",
                      "example": "authenticate_workergroup_apikey: invalid api_key or workergroup 12345 not found"
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/get_endpoint_logs/": {
      "post": {
        "servers": [
          {
            "url": "https://run.vast.ai",
            "description": "Production server"
          }
        ],
        "summary": "get endpoint logs",
        "description": "Retrieves logs for a specific endpoint by name.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "endpoint"
                ],
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "description": "Name of the endpoint",
                    "example": "vLLM-Qwen3-8B"
                  },
                  "tail": {
                    "type": "integer",
                    "description": "Number of log lines to retrieve from the end",
                    "default": 10000,
                    "example": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved endpoint logs.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Success - Logs Retrieved",
                      "type": "object",
                      "properties": {
                        "logs": {
                          "type": "string",
                          "description": "The endpoint logs",
                          "example": "2023-10-01 12:00:00 - Worker started\n2023-10-01 12:01:00 - Request processed"
                        }
                      }
                    },
                    {
                      "title": "Error Response",
                      "type": "string",
                      "description": "Error message when endpoint not found or authentication fails",
                      "example": "authenticate_endpoint_apikey: invalid api_key or endpoint vLLM-Qwen3-8B not found"
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/get_endpoint_workers/": {
      "post": {
        "servers": [
          {
            "url": "https://run.vast.ai",
            "description": "Production server"
          }
        ],
        "summary": "get endpoint workers",
        "description": "Retrieves the current list and status of workers for a specific endpoint.\n\nUseful for monitoring, debugging connectivity issues, and understanding resource usage.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the endpoint to monitor",
                    "default": 12345,
                    "example": 12345,
                    "minimum": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully retrieved endpoints workers.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Success - Workers Retrieved",
                      "type": "object",
                      "properties": {
                        "workers": {
                          "type": "array",
                          "description": "List of workers for this endpoint",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "description": "Worker instance ID",
                                "example": 67890
                              },
                              "status": {
                                "type": "string",
                                "description": "Current worker status",
                                "example": "running"
                              },
                              "url": {
                                "type": "string",
                                "description": "Worker instance URL",
                                "example": "http://192.168.1.10:8000"
                              },
                              "created_at": {
                                "type": "string",
                                "description": "When the worker was created",
                                "example": "2023-10-01T12:00:00Z"
                              }
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Error Response",
                      "type": "string",
                      "description": "Error message when endpoint not found or authentication fails",
                      "example": "authenticate_endpoint_apikey: invalid api_key or endpoint vLLM-Qwen3-8B not found"
                    }
                  ]
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/api/v0/team/invite/": {
      "post": {
        "summary": "invite team member",
        "description": "Sends an invitation email to the specified user to join the team with the given role.\n\nCLI Usage: vast-ai invite team-member --email EMAIL --role ROLE",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "role"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address of the user to invite",
                    "format": "email",
                    "example": "user@example.com"
                  },
                  "role": {
                    "type": "string",
                    "description": "Role to assign to the new team member",
                    "example": "developer"
                  },
                  "api_key": {
                    "type": "string",
                    "description": "API key of the inviting user",
                    "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Invitation sent successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "New invitation sent to ${email}"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "enum": [
                        "User is a not a team member",
                        "User cannot be invited to their own team.",
                        "User is already a member of this team."
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - User not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Team metadata not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Team metadata not found"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Duplicate invitation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Error: invitation already sent to user@example.com only 300 seconds ago."
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/machines/create_asks/": {
      "put": {
        "summary": "list machine",
        "description": "Creates or updates ask contracts for a machine to list it for rent on the vast.ai platform.\nAllows setting pricing, minimum GPU requirements, end date and discount rates.\n\nCLI Usage: vast list machine <machine_id> [options]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "machine"
                ],
                "properties": {
                  "machine": {
                    "type": "integer",
                    "description": "ID of the machine to list"
                  },
                  "price_gpu": {
                    "type": "number",
                    "format": "float",
                    "description": "Price per GPU per hour"
                  },
                  "price_disk": {
                    "type": "number",
                    "format": "float",
                    "description": "Price per GB of disk storage"
                  },
                  "price_inetu": {
                    "type": "number",
                    "format": "float",
                    "description": "Price per GB of upload bandwidth"
                  },
                  "price_inetd": {
                    "type": "number",
                    "format": "float",
                    "description": "Price per GB of download bandwidth"
                  },
                  "price_min_bid": {
                    "type": "number",
                    "format": "float",
                    "description": "Minimum bid price allowed"
                  },
                  "min_chunk": {
                    "type": "integer",
                    "description": "Minimum number of GPUs that must be rented together",
                    "default": 1
                  },
                  "end_date": {
                    "type": "number",
                    "format": "float",
                    "description": "Unix timestamp for when the listing expires"
                  },
                  "credit_discount_max": {
                    "type": "number",
                    "format": "float",
                    "description": "Maximum discount rate allowed for prepaid credits"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "extended": {
                      "type": "integer",
                      "description": "Number of client contracts extended to new end date"
                    },
                    "msg": {
                      "type": "string",
                      "description": "Status message if success is false"
                    }
                  },
                  "example": {
                    "success": true,
                    "extended": 2
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid machine id or parameters"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_authorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Only machine owner can create ask contracts"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/instances/request_logs/{id}": {
      "put": {
        "summary": "show logs",
        "description": "Request logs from a specific instance. The logs will be uploaded to S3 and\ncan be retrieved from a generated URL. Supports both container logs and daemon\nsystem logs.\n\nCLI Usage: vast logs INSTANCE_ID [--tail LINES] [--filter GREP] [--daemon-logs]",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the instance to get logs from",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tail": {
                    "type": "string",
                    "description": "Number of lines to show from end of logs",
                    "example": "1000"
                  },
                  "filter": {
                    "type": "string",
                    "description": "Grep filter to apply to log entries"
                  },
                  "daemon_logs": {
                    "type": "string",
                    "enum": [
                      "true"
                    ],
                    "description": "If \"true\", fetch daemon system logs instead of container logs"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response with S3 URL for log retrieval",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "result_url": {
                      "type": "string",
                      "description": "S3 URL where logs can be downloaded",
                      "example": "https://s3.amazonaws.com/vast.ai/instance_logs/{hash}.log"
                    },
                    "msg": {
                      "type": "string",
                      "description": "Status message"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Instance not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_id"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid instance id."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Not authorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_authorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Not authorized to view logs for this instance"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/instances/prepay/{id}/": {
      "put": {
        "summary": "prepay instance",
        "description": "Deposit credits into a reserved instance to receive usage discounts.\nThe discount rate is calculated based on how many months of usage the prepaid amount covers.\nMaximum discount is typically 40%.\n\nCLI Usage: vastai prepay instance <ID> <AMOUNT>\nExample: vastai prepay instance 1234 500.0",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the instance to prepay for"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount"
                ],
                "properties": {
                  "amount": {
                    "type": "number",
                    "format": "float",
                    "description": "Amount of credits to prepay",
                    "example": 500.0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully applied prepayment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "timescale": {
                      "type": "number",
                      "format": "float",
                      "description": "Number of months the prepayment will cover",
                      "example": 3.5
                    },
                    "discount_rate": {
                      "type": "number",
                      "format": "float",
                      "description": "Applied discount rate (0.0-0.4)",
                      "example": 0.3
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid instance ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "msg": {
                      "type": "string",
                      "example": "No such instance"
                    }
                  }
                }
              }
            }
          },
          "411": {
            "description": "Insufficient credit balance",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "msg": {
                      "type": "string",
                      "example": "Insufficient credit"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/instances/reboot/{id}/": {
      "put": {
        "summary": "reboot instance",
        "description": "Stops and starts a container without losing GPU priority. Updates container status to 'rebooting'\nand executes docker stop/start commands on the host machine.\n\nCLI Usage: vastai reboot instance <ID>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the instance to reboot",
            "example": 1234
          }
        ],
        "responses": {
          "200": {
            "description": "Instance reboot initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "invalid instance_id"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/instances/recycle/{id}/": {
      "put": {
        "summary": "recycle instance",
        "description": "Destroys and recreates container in place (from newly pulled image) without losing GPU priority.\nUpdates container status to 'recycling' and executes docker stop/remove commands on the host machine.\n\nCLI Usage: vastai recycle instance <ID>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "ID of the instance to recycle",
            "example": 1234
          }
        ],
        "responses": {
          "200": {
            "description": "Instance recycle initiated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid instance ID",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_id"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid instance id."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/defjob": {
      "delete": {
        "summary": "remove defjob",
        "description": "Deletes the default job (background instances) for a specified machine.\n\nCLI Usage: vast-ai remove defjob {machine_id}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "description": "ID of the machine to remove the default job from.",
            "schema": {
              "type": "integer",
              "example": 12345
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "machine_id": {
                      "type": "integer",
                      "example": 12345
                    },
                    "user_id": {
                      "type": "integer",
                      "example": 67890
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.2"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/team/members/{id}": {
      "delete": {
        "summary": "remove team member",
        "description": "Removes a member from the team by revoking their team-related API keys and updating membership status.\nCannot remove the team owner.\n\nCLI Usage: vast-ai remove team-member ID\nExample: vast-ai remove team-member 12345",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "User ID of the team member to remove",
            "example": 12345
          }
        ],
        "responses": {
          "200": {
            "description": "Member removed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ],
                      "example": "success"
                    },
                    "message": {
                      "type": "string",
                      "example": "User removed from the team."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - cannot remove team owner",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Cannot remove the team owner from the team"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "unauthorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid or missing API key"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - user is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "forbidden"
                    },
                    "msg": {
                      "type": "string",
                      "example": "User is blacklisted"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Member not found or already removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "failure"
                      ],
                      "example": "failure"
                    },
                    "message": {
                      "type": "string",
                      "example": "No user was removed from the team."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "rate_limit_exceeded"
                    },
                    "msg": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/team/roles/{id}": {
      "delete": {
        "summary": "remove team role",
        "description": "Removes a role from the team. Cannot remove the team owner role.\n\nCLI Usage: vast-ai remove team-role NAME\nExample: vast-ai remove team-role developer",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Name of the role to remove",
            "example": "developer"
          }
        ],
        "responses": {
          "200": {
            "description": "Role removed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success"
                      ],
                      "example": "success"
                    },
                    "message": {
                      "type": "string",
                      "example": "Role removed from team"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - role name is required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "msg": {
                      "type": "string",
                      "example": "Role name is required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "unauthorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid or missing API key"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - cannot delete owner role or user is blacklisted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "forbidden"
                    },
                    "msg": {
                      "type": "string",
                      "example": "You cannot delete the owner role."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Role not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "not_found"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Specified role not found"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/volumes/": {
      "put": {
        "summary": "rent volume",
        "description": "Rent/create a new volume with specified parameters. CLI Usage: vastai create volume ID --size SIZE_GB",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID for the volume",
                    "example": 420
                  },
                  "size": {
                    "type": "integer",
                    "description": "Size in GB (Defaults to 15)",
                    "example": 15
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "volume_name": {
                      "type": "string",
                      "description": "Name of the created/resized volume",
                      "example": "V.20118481"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Volumes"
        ]
      },
      "get": {
        "summary": "list volumes",
        "description": "Retrieve information about all volumes rented by you. CLI Usage: vastai show volumes",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "volumes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Volume"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "Authentication credentials were not provided."
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Volumes"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/reports": {
      "get": {
        "summary": "show reports",
        "description": "Retrieves a list of the most recent reports for a given machine. Each report includes details such as the problem identified, a message describing the issue, and the timestamp when the report was created.\n\nCLI Usage: vastai reports <machine_id>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The unique identifier of the machine."
          }
        ],
        "responses": {
          "200": {
            "description": "An array of reports for the specified machine.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "problem": {
                        "type": "string",
                        "description": "The type of problem reported."
                      },
                      "message": {
                        "type": "string",
                        "description": "Detailed message describing the problem."
                      },
                      "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Timestamp when the report was created."
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Machine not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/commands/reset_apikey/": {
      "put": {
        "summary": "reset api key",
        "description": "Resets the API key for the authenticated user. This operation generates a new API key and invalidates the old one.\n\nCLI Usage: vast-ai reset api-key",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "client_id"
                ],
                "properties": {
                  "client_id": {
                    "type": "string",
                    "description": "The ID of the client whose API key is being reset.",
                    "example": "me"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sent": {
                      "type": "boolean",
                      "example": true
                    },
                    "key": {
                      "type": "string",
                      "description": "The new API key.",
                      "example": "new_api_key_value"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/route/": {
      "post": {
        "servers": [
          {
            "url": "https://run.vast.ai",
            "description": "Production server"
          }
        ],
        "summary": "route",
        "description": "Calls on the serverless engine to retrieve a GPU instance address within your endpoint for processing a request.\n\nThe engine will return either a ready worker URL or status information if no workers are available.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "endpoint",
                  "cost"
                ],
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "description": "Name of the endpoint",
                    "example": "vLLM-Qwen3-8B"
                  },
                  "cost": {
                    "type": "number",
                    "format": "float",
                    "description": "The estimated compute resources for the request",
                    "default": 100.0,
                    "example": 242.0,
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response - either worker assignment or status",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "title": "Worker Available",
                      "type": "object",
                      "properties": {
                        "endpoint": {
                          "type": "string",
                          "description": "Same as the input parameter",
                          "example": "vLLM-Qwen3-8B"
                        },
                        "url": {
                          "type": "string",
                          "description": "The address of the worker instance to send the request to",
                          "example": "http://192.168.1.10:8000"
                        },
                        "cost": {
                          "type": "number",
                          "description": "Same as the input parameter",
                          "example": 242.0
                        },
                        "reqnum": {
                          "type": "integer",
                          "description": "Request number corresponding to this worker instance",
                          "example": 12345
                        },
                        "signature": {
                          "type": "string",
                          "description": "Cryptographic signature authenticating the response",
                          "example": "a1b2c3d4e5f60708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20"
                        },
                        "__request_id": {
                          "type": "string",
                          "description": "Unique identifier generated by the server for this request",
                          "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                        }
                      }
                    },
                    {
                      "title": "No Worker Available",
                      "type": "object",
                      "properties": {
                        "endpoint": {
                          "type": "string",
                          "description": "Same as the input parameter",
                          "example": "vLLM-Qwen3-8B"
                        },
                        "status": {
                          "type": "string",
                          "description": "Breakdown of workers in your endpoint group by status",
                          "example": "Stopped"
                        },
                        "__request_id": {
                          "type": "string",
                          "description": "Unique identifier generated by the server for this request",
                          "example": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Authentication failed"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Invalid endpoint or missing required parameters"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Serverless"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/dnotify": {
      "put": {
        "summary": "schedule maint",
        "description": "Schedules a maintenance window for a specified machine and notifies clients.\n\nCLI Usage: vast-ai schedule maint {machine_id} --sdate {sdate} --duration {duration}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "description": "ID of the machine to schedule maintenance for.",
            "schema": {
              "type": "integer",
              "example": 12345
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sdate",
                  "duration"
                ],
                "properties": {
                  "sdate": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Start date and time of the maintenance window.",
                    "example": "2023-10-30T14:00:00Z"
                  },
                  "duration": {
                    "type": "integer",
                    "description": "Duration of the maintenance window in hours.",
                    "example": 2
                  },
                  "maintenance_reason": {
                    "type": "string",
                    "description": "Reason for the maintenance.",
                    "example": "Routine hardware check"
                  },
                  "maintenance_category": {
                    "type": "string",
                    "description": "Category of the maintenance.",
                    "enum": [
                      "power",
                      "internet",
                      "disk",
                      "gpu",
                      "software",
                      "other"
                    ],
                    "example": "software"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "you_sent": {
                      "type": "string",
                      "example": "2 notifications sent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/benchmarks/": {
      "get": {
        "summary": "search benchmarks",
        "description": "Retrieve benchmark data based on search parameters.\n\nCLI Usage: vast-ai search benchmarks",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search query string to filter benchmarks.",
            "example": "score>1000"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "contract_id": {
                        "type": "integer",
                        "description": "ID of instance/contract reporting benchmark"
                      },
                      "id": {
                        "type": "integer",
                        "description": "Benchmark unique ID"
                      },
                      "image": {
                        "type": "string",
                        "description": "Image used for benchmark"
                      },
                      "last_update": {
                        "type": "number",
                        "format": "float",
                        "description": "Date of benchmark"
                      },
                      "machine_id": {
                        "type": "integer",
                        "description": "ID of machine benchmarked"
                      },
                      "model": {
                        "type": "string",
                        "description": "Name of model used in benchmark"
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of benchmark"
                      },
                      "num_gpus": {
                        "type": "integer",
                        "description": "Number of GPUs used in benchmark"
                      },
                      "score": {
                        "type": "number",
                        "format": "float",
                        "description": "Benchmark score result"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/api/v0/invoices": {
      "get": {
        "summary": "search invoices",
        "description": "This endpoint allows users to search and retrieve invoices based on specified filters.\n\nCLI Usage: vast-ai search invoices",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "select_filters",
            "in": "query",
            "required": false,
            "schema": {
              "type": "object"
            },
            "description": "Filters to apply to the invoice selection."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Type of invoices to retrieve (e.g., charge)."
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "example": "charge"
                      },
                      "description": {
                        "type": "string",
                        "example": "Instance 123 GPU charge: hours * $/hr"
                      },
                      "timestamp": {
                        "type": "integer",
                        "example": 1633036800
                      },
                      "quantity": {
                        "type": "string",
                        "example": "10.000"
                      },
                      "rate": {
                        "type": "string",
                        "example": "0.1000"
                      },
                      "amount": {
                        "type": "string",
                        "example": "1.000"
                      },
                      "instance_id": {
                        "type": "integer",
                        "example": 123
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Billing"
        ]
      }
    },
    "/api/v0/network_volumes/search/": {
      "post": {
        "summary": "search network volumes",
        "description": "Search for available GPU machine offers with advanced filtering and sorting.\nCLI Usage: ``` vast search network-volumes --order=storage_cost 'reliability > 0.99 geolocation in [US, CA]'```",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "object",
                    "properties": {
                      "verified": {
                        "type": "object",
                        "description": "Display offers where all machines in cluster are verified",
                        "example": {
                          "eq": true
                        }
                      },
                      "order": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "description": "Sort fields and directions",
                        "example": [
                          [
                            "storage_cost",
                            "asc"
                          ]
                        ]
                      },
                      "limit": {
                        "type": "integer",
                        "description": "Max results to return"
                      },
                      "reliability2": {
                        "type": "object",
                        "description": "Cluster reliability score (0-1)",
                        "example": {
                          "gt": 0.98
                        }
                      },
                      "inet_down": {
                        "type": "object",
                        "description": "Download bandwidth (MB/s)",
                        "example": {
                          "gt": 100.0
                        }
                      },
                      "inet_up": {
                        "type": "object",
                        "description": "Upload bandwidth (MB/s)",
                        "example": {
                          "gt": 100.0
                        }
                      },
                      "geolocation": {
                        "type": "object",
                        "description": "Cluster location (two letter country code)",
                        "example": {
                          "in": [
                            "TW",
                            "SE"
                          ]
                        }
                      },
                      "disk_bw": {
                        "type": "object",
                        "description": "Disk read bandwidth in MB/s",
                        "example": {
                          "gt": 500
                        }
                      },
                      "duration": {
                        "type": "object",
                        "description": "Maximum rental duration in days",
                        "example": {
                          "gte": 30
                        }
                      },
                      "storage_cost": {
                        "type": "object",
                        "description": "Storage cost in $/GB/month",
                        "example": {
                          "lte": 0.1
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful search response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "ask_contract_id": {
                            "type": "integer",
                            "description": "Unique offer ID"
                          },
                          "disk_space": {
                            "type": "number",
                            "description": "Storage space in GB"
                          },
                          "inet_up": {
                            "type": "number",
                            "description": "Upload bandwidth (MB/s)"
                          },
                          "inet_down": {
                            "type": "number",
                            "description": "Download bandwidth (MB/s)"
                          },
                          "reliability2": {
                            "type": "number",
                            "description": "Cluster reliability score (0-1)"
                          },
                          "verified": {
                            "type": "boolean",
                            "description": "Cluster verification status"
                          },
                          "geolocation": {
                            "type": "string",
                            "description": "Geographic location"
                          },
                          "nw_disk_avg_bw": {
                            "type": "integer",
                            "description": "Average read bw of network disk from machines in cluster"
                          },
                          "nw_disk_max_bw": {
                            "type": "integer",
                            "description": "Max read bw of network disk from machines in cluster"
                          },
                          "nw_disk_min_bw": {
                            "type": "integer",
                            "description": "Min read bw of network disk from machines in cluster"
                          },
                          "start_date": {
                            "type": "number",
                            "description": "start date of offer, in epoch time"
                          },
                          "end_date": {
                            "type": "number",
                            "description": "end date of offer, in epoch time"
                          },
                          "storage_cost": {
                            "type": "number",
                            "description": "storage cost in $/GB/month"
                          },
                          "storage_cost_total": {
                            "type": "number",
                            "description": "total storage cost per hour for rented space"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Network Volumes"
        ]
      }
    },
    "/api/v0/search/asks/": {
      "put": {
        "summary": "search offers",
        "description": "Search for available GPU machine offers with advanced filtering and sorting.\nDefault filters applied unless --no-default: - verified: true - external: false - rentable: true - rented: false\nCLI Usage Examples: ``` vast search offers 'reliability > 0.99 num_gpus>=4' vast search offers 'gpu_name=RTX_3090' --order=dph_total vast search offers 'cuda_vers>=11.0' --no-default ```",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "select_cols": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "*"
                    ],
                    "description": "Columns to select, defaults to all"
                  },
                  "q": {
                    "type": "object",
                    "properties": {
                      "verified": {
                        "type": "object",
                        "description": "Machine verification status",
                        "example": {
                          "eq": true
                        }
                      },
                      "rentable": {
                        "type": "object",
                        "description": "Whether machine is rentable",
                        "example": {
                          "eq": true
                        }
                      },
                      "external": {
                        "type": "object",
                        "description": "External machine status",
                        "example": {
                          "eq": false
                        }
                      },
                      "rented": {
                        "type": "object",
                        "description": "Current rental status",
                        "example": {
                          "eq": false
                        }
                      },
                      "order": {
                        "type": "array",
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "description": "Sort fields and directions",
                        "example": [
                          [
                            "dph_total",
                            "asc"
                          ]
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "on-demand",
                          "bid",
                          "reserved"
                        ],
                        "description": "Contract type filter"
                      },
                      "limit": {
                        "type": "integer",
                        "description": "Max results to return"
                      },
                      "disable_bundling": {
                        "type": "boolean",
                        "description": "Disable offer bundling"
                      },
                      "allocated_storage": {
                        "type": "number",
                        "description": "Required storage in GB"
                      },
                      "reliability2": {
                        "type": "object",
                        "description": "Machine reliability score (0-1)",
                        "example": {
                          "gt": 0.98
                        }
                      },
                      "num_gpus": {
                        "type": "object",
                        "description": "Number of GPUs",
                        "example": {
                          "gte": 4
                        }
                      },
                      "gpu_name": {
                        "type": "object",
                        "description": "GPU model name",
                        "example": {
                          "eq": "RTX 3090"
                        }
                      },
                      "cuda_max_good": {
                        "type": "object",
                        "description": "Maximum CUDA version",
                        "example": {
                          "gte": 11.0
                        }
                      },
                      "gpu_ram": {
                        "type": "object",
                        "description": "GPU memory in MB",
                        "example": {
                          "gte": 24000
                        }
                      },
                      "dlperf_per_dphtotal": {
                        "type": "object",
                        "description": "DLPerf per dollar per hour",
                        "example": {
                          "gt": 50.0
                        }
                      },
                      "inet_down": {
                        "type": "object",
                        "description": "Download bandwidth (MB/s)",
                        "example": {
                          "gt": 100.0
                        }
                      },
                      "inet_up": {
                        "type": "object",
                        "description": "Upload bandwidth (MB/s)",
                        "example": {
                          "gt": 100.0
                        }
                      },
                      "direct_port_count": {
                        "type": "object",
                        "description": "Number of direct ports",
                        "example": {
                          "gt": 1
                        }
                      },
                      "geolocation": {
                        "type": "object",
                        "description": "Machine location (two letter country code)",
                        "example": {
                          "in": [
                            "TW",
                            "SE"
                          ]
                        }
                      },
                      "bw_nvlink": {
                        "type": "object",
                        "description": "Bandwidth NVLink",
                        "example": {
                          "gt": 100.0
                        }
                      },
                      "compute_cap": {
                        "type": "object",
                        "description": "CUDA compute capability*100 (650 for 6.5, 700 for 7.0)",
                        "example": {
                          "gte": 700
                        }
                      },
                      "cpu_arch": {
                        "type": "object",
                        "description": "Host machine CPU architecture (e.g. amd64, arm64)",
                        "example": {
                          "eq": "amd64"
                        }
                      },
                      "cpu_cores": {
                        "type": "object",
                        "description": "Number of virtual CPUs",
                        "example": {
                          "gte": 8
                        }
                      },
                      "cpu_ghz": {
                        "type": "object",
                        "description": "CPU clock speed in GHz",
                        "example": {
                          "gt": 3.0
                        }
                      },
                      "datacenter": {
                        "type": "object",
                        "description": "Show only datacenter offers",
                        "example": {
                          "eq": true
                        }
                      },
                      "disk_bw": {
                        "type": "object",
                        "description": "Disk read bandwidth in MB/s",
                        "example": {
                          "gt": 500
                        }
                      },
                      "dlperf": {
                        "type": "object",
                        "description": "Deep Learning performance score",
                        "example": {
                          "gt": 20.0
                        }
                      },
                      "dlperf_usd": {
                        "type": "object",
                        "description": "DLPerf per dollar",
                        "example": {
                          "gt": 10.0
                        }
                      },
                      "driver_version": {
                        "type": "object",
                        "description": "NVIDIA driver version as 3 digit string",
                        "example": {
                          "gte": "535.86.05"
                        }
                      },
                      "duration": {
                        "type": "object",
                        "description": "Maximum rental duration in days",
                        "example": {
                          "gte": 30
                        }
                      },
                      "flops_usd": {
                        "type": "object",
                        "description": "TFLOPs per dollar",
                        "example": {
                          "gt": 1.0
                        }
                      },
                      "gpu_arch": {
                        "type": "object",
                        "description": "Host machine GPU architecture (e.g. nvidia, amd)",
                        "example": {
                          "eq": "nvidia"
                        }
                      },
                      "gpu_max_power": {
                        "type": "object",
                        "description": "GPU power limit in watts",
                        "example": {
                          "lte": 300
                        }
                      },
                      "gpu_max_temp": {
                        "type": "object",
                        "description": "GPU temperature limit in Celsius",
                        "example": {
                          "lte": 85
                        }
                      },
                      "gpu_mem_bw": {
                        "type": "object",
                        "description": "GPU memory bandwidth in GB/s",
                        "example": {
                          "gt": 500
                        }
                      },
                      "gpu_total_ram": {
                        "type": "object",
                        "description": "Total GPU RAM across all GPUs in GB",
                        "example": {
                          "gte": 48
                        }
                      },
                      "gpu_frac": {
                        "type": "object",
                        "description": "Ratio of GPUs in offer to GPUs in system",
                        "example": {
                          "eq": 1.0
                        }
                      },
                      "gpu_display_active": {
                        "type": "object",
                        "description": "Whether GPU has a display attached",
                        "example": {
                          "eq": false
                        }
                      },
                      "has_avx": {
                        "type": "object",
                        "description": "CPU supports AVX instruction set",
                        "example": {
                          "eq": true
                        }
                      },
                      "pci_gen": {
                        "type": "object",
                        "description": "PCIe generation",
                        "example": {
                          "gte": 4
                        }
                      },
                      "storage_cost": {
                        "type": "object",
                        "description": "Storage cost in $/GB/month",
                        "example": {
                          "lte": 0.1
                        }
                      },
                      "static_ip": {
                        "type": "object",
                        "description": "Whether the IP address is static/stable",
                        "example": {
                          "eq": true
                        }
                      },
                      "total_flops": {
                        "type": "object",
                        "description": "Total TFLOPs from all GPUs",
                        "example": {
                          "gt": 100
                        }
                      },
                      "ubuntu_version": {
                        "type": "object",
                        "description": "Host machine Ubuntu OS version",
                        "example": {
                          "eq": "20.04"
                        }
                      },
                      "vms_enabled": {
                        "type": "object",
                        "description": "Whether the machine is a VM instance",
                        "example": {
                          "eq": false
                        }
                      },
                      "machine_id": {
                        "type": "object",
                        "description": "Filter by specific host machine ID",
                        "example": {
                          "eq": 12345
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful search response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "offers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Unique offer ID"
                          },
                          "cuda_max_good": {
                            "type": "number",
                            "description": "Maximum CUDA version"
                          },
                          "num_gpus": {
                            "type": "integer",
                            "description": "Number of GPUs"
                          },
                          "gpu_name": {
                            "type": "string",
                            "description": "GPU model name"
                          },
                          "pcie_bw": {
                            "type": "number",
                            "description": "PCIe bandwidth"
                          },
                          "cpu_cores_effective": {
                            "type": "number",
                            "description": "Available CPU cores"
                          },
                          "cpu_ram": {
                            "type": "number",
                            "description": "RAM in GB"
                          },
                          "disk_space": {
                            "type": "number",
                            "description": "Storage space in GB"
                          },
                          "dph_total": {
                            "type": "number",
                            "description": "Total dollars per hour"
                          },
                          "dlperf": {
                            "type": "number",
                            "description": "Deep learning performance score"
                          },
                          "dlperf_per_dphtotal": {
                            "type": "number",
                            "description": "DLPerf per dollar per hour"
                          },
                          "inet_up": {
                            "type": "number",
                            "description": "Upload bandwidth (MB/s)"
                          },
                          "inet_down": {
                            "type": "number",
                            "description": "Download bandwidth (MB/s)"
                          },
                          "reliability2": {
                            "type": "number",
                            "description": "Reliability score (0-1)"
                          },
                          "verified": {
                            "type": "boolean",
                            "description": "Verification status"
                          },
                          "rentable": {
                            "type": "boolean",
                            "description": "Rental availability"
                          },
                          "rented": {
                            "type": "boolean",
                            "description": "Current rental status"
                          },
                          "machine_id": {
                            "type": "integer",
                            "description": "Host machine ID"
                          },
                          "geolocation": {
                            "type": "string",
                            "description": "Geographic location"
                          },
                          "direct_port_count": {
                            "type": "integer",
                            "description": "Number of direct ports"
                          },
                          "max_bid": {
                            "type": "number",
                            "description": "Maximum bid allowed"
                          },
                          "min_bid": {
                            "type": "number",
                            "description": "Minimum bid required"
                          },
                          "bw_nvlink": {
                            "type": "number",
                            "description": "NVLink bandwidth"
                          },
                          "compute_cap": {
                            "type": "integer",
                            "description": "CUDA compute capability"
                          },
                          "cpu_arch": {
                            "type": "string",
                            "description": "CPU architecture"
                          },
                          "gpu_arch": {
                            "type": "string",
                            "description": "GPU architecture"
                          },
                          "driver_version": {
                            "type": "string",
                            "description": "NVIDIA driver version"
                          },
                          "ubuntu_version": {
                            "type": "string",
                            "description": "Ubuntu OS version"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid query parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - invalid or missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Search"
        ]
      }
    },
    "/api/v0/volumes/search/": {
      "post": {
        "summary": "search volumes",
        "description": "Search for available volumes based on specified criteria. CLI Usage: vastai search volumes <query> [OPTIONS]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "object",
              "properties": {
                "limit": {
                  "type": "integer",
                  "description": "Maximum number of results to return",
                  "default": 64,
                  "example": 100
                }
              }
            },
            "description": "Query parameters for filtering volume search results",
            "example": {
              "limit": 100
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "limit": {
                    "type": "integer",
                    "description": "Maximum number of results to return",
                    "default": 64,
                    "example": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "offers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VolumeOffer"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args",
                        "invalid_request"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid query: {query}, must be dict of conditions"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Volumes"
        ]
      }
    },
    "/api/v0/machines/create_bids/": {
      "put": {
        "summary": "set defjob",
        "description": "Creates default jobs (background instances) for a specified machine with the given parameters.\n\nCLI Usage: vast set defjob {machine_id} --price_gpu {price} --price_inetu {price} --price_inetd {price} --image {image} [--args {args}]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "machine",
                  "price_gpu",
                  "price_inetu",
                  "price_inetd",
                  "image"
                ],
                "properties": {
                  "machine": {
                    "type": "integer",
                    "description": "ID of the machine to create jobs for.",
                    "example": 12345
                  },
                  "price_gpu": {
                    "type": "number",
                    "format": "float",
                    "description": "Price per GPU per day.",
                    "example": 0.5
                  },
                  "price_inetu": {
                    "type": "number",
                    "format": "float",
                    "description": "Price for internet upload.",
                    "example": 0.1
                  },
                  "price_inetd": {
                    "type": "number",
                    "format": "float",
                    "description": "Price for internet download.",
                    "example": 0.1
                  },
                  "image": {
                    "type": "string",
                    "description": "Docker image to use for the job.",
                    "example": "vastai/tensorflow"
                  },
                  "args": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Arguments for the Docker image.",
                    "example": [
                      "--arg1",
                      "--arg2"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "machine_id": {
                      "type": "integer",
                      "example": 12345
                    },
                    "user_id": {
                      "type": "integer",
                      "example": 67890
                    },
                    "you_sent": {
                      "type": "object",
                      "description": "The original request JSON."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.8"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/minbid": {
      "put": {
        "summary": "set min-bid",
        "description": "Sets the minimum bid price for a specified machine.\n\nCLI Usage: vast set min-bid {machine_id} --price {price}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID of the machine."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "price"
                ],
                "properties": {
                  "price": {
                    "type": "number",
                    "format": "float",
                    "description": "Minimum bid price for the machine.",
                    "example": 0.5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "you_sent": {
                      "type": "object",
                      "description": "The original request JSON."
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/users/cloud_integrations/": {
      "get": {
        "summary": "show connections",
        "description": "Retrieves the list of cloud connections associated with the authenticated user.\n\nCLI Usage: vastai show connections",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "Unique identifier for the cloud connection."
                      },
                      "cloud_type": {
                        "type": "string",
                        "description": "Type of cloud service."
                      },
                      "name": {
                        "type": "string",
                        "description": "User-given name for the cloud connection."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.9"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/instances/balance/{id}/": {
      "get": {
        "summary": "show deposit",
        "description": "Retrieves the deposit details for a specified instance.\n\nCLI Usage: vast show deposit {ID}",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID of the instance."
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "refundable_deposit": {
                      "type": "number",
                      "description": "The refundable deposit amount.",
                      "example": 100.0
                    },
                    "total_discount": {
                      "type": "number",
                      "description": "The total discount applied.",
                      "example": 10.0
                    },
                    "discount_months": {
                      "type": "integer",
                      "description": "The number of months the discount applies.",
                      "example": 3
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Instance Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=3.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Billing"
        ]
      }
    },
    "/api/v0/users/{user_id}/machine-earnings/": {
      "get": {
        "summary": "show earnings",
        "description": "Retrieves the earnings history for a specified time range and optionally per machine.\n\nCLI Usage: vastai show earnings [OPTIONS]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID of the user."
          },
          {
            "name": "sday",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Start day for the earnings report."
          },
          {
            "name": "eday",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "End day for the earnings report."
          },
          {
            "name": "machid",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Optional machine ID to filter earnings."
          },
          {
            "name": "last_days",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Number of days to look back from today."
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total_gpu": {
                          "type": "number"
                        },
                        "total_stor": {
                          "type": "number"
                        },
                        "total_bwu": {
                          "type": "number"
                        },
                        "total_bwd": {
                          "type": "number"
                        }
                      }
                    },
                    "username": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "fullname": {
                      "type": "string"
                    },
                    "address1": {
                      "type": "string"
                    },
                    "address2": {
                      "type": "string"
                    },
                    "city": {
                      "type": "string"
                    },
                    "zip": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "taxinfo": {
                      "type": "string"
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "balance": {
                          "type": "number"
                        },
                        "service_fee": {
                          "type": "number"
                        },
                        "total": {
                          "type": "number"
                        },
                        "credit": {
                          "type": "number"
                        }
                      }
                    },
                    "per_machine": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "machine_id": {
                            "type": "integer"
                          },
                          "gpu_earn": {
                            "type": "number"
                          },
                          "sto_earn": {
                            "type": "number"
                          },
                          "bwu_earn": {
                            "type": "number"
                          },
                          "bwd_earn": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "per_day": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "integer"
                          },
                          "gpu_earn": {
                            "type": "number"
                          },
                          "sto_earn": {
                            "type": "number"
                          },
                          "bwu_earn": {
                            "type": "number"
                          },
                          "bwd_earn": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid input syntax",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Billing"
        ]
      }
    },
    "/api/v0/instances/{instance_id}/ssh/": {
      "get": {
        "summary": "show ssh-keys",
        "description": "Retrieves the SSH keys associated with a specific instance.",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "instance_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The ID of the instance to retrieve SSH keys for.",
            "example": 17816188
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with SSH keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "ssh_keys": {
                      "type": "string",
                      "description": "JSON string containing array of SSH key objects",
                      "example": "[{\"id\": 1, \"name\": \"my-key\", \"public_key\": \"ssh-rsa AAAA...\"}]"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid instance ID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Instance not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/instances/": {
      "get": {
        "summary": "show instances",
        "description": "Retrieve a list of instances for the authenticated user.\n\nCLI Usage: vast-ai show instances [OPTIONS] [--api-key API_KEY] [--raw]",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with user instances",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "instances": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 123
                          },
                          "start_date": {
                            "type": "number",
                            "format": "float",
                            "example": 1633036800.0
                          },
                          "duration": {
                            "type": "number",
                            "format": "float",
                            "example": 3600.0
                          },
                          "extra_env": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "example": "value"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/v0/users/{user_id}/invoices/": {
      "get": {
        "summary": "show invoices",
        "description": "This endpoint retrieves billing history reports for the authenticated user, including charges and credits.\n\nCLI Usage: vast-ai show invoices",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the user whose invoices are being retrieved.",
            "example": "me"
          },
          {
            "name": "inc_charges",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Include charge items in the report.",
            "example": true
          },
          {
            "name": "only_payouts",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Show only payout items.",
            "example": false
          },
          {
            "name": "no_payouts",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Exclude payout items.",
            "example": false
          },
          {
            "name": "sdate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Start date and time for the report.",
            "example": "2023-01-01T00:00:00Z"
          },
          {
            "name": "edate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "End date and time for the report.",
            "example": "2023-12-31T23:59:59Z"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with billing history reports",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "invoices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 123
                          },
                          "type": {
                            "type": "string",
                            "example": "payment"
                          },
                          "service": {
                            "type": "string",
                            "example": "stripe"
                          },
                          "amount": {
                            "type": "number",
                            "format": "float",
                            "example": 100.0
                          },
                          "timestamp": {
                            "type": "integer",
                            "example": 1672531199
                          }
                        }
                      }
                    },
                    "username": {
                      "type": "string",
                      "example": "user@example.com"
                    },
                    "bill_to": {
                      "type": "string",
                      "example": "John Doe\n123 Main St\nCity, ZIP\nCountry"
                    },
                    "email": {
                      "type": "string",
                      "example": "user@example.com"
                    },
                    "fullname": {
                      "type": "string",
                      "example": "John Doe"
                    },
                    "address1": {
                      "type": "string",
                      "example": "123 Main St"
                    },
                    "address2": {
                      "type": "string",
                      "example": "Apt 4B"
                    },
                    "city": {
                      "type": "string",
                      "example": "City"
                    },
                    "zip": {
                      "type": "string",
                      "example": "12345"
                    },
                    "country": {
                      "type": "string",
                      "example": "Country"
                    },
                    "taxinfo": {
                      "type": "string",
                      "example": "Tax Info"
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "charges": {
                          "type": "number",
                          "format": "float",
                          "example": 150.0
                        },
                        "service_fee": {
                          "type": "number",
                          "format": "float",
                          "example": 15.0
                        },
                        "total": {
                          "type": "number",
                          "format": "float",
                          "example": 165.0
                        },
                        "credit": {
                          "type": "number",
                          "format": "float",
                          "example": 50.0
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Billing"
        ]
      }
    },
    "/api/v0/users/{user_id}/ipaddrs/": {
      "get": {
        "summary": "show ipaddrs",
        "description": "This endpoint retrieves the history of IP address accesses for the authenticated user.\n\nCLI Usage: vast-ai show ipaddrs",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The ID of the user whose IP address history is being retrieved.",
            "example": "me"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with IP address history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 123
                          },
                          "user_id": {
                            "type": "integer",
                            "example": 456
                          },
                          "ip_address": {
                            "type": "string",
                            "example": "192.168.1.1"
                          },
                          "timestamp": {
                            "type": "string",
                            "format": "date-time",
                            "example": "2023-10-01T12:00:00Z"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.9"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/machines/": {
      "get": {
        "summary": "show machines",
        "description": "Fetches data for multiple machines associated with the authenticated user.",
        "operationId": "getMachines",
        "parameters": [
          {
            "name": "user_id",
            "in": "query",
            "required": true,
            "description": "The ID of the user whose machines are being requested.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of machines",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "machines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "The unique identifier for the machine."
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the machine."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - User authentication failed"
          },
          "429": {
            "description": "Too Many Requests - Rate limit exceeded"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/subaccounts/": {
      "get": {
        "summary": "show subaccounts",
        "description": "Retrieve a list of subaccounts associated with the authenticated user's account.\n\nCLI Usage: vast-ai show subaccounts",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "A list of subaccounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "The unique identifier of the subaccount."
                          },
                          "parent_id": {
                            "type": "integer",
                            "description": "The ID of the parent account."
                          },
                          "api_key": {
                            "type": "string",
                            "description": "The API key associated with the subaccount."
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The timestamp when the subaccount was created."
                          },
                          "deleted_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "The timestamp when the subaccount was deleted, if applicable."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized access due to invalid or missing authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.1"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/team/members/": {
      "get": {
        "summary": "show team members",
        "description": "Retrieve a list of team members associated with the authenticated user's team.\n\nCLI Usage: vastai show team-members",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "User ID",
                        "example": 123
                      },
                      "username": {
                        "type": "string",
                        "description": "Username of the team member",
                        "example": "johndoe"
                      },
                      "email": {
                        "type": "string",
                        "description": "Email of the team member",
                        "example": "johndoe@example.com"
                      },
                      "roles": {
                        "type": "array",
                        "description": "Roles assigned to the team member",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "admin",
                          "member"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/team/roles/{id}/": {
      "get": {
        "summary": "show team role",
        "description": "Retrieve details of a specific team role by its name.\n\nCLI Usage: vastai show team-role NAME",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Name of the team role",
            "schema": {
              "type": "string"
            },
            "example": "admin"
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "Role ID",
                      "example": 1
                    },
                    "name": {
                      "type": "string",
                      "description": "Name of the role",
                      "example": "admin"
                    },
                    "permissions": {
                      "type": "array",
                      "description": "Permissions associated with the role",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "read",
                        "write"
                      ]
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Role not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      },
      "put": {
        "summary": "update team role",
        "description": "Update an existing team role with new name and permissions.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the role to update.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New name for the role."
                  },
                  "permissions": {
                    "type": "object",
                    "description": "JSON encoded permissions for the role."
                  }
                },
                "required": [
                  "name",
                  "permissions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully updated team role.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "Successfully Updated Team Role For <role_name>"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing or invalid parameters."
          },
          "403": {
            "description": "Forbidden - User does not have permission to update this role."
          },
          "404": {
            "description": "Not Found - API key not found."
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/team/roles-full/": {
      "get": {
        "summary": "show team roles",
        "description": "Retrieve a list of all roles for a team, excluding the 'team_owner' role.\n\nCLI Usage: vastai show team-roles",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "Role ID",
                        "example": 1
                      },
                      "name": {
                        "type": "string",
                        "description": "Name of the role",
                        "example": "admin"
                      },
                      "permissions": {
                        "type": "array",
                        "description": "Permissions associated with the role",
                        "items": {
                          "type": "string"
                        },
                        "example": [
                          "read",
                          "write"
                        ]
                      },
                      "identifier": {
                        "type": "string",
                        "description": "Unique identifier for the role",
                        "example": "admin_role"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Team"
        ]
      }
    },
    "/api/v0/users/current/": {
      "get": {
        "summary": "show user",
        "description": "Retrieve information about the current authenticated user, excluding the API key.\n\nCLI Usage: vastai show user",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success response with user information",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "The unique identifier of the user."
                    },
                    "email": {
                      "type": "string",
                      "description": "The email address of the user."
                    },
                    "balance": {
                      "type": "number",
                      "format": "float",
                      "description": "The current balance of the user."
                    },
                    "ssh_key": {
                      "type": "string",
                      "description": "The SSH key associated with the user."
                    },
                    "sid": {
                      "type": "string",
                      "description": "Server ID."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized access due to invalid or missing authentication token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/commands/transfer_credit/": {
      "put": {
        "summary": "transfer credit",
        "description": "Transfers specified amount of credits from the authenticated user's account to another user's account.\nThe recipient can be specified by either email address or user ID.\n\nCLI Usage: vast.py transfer credit <recipient_email> <amount>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "recipient",
                  "amount"
                ],
                "properties": {
                  "recipient": {
                    "type": "string",
                    "description": "Email address or user ID of the recipient",
                    "example": "user@example.com"
                  },
                  "amount": {
                    "type": "number",
                    "format": "float",
                    "description": "Amount of credits to transfer (must be positive)",
                    "minimum": 0.01,
                    "example": 100.0
                  },
                  "client_id": {
                    "type": "string",
                    "description": "Client identifier (usually \"me\")",
                    "example": "me"
                  },
                  "apikey_id": {
                    "type": "string",
                    "description": "Optional API key identifier for audit logging"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transfer completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_args",
                        "invalid_params",
                        "invalid_recipient",
                        "insufficient_balance"
                      ]
                    },
                    "msg": {
                      "type": "string",
                      "example": "Invalid amount"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=2.5"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Accounts"
        ]
      }
    },
    "/api/v0/machines/{machine_id}/asks": {
      "delete": {
        "summary": "unlist machine",
        "description": "Removes all 'ask' type offer contracts for a specified machine, effectively unlisting it from being available for rent.\n\nCLI Usage: vastai unlist machine <id>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "machine_id",
            "in": "path",
            "required": true,
            "description": "The ID of the machine to unlist.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "machine_id": {
                      "type": "integer",
                      "example": 123
                    },
                    "user_id": {
                      "type": "integer",
                      "example": 456
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=1.8"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Machines"
        ]
      }
    },
    "/api/v0/network_volume/unlist": {
      "post": {
        "summary": "unlist network-volume",
        "description": "Unlists a network volume for rent\nCLI Usage: vast unlist network-volume <offer_id>",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of network volume ask being unlisted"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "integer",
                      "description": "id of unlisted network volume ask"
                    },
                    "msg": {
                      "type": "string",
                      "description": "status message"
                    }
                  },
                  "example": {
                    "success": true,
                    "id": 6,
                    "msg": "Deleted network volume listing"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "invalid_args"
                    },
                    "msg": {
                      "type": "string",
                      "example": "You must pass in `id` in the body of the request"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "not_authorized"
                    },
                    "msg": {
                      "type": "string",
                      "example": "Authorization Error. Check that you have proper privileges to perform this action."
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Network Volumes"
        ]
      }
    },
    "/api/v0/volumes/unlist": {
      "post": {
        "summary": "unlist volume",
        "description": "Remove a volume listing from the marketplace. CLI Usage: vastai unlist volume VOLUME_ID",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "ID of the volume listing to unlist",
                    "example": 2029
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "msg": {
                      "type": "string",
                      "description": "Success message",
                      "example": "Unlisted Volume 2029."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "msg": {
                      "type": "string",
                      "enum": [
                        "You must pass in `id` in the body of the request",
                        "Volume listing does not exist",
                        "Unable to delete active volume listing",
                        "Unable to delete volume listing."
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "detail": {
                      "type": "string",
                      "example": "API requests too frequent endpoint threshold=5.0"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Volumes"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key authentication"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key",
        "description": "API key must be provided as a query parameter"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          },
          "msg": {
            "type": "string"
          }
        }
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "msg": {
            "type": "string",
            "example": "Operation completed successfully"
          }
        }
      },
      "SimpleBooleanSuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Template ID"
          },
          "name": {
            "type": "string",
            "description": "Template name"
          },
          "image": {
            "type": "string",
            "description": "Docker image name"
          }
        }
      },
      "VolumeOffer": {
        "type": "object",
        "properties": {
          "ask_contract_id": {
            "type": "integer",
            "description": "Contract ID for the ask"
          },
          "bundle_id": {
            "type": "integer",
            "description": "Bundle ID"
          },
          "cpu_arch": {
            "type": "string",
            "description": "CPU architecture",
            "example": "amd64"
          },
          "cpu_ghz": {
            "type": "number",
            "description": "CPU clock speed in GHz"
          },
          "cpu_name": {
            "type": "string",
            "description": "CPU model name",
            "example": "AMD EPYC 7K62 48-Core Processor"
          },
          "cuda_max_good": {
            "type": "number",
            "description": "Maximum CUDA version supported",
            "example": 12.8
          },
          "disk_bw": {
            "type": "number",
            "description": "Disk bandwidth"
          },
          "disk_name": {
            "type": "string",
            "description": "Disk model name",
            "example": "FIKWOT FN955 4TB"
          },
          "disk_space": {
            "type": "number",
            "description": "Available disk space in GB",
            "example": 10.0
          },
          "driver_vers": {
            "type": "string",
            "description": "Driver version (deprecated)"
          },
          "driver_version": {
            "type": "string",
            "description": "NVIDIA driver version",
            "example": "570.124.04"
          },
          "duration": {
            "type": "number",
            "description": "Duration of the contract"
          },
          "end_date": {
            "type": "number",
            "description": "End date as Unix timestamp"
          },
          "external": {
            "type": "boolean",
            "description": "Whether the volume is external"
          },
          "geolocation": {
            "type": "string",
            "description": "Geographic location"
          },
          "geolocode": {
            "type": "string",
            "description": "Geographic location code"
          },
          "gpu_arch": {
            "type": "string",
            "description": "GPU architecture"
          },
          "host_id": {
            "type": "integer",
            "description": "Host ID",
            "example": 166946
          },
          "id": {
            "type": "integer",
            "description": "Unique identifier for the volume offer"
          },
          "inet_down": {
            "type": "number",
            "description": "Download internet speed in Mbps",
            "example": 654.6
          },
          "inet_up": {
            "type": "number",
            "description": "Upload internet speed in Mbps",
            "example": 78.9
          },
          "machine_id": {
            "type": "integer",
            "description": "Machine ID",
            "example": 36683
          },
          "mobo_name": {
            "type": "string",
            "description": "Motherboard model name",
            "example": "ROME2D32GM-2T"
          },
          "reliability": {
            "type": "number",
            "description": "Reliability score"
          },
          "reliability2": {
            "type": "number",
            "description": "Alternative reliability score",
            "example": 0.9649497
          },
          "reliability_mult": {
            "type": "number",
            "description": "Reliability multiplier"
          },
          "start_date": {
            "type": "number",
            "description": "Start date as Unix timestamp",
            "example": 1747341046.4320989
          },
          "static_ip": {
            "type": "boolean",
            "description": "Whether the machine has a static IP",
            "example": true
          },
          "storage_cost": {
            "type": "number",
            "description": "Storage cost"
          },
          "storage_total_cost": {
            "type": "number",
            "description": "Total storage cost",
            "example": 0.0005555555555555557
          },
          "vericode": {
            "type": "string",
            "description": "Verification code"
          },
          "verification": {
            "type": "string",
            "description": "Verification status",
            "example": "verified"
          },
          "vms_enabled": {
            "type": "boolean",
            "description": "Whether VMs are enabled"
          }
        }
      },
      "Instance": {
        "type": "object",
        "description": "Detailed information about an instance.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 123,
            "description": "Unique identifier for the instance."
          },
          "ssh_idx": {
            "type": "string",
            "example": "ssh1",
            "description": "Identifier for the SSH forwarder used."
          },
          "ssh_host": {
            "type": "string",
            "nullable": true,
            "example": "192.168.1.10",
            "description": "Host (or IP) used for SSH connection."
          },
          "ssh_port": {
            "type": "integer",
            "nullable": true,
            "example": 22,
            "description": "Port used for SSH connection."
          },
          "actual_status": {
            "type": "string",
            "enum": [
              "running",
              "stopped",
              "frozen",
              "loading",
              "unknown",
              "offline",
              "rebooting",
              "recycling"
            ],
            "example": "running",
            "description": "Current status of the instance container."
          },
          "intended_status": {
            "type": "string",
            "enum": [
              "running",
              "stopped",
              "frozen"
            ],
            "example": "running",
            "description": "Intended status of the instance container."
          },
          "cur_state": {
            "type": "string",
            "enum": [
              "running",
              "stopped",
              "unloaded"
            ],
            "example": "running",
            "description": "Current state of the machine contract."
          },
          "next_state": {
            "type": "string",
            "enum": [
              "running",
              "stopped",
              "unloaded"
            ],
            "example": "running",
            "description": "Next scheduled state for the machine contract."
          },
          "template_id": {
            "type": "integer",
            "example": 45,
            "description": "Identifier for the instance template."
          },
          "template_hash_id": {
            "type": "string",
            "example": "abc123",
            "description": "Hash identifier for the instance template."
          },
          "image_uuid": {
            "type": "string",
            "example": "uuid-1234",
            "description": "Unique identifier for the instance image."
          },
          "image_args": {
            "type": "string",
            "example": "--arg1 value",
            "description": "Arguments used when launching the instance image."
          },
          "image_runtype": {
            "type": "string",
            "enum": [
              "ssh",
              "args"
            ],
            "example": "ssh",
            "description": "How the instance image is executed."
          },
          "extra_env": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "VAR1=value1",
              "VAR2=value2"
            ],
            "description": "Additional environment variables."
          },
          "onstart": {
            "type": "string",
            "example": "init.sh",
            "description": "Script or command executed when the instance starts."
          },
          "label": {
            "type": "string",
            "example": "Instance 123",
            "description": "A human-readable label for the instance."
          },
          "jupyter_token": {
            "type": "string",
            "example": "token123",
            "description": "Jupyter token if the instance provides a Jupyter environment."
          },
          "status_msg": {
            "type": "string",
            "example": "Running normally",
            "description": "A message describing the current status."
          },
          "gpu_util": {
            "type": "number",
            "format": "float",
            "example": 0.75,
            "description": "Current GPU utilization as a fraction."
          },
          "gpu_arch": {
            "type": "string",
            "example": "Volta",
            "description": "GPU architecture of the instance."
          },
          "disk_util": {
            "type": "number",
            "format": "float",
            "example": 75,
            "description": "Disk utilization percentage."
          },
          "disk_usage": {
            "type": "number",
            "format": "float",
            "example": 75,
            "description": "Disk usage percentage."
          },
          "gpu_temp": {
            "type": "number",
            "format": "float",
            "example": 65,
            "description": "Current GPU temperature in Celsius."
          },
          "cuda_max_good": {
            "type": "number",
            "format": "float",
            "example": 11.2,
            "description": "Maximum CUDA version that is considered optimal."
          },
          "driver_version": {
            "type": "string",
            "example": "460.32.03",
            "description": "Version of the GPU driver installed."
          },
          "public_ipaddr": {
            "type": "string",
            "example": "203.0.113.1",
            "description": "Public IP address of the instance."
          },
          "local_ipaddrs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "192.168.1.5"
            ],
            "description": "List of local IP addresses for the instance."
          },
          "direct_port_end": {
            "type": "integer",
            "example": 8001,
            "description": "The ending port number for direct connections."
          },
          "direct_port_start": {
            "type": "integer",
            "example": 8000,
            "description": "The starting port number for direct connections."
          },
          "cpu_util": {
            "type": "number",
            "format": "float",
            "example": 0.65,
            "description": "CPU utilization as a fraction."
          },
          "mem_usage": {
            "type": "number",
            "format": "float",
            "example": 4096,
            "description": "Memory usage in megabytes."
          },
          "mem_limit": {
            "type": "number",
            "format": "float",
            "example": 8192,
            "description": "Memory limit in megabytes."
          },
          "vmem_usage": {
            "type": "number",
            "format": "float",
            "example": 4096,
            "description": "Virtual memory usage in megabytes."
          },
          "machine_dir_ssh_port": {
            "type": "integer",
            "example": 2222,
            "description": "Calculated SSH port for accessing the machine directory."
          },
          "uptime_mins": {
            "type": "number",
            "format": "float",
            "example": 120,
            "description": "Uptime of the instance in minutes."
          },
          "ports": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "example": [
              8080,
              8081
            ],
            "description": "List of additional ports exposed by the instance."
          }
        }
      },
      "Volume": {
        "type": "object",
        "properties": {
          "instances": {
            "type": "array",
            "description": "List of instances using this volume",
            "items": {
              "type": "object"
            }
          },
          "driver_version": {
            "type": "string",
            "description": "NVIDIA driver version"
          },
          "cuda_max_good": {
            "type": "number",
            "description": "Maximum CUDA version supported"
          },
          "machine_id": {
            "type": "integer",
            "description": "Unique identifier for the machine"
          },
          "public_ipaddr": {
            "type": "string",
            "description": "Public IP address"
          },
          "reliability2": {
            "type": "number",
            "description": "Reliability score of the host"
          },
          "host_id": {
            "type": "integer",
            "description": "Unique identifier for the host"
          },
          "cpu_name": {
            "type": "string",
            "description": "Name/model of the CPU"
          },
          "mobo_name": {
            "type": "string",
            "description": "Name/model of the motherboard"
          },
          "disk_space": {
            "type": "number",
            "description": "Disk space in GB"
          },
          "disk_name": {
            "type": "string",
            "description": "Name/model of the disk"
          },
          "inet_up": {
            "type": "number",
            "description": "Upload internet speed in Mbps"
          },
          "inet_down": {
            "type": "number",
            "description": "Download internet speed in Mbps"
          },
          "storage_total_cost": {
            "type": "number",
            "description": "Total cost for storage"
          },
          "os_version": {
            "type": "string",
            "description": "Operating system version"
          },
          "verification": {
            "type": "string",
            "description": "Verification status"
          },
          "static_ip": {
            "type": "boolean",
            "description": "Whether the machine has a static IP"
          },
          "cpu_arch": {
            "type": "string",
            "description": "CPU architecture"
          },
          "start_date": {
            "type": "number",
            "description": "Start date as Unix timestamp"
          },
          "id": {
            "type": "integer",
            "description": "Unique identifier for the volume"
          },
          "status": {
            "type": "string",
            "description": "Current status of the volume"
          }
        }
      }
    }
  }
}