{
  "openapi": "3.0.3",
  "info": {
    "title": "VyskGrid API",
    "version": "0.1.0"
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {}
  },
  "paths": {
    "/v1/auth/register": {
      "post": {
        "summary": "Create an account. Always answers 202 so registered emails are not revealed.",
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "maxLength": 254
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 128
                  },
                  "roles": {
                    "default": [
                      "tenant"
                    ],
                    "minItems": 1,
                    "maxItems": 2,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "host",
                        "tenant"
                      ]
                    }
                  },
                  "acceptTerms": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "acceptHostAgreement": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "email",
                  "password",
                  "acceptTerms"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/verify-email": {
      "post": {
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 200
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "maxLength": 254
                  },
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "totpCode": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    },
                    "expiresIn": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "accessToken",
                    "refreshToken",
                    "expiresIn"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/refresh": {
      "post": {
        "summary": "Rotate a refresh token.",
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refreshToken": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 200
                  }
                },
                "required": [
                  "refreshToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    },
                    "expiresIn": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "accessToken",
                    "refreshToken",
                    "expiresIn"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refreshToken": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 200
                  }
                },
                "required": [
                  "refreshToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/password-reset/request": {
      "post": {
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "maxLength": 254
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/password-reset/confirm": {
      "post": {
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 200
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 128
                  }
                },
                "required": [
                  "token",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "twoFactorEnabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "roles",
                    "twoFactorEnabled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/2fa/enroll": {
      "post": {
        "summary": "Admins only. Start TOTP enrolment.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "secret": {
                      "type": "string"
                    },
                    "otpauthUri": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "secret",
                    "otpauthUri"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/2fa/confirm": {
      "post": {
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^\\d{6}$"
                  }
                },
                "required": [
                  "code"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/host/enrolment-tokens": {
      "post": {
        "summary": "Create a single-use, 15-minute enrolment token. Shown once; only its hash is stored.",
        "tags": [
          "host"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "token",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/host/nodes": {
      "get": {
        "tags": [
          "host"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "agentVersion": {
                        "nullable": true,
                        "type": "string"
                      },
                      "lastHeartbeatAt": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "status",
                      "agentVersion",
                      "lastHeartbeatAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs": {
      "post": {
        "tags": [
          "jobs"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template": {
                    "type": "string",
                    "enum": [
                      "hello",
                      "canary-hash",
                      "gpu-bench",
                      "transcode",
                      "inference",
                      "render"
                    ]
                  },
                  "params": {
                    "default": {},
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "maxPriceMinor": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000000
                  },
                  "maxRuntimeSeconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 86400
                  }
                },
                "required": [
                  "template",
                  "maxPriceMinor",
                  "maxRuntimeSeconds"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "template": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "leased",
                        "running",
                        "succeeded",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "maxPriceMinor": {
                      "type": "number"
                    },
                    "maxRuntimeSeconds": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "template",
                    "status",
                    "maxPriceMinor",
                    "maxRuntimeSeconds",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "template": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "queued",
                          "leased",
                          "running",
                          "succeeded",
                          "failed",
                          "cancelled"
                        ]
                      },
                      "maxPriceMinor": {
                        "type": "number"
                      },
                      "maxRuntimeSeconds": {
                        "type": "number"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "template",
                      "status",
                      "maxPriceMinor",
                      "maxRuntimeSeconds",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "tags": [
          "jobs"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "template": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "leased",
                        "running",
                        "succeeded",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "maxPriceMinor": {
                      "type": "number"
                    },
                    "maxRuntimeSeconds": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "template",
                    "status",
                    "maxPriceMinor",
                    "maxRuntimeSeconds",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}/result": {
      "get": {
        "tags": [
          "jobs"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "outcome": {
                      "type": "string"
                    },
                    "stdout": {
                      "type": "string"
                    },
                    "resultSha256": {
                      "type": "string"
                    },
                    "runtimeMs": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "outcome",
                    "stdout",
                    "resultSha256",
                    "runtimeMs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{id}/cancel": {
      "post": {
        "tags": [
          "jobs"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "template": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "leased",
                        "running",
                        "succeeded",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "maxPriceMinor": {
                      "type": "number"
                    },
                    "maxRuntimeSeconds": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "template",
                    "status",
                    "maxPriceMinor",
                    "maxRuntimeSeconds",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-keys": {
      "post": {
        "summary": "Create an API key for the jobs API. The key is shown once and cannot be retrieved later.",
        "tags": [
          "api-keys"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "lastUsedAt": {
                      "nullable": true,
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "prefix",
                    "createdAt",
                    "lastUsedAt",
                    "key"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "prefix": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "lastUsedAt": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "prefix",
                      "createdAt",
                      "lastUsedAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-keys/{id}": {
      "delete": {
        "tags": [
          "api-keys"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/balance": {
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "test",
                        "live"
                      ]
                    },
                    "note": {
                      "type": "string"
                    },
                    "balanceMinor": {
                      "type": "number"
                    },
                    "heldMinor": {
                      "type": "number"
                    },
                    "availableMinor": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "mode",
                    "note",
                    "balanceMinor",
                    "heldMinor",
                    "availableMinor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/test-topup": {
      "post": {
        "summary": "Add fake test-mode credit to your wallet. No real money.",
        "tags": [
          "billing"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amountMinor": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000
                  }
                },
                "required": [
                  "amountMinor"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balanceMinor": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "balanceMinor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/usage": {
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "jobId": {
                        "type": "string"
                      },
                      "runtimeMs": {
                        "type": "number"
                      },
                      "ratePerMinuteMinor": {
                        "type": "number"
                      },
                      "costMinor": {
                        "type": "number"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "jobId",
                      "runtimeMs",
                      "ratePerMinuteMinor",
                      "costMinor",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/invoices": {
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "number": {
                        "type": "string"
                      },
                      "totalMinor": {
                        "type": "number"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "note": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "number",
                      "totalMinor",
                      "currency",
                      "status",
                      "note",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/host/earnings": {
      "get": {
        "tags": [
          "host"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "note": {
                      "type": "string"
                    },
                    "holdDays": {
                      "type": "number"
                    },
                    "minPayoutMinor": {
                      "type": "number"
                    },
                    "pendingMinor": {
                      "type": "number"
                    },
                    "availableMinor": {
                      "type": "number"
                    },
                    "simulatedPaidMinor": {
                      "type": "number"
                    },
                    "paidMinor": {
                      "type": "number"
                    },
                    "processingMinor": {
                      "type": "number"
                    },
                    "recent": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "jobId": {
                            "type": "string"
                          },
                          "shareMinor": {
                            "type": "number"
                          },
                          "runtimeMs": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "jobId",
                          "shareMinor",
                          "runtimeMs",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "note",
                    "holdDays",
                    "minPayoutMinor",
                    "pendingMinor",
                    "availableMinor",
                    "simulatedPaidMinor",
                    "paidMinor",
                    "processingMinor",
                    "recent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/host/payouts": {
      "post": {
        "summary": "Request a payout from your available balance (simulated in test mode).",
        "tags": [
          "host"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amountMinor": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000000
                  }
                },
                "required": [
                  "amountMinor"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "amountMinor": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string"
                    },
                    "simulated": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "amountMinor",
                    "status",
                    "simulated",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "host"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "amountMinor": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "simulated": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "amountMinor",
                      "status",
                      "simulated",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/providers": {
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "test",
                        "live"
                      ]
                    },
                    "providers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "razorpay",
                          "stripe"
                        ]
                      }
                    },
                    "minTopupMinor": {
                      "type": "number"
                    },
                    "maxTopupMinor": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "mode",
                    "providers",
                    "minTopupMinor",
                    "maxTopupMinor"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "summary": "Start adding money to your wallet. Returns a payment page to open.",
        "tags": [
          "billing"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "razorpay",
                      "stripe"
                    ]
                  },
                  "amountMinor": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "provider",
                  "amountMinor"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orderId": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "orderId",
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/payments": {
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string"
                      },
                      "amountMinor": {
                        "type": "number"
                      },
                      "status": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "paidAt": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "provider",
                      "amountMinor",
                      "status",
                      "createdAt",
                      "paidAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/host/payout-profile": {
      "put": {
        "summary": "Where and to whom you are paid. PAN is needed for live payouts.",
        "tags": [
          "host"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "legalName": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "pan": {
                    "type": "string",
                    "pattern": "^[A-Z]{5}[0-9]{4}[A-Z]$"
                  },
                  "upiVpa": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9.\\-_]{2,64}@[a-zA-Z]{2,32}$"
                  },
                  "bankAccount": {
                    "type": "string",
                    "pattern": "^\\d{6,20}$"
                  },
                  "bankIfsc": {
                    "type": "string",
                    "pattern": "^[A-Z]{4}0[A-Z0-9]{6}$"
                  }
                },
                "required": [
                  "legalName",
                  "pan"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "legalName": {
                      "type": "string"
                    },
                    "panMasked": {
                      "type": "string"
                    },
                    "upiVpa": {
                      "nullable": true,
                      "type": "string"
                    },
                    "bankAccountMasked": {
                      "nullable": true,
                      "type": "string"
                    },
                    "bankIfsc": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "legalName",
                    "panMasked",
                    "upiVpa",
                    "bankAccountMasked",
                    "bankIfsc"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "host"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "type": "object",
                  "properties": {
                    "legalName": {
                      "type": "string"
                    },
                    "panMasked": {
                      "type": "string"
                    },
                    "upiVpa": {
                      "nullable": true,
                      "type": "string"
                    },
                    "bankAccountMasked": {
                      "nullable": true,
                      "type": "string"
                    },
                    "bankIfsc": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "legalName",
                    "panMasked",
                    "upiVpa",
                    "bankAccountMasked",
                    "bankIfsc"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/profile": {
      "put": {
        "summary": "Name, address, state and GSTIN printed on your GST documents.",
        "tags": [
          "billing"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "legalName": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 160
                  },
                  "address": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 400
                  },
                  "country": {
                    "default": "IN",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "gstin": {
                    "type": "string",
                    "pattern": "^\\d{2}[A-Z]{5}\\d{4}[A-Z][1-9A-Z]Z[0-9A-Z]$"
                  },
                  "stateCode": {
                    "type": "string",
                    "pattern": "^\\d{2}$"
                  }
                },
                "required": [
                  "legalName",
                  "address"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "legalName": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "gstin": {
                      "nullable": true,
                      "type": "string"
                    },
                    "stateCode": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "legalName",
                    "address",
                    "country",
                    "gstin",
                    "stateCode"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "nullable": true,
                  "type": "object",
                  "properties": {
                    "legalName": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "gstin": {
                      "nullable": true,
                      "type": "string"
                    },
                    "stateCode": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "legalName",
                    "address",
                    "country",
                    "gstin",
                    "stateCode"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/documents": {
      "get": {
        "tags": [
          "billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "number": {
                        "type": "string"
                      },
                      "docType": {
                        "type": "string",
                        "enum": [
                          "receipt_voucher",
                          "tax_invoice"
                        ]
                      },
                      "issueDate": {
                        "type": "string"
                      },
                      "supplyKind": {
                        "type": "string"
                      },
                      "sac": {
                        "type": "string"
                      },
                      "rateBp": {
                        "type": "number"
                      },
                      "taxableMinor": {
                        "type": "number"
                      },
                      "cgstMinor": {
                        "type": "number"
                      },
                      "sgstMinor": {
                        "type": "number"
                      },
                      "igstMinor": {
                        "type": "number"
                      },
                      "totalMinor": {
                        "type": "number"
                      },
                      "seller": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "buyer": {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "required": [
                      "id",
                      "number",
                      "docType",
                      "issueDate",
                      "supplyKind",
                      "sac",
                      "rateBp",
                      "taxableMinor",
                      "cgstMinor",
                      "sgstMinor",
                      "igstMinor",
                      "totalMinor",
                      "seller",
                      "buyer"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/documents/{id}": {
      "get": {
        "tags": [
          "billing"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "in": "path",
            "name": "id",
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "number": {
                      "type": "string"
                    },
                    "docType": {
                      "type": "string",
                      "enum": [
                        "receipt_voucher",
                        "tax_invoice"
                      ]
                    },
                    "issueDate": {
                      "type": "string"
                    },
                    "supplyKind": {
                      "type": "string"
                    },
                    "sac": {
                      "type": "string"
                    },
                    "rateBp": {
                      "type": "number"
                    },
                    "taxableMinor": {
                      "type": "number"
                    },
                    "cgstMinor": {
                      "type": "number"
                    },
                    "sgstMinor": {
                      "type": "number"
                    },
                    "igstMinor": {
                      "type": "number"
                    },
                    "totalMinor": {
                      "type": "number"
                    },
                    "seller": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "buyer": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "id",
                    "number",
                    "docType",
                    "issueDate",
                    "supplyKind",
                    "sac",
                    "rateBp",
                    "taxableMinor",
                    "cgstMinor",
                    "sgstMinor",
                    "igstMinor",
                    "totalMinor",
                    "seller",
                    "buyer"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/abuse-reports": {
      "post": {
        "tags": [
          "abuse"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "targetType": {
                    "type": "string",
                    "enum": [
                      "job",
                      "node",
                      "user"
                    ]
                  },
                  "targetId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "illegal_content",
                      "malware",
                      "network_abuse",
                      "payment_fraud",
                      "host_misbehaviour",
                      "other"
                    ]
                  },
                  "details": {
                    "default": "",
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "targetType",
                  "targetId",
                  "reason"
                ]
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/ws-tickets": {
      "post": {
        "tags": [
          "realtime"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ticket": {
                      "type": "string"
                    },
                    "expiresInSeconds": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "ticket",
                    "expiresInSeconds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://grid.vyskatech.com"
    }
  ]
}