{
  "openapi": "3.1.0",
  "info": {
    "title": "Oiy AI Control API",
    "version": "developer-preview",
    "description": "Account-facing Oiy AI API. Generated from shared request contracts and reviewed route metadata. Preview availability depends on the deployed control plane and connected runtime. Administrative, supplier, and internal callback endpoints are intentionally excluded."
  },
  "servers": [
    {
      "url": "https://oiy-ai-server.xsun.workers.dev",
      "description": "Current Oiy control-plane origin"
    }
  ],
  "security": [
    {
      "ApiKey": []
    },
    {
      "FirebaseIdToken": []
    }
  ],
  "tags": [
    {
      "name": "Catalog"
    },
    {
      "name": "Images"
    },
    {
      "name": "Account"
    },
    {
      "name": "Services"
    },
    {
      "name": "Storage"
    },
    {
      "name": "Templates"
    },
    {
      "name": "Activity"
    },
    {
      "name": "Diagnostics"
    },
    {
      "name": "Billing"
    }
  ],
  "paths": {
    "/api/catalog": {
      "get": {
        "operationId": "getCatalog",
        "tags": [
          "Catalog"
        ],
        "summary": "Read available product configurations",
        "description": "Public configuration catalog. Live capacity and successful allocation remain separate. No supplier credentials are returned.",
        "security": [],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "regions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Region"
                      }
                    },
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    },
                    "gpuCatalog": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "model": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "memoryGb": {
                            "type": "array",
                            "items": {
                              "type": "number"
                            }
                          },
                          "fullMemoryGb": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "model",
                          "name",
                          "memoryGb",
                          "fullMemoryGb"
                        ]
                      }
                    },
                    "currency": {
                      "const": "USD"
                    },
                    "browserEnabled": {
                      "type": "boolean"
                    },
                    "payment": {
                      "type": "object",
                      "properties": {
                        "provider": {
                          "const": "stripe"
                        },
                        "status": {
                          "enum": [
                            "enabled",
                            "disabled"
                          ]
                        },
                        "mode": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "provider",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "regions",
                    "templates",
                    "gpuCatalog",
                    "currency",
                    "browserEnabled",
                    "payment"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/registries": {
      "get": {
        "operationId": "listImageRegistries",
        "tags": [
          "Images"
        ],
        "summary": "Read image-pull access metadata",
        "description": "Account-owned repository access and linked services. Usernames and passwords are never returned.",
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "registries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ImageRegistry"
                      }
                    }
                  },
                  "required": [
                    "registries"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createImageRegistry",
        "tags": [
          "Images"
        ],
        "summary": "Save private repository pull access",
        "description": "Verified email required. Stores access for one exact fully qualified repository; up to 20 distinct repositories per account. Services select matching access automatically. Requires updated control plane and gateway support.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistryCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryMetadata"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/registries/{id}": {
      "put": {
        "operationId": "rotateImageRegistry",
        "tags": [
          "Images"
        ],
        "summary": "Rotate image-pull credentials",
        "description": "Verified email and current revision required. Supply a complete spec with the unchanged repository. Rotation affects future launches; admitted operations retain their captured version.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "spec": {
                    "$ref": "#/components/schemas/RegistryCreate"
                  }
                },
                "required": [
                  "revision",
                  "spec"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryMetadata"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteImageRegistry",
        "tags": [
          "Images"
        ],
        "summary": "Remove repository access",
        "description": "Current revision required. All linked services must be confirmed sleeping with no allocation. Images and workspace files are retained. A bound service cannot silently fall back to anonymous pulls after removal.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "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)$"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/me": {
      "get": {
        "operationId": "getIdentity",
        "tags": [
          "Account"
        ],
        "summary": "Read the authenticated identity",
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Identity"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/account": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Account"
        ],
        "summary": "Read balance, resources, and recent ledger",
        "description": "Services and volumes exclude deleted records. Ledger contains up to the 100 most recent entries; use the billing summary and ledger endpoints for full-window history.",
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balanceMicros": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991,
                      "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                    },
                    "currency": {
                      "const": "USD"
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Service"
                      }
                    },
                    "volumes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Volume"
                      }
                    },
                    "ledger": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LedgerEntry"
                      }
                    }
                  },
                  "required": [
                    "balanceMicros",
                    "currency",
                    "services",
                    "volumes",
                    "ledger"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services": {
      "post": {
        "operationId": "createService",
        "tags": [
          "Services"
        ],
        "summary": "Create a container service",
        "description": "Verified email, funds, matching capacity and configured pricing are required. Returns a bare Service object with asynchronous lifecycle state. May incur compute and storage charges.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Service"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}": {
      "get": {
        "operationId": "getService",
        "tags": [
          "Services"
        ],
        "summary": "Read a service",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "$ref": "#/components/schemas/Service"
                    }
                  },
                  "required": [
                    "service"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateService",
        "tags": [
          "Services"
        ],
        "summary": "Update service configuration",
        "description": "Verified account. Use the current revision. Environment is a complete replacement when present. Updates may restart processes.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "patch": {
                    "$ref": "#/components/schemas/ServicePatch"
                  }
                },
                "required": [
                  "revision",
                  "patch"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Service"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/actions": {
      "post": {
        "operationId": "serviceAction",
        "tags": [
          "Services"
        ],
        "summary": "Start, stop, restart, resize, or delete",
        "description": "Start, restart, and resize require verified email and admission checks. Restart replaces allocated running/error compute with the same configuration and volume; paused services use start. Only resize may contain resources. Delete destroys service-owned storage but retains independent volumes. All actions return the updated Service, not an operation wrapper.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Service"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/sleep": {
      "patch": {
        "operationId": "updateSleepPolicy",
        "tags": [
          "Services"
        ],
        "summary": "Set idle sleep policy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sleepAfterMinutes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "sleepAfterMinutes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Service"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/events": {
      "get": {
        "operationId": "getEvents",
        "tags": [
          "Diagnostics"
        ],
        "summary": "Read recent lifecycle events",
        "description": "Up to 100 events, newest first. created_at is Unix milliseconds.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Unix timestamp in milliseconds."
                          }
                        },
                        "required": [
                          "message",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "events"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/logs": {
      "get": {
        "operationId": "getLogs",
        "tags": [
          "Diagnostics"
        ],
        "summary": "Read container logs",
        "description": "Requires the regional runtime. Response is plain text.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Container log output.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/exec": {
      "post": {
        "operationId": "executeCommand",
        "tags": [
          "Diagnostics"
        ],
        "summary": "Run a bounded diagnostic command",
        "description": "Running service required. Not a long-running job scheduler. If the response is uncertain, inspect logs and state before replaying a command with side effects.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192
                  }
                },
                "required": [
                  "command"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "output": {
                      "type": "string",
                      "maxLength": 131072
                    },
                    "exitCode": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "output",
                    "exitCode",
                    "truncated"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/metrics": {
      "get": {
        "operationId": "getMetrics",
        "tags": [
          "Diagnostics"
        ],
        "summary": "Read resource monitoring",
        "description": "Implemented in current preview source. Data requires a deployment with monitoring collectors configured. Does not wake a service or refresh its idle timer. null is unavailable, never an invented zero.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "in": "query",
            "name": "minutes",
            "schema": {
              "type": "integer",
              "enum": [
                15,
                60,
                360
              ],
              "default": 60
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsHistory"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/activity": {
      "get": {
        "operationId": "getActivity",
        "tags": [
          "Activity"
        ],
        "summary": "Read task and connection activity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "activities": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Activity"
                      }
                    }
                  },
                  "required": [
                    "activities"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "trackActivity",
        "tags": [
          "Activity"
        ],
        "summary": "Register, heartbeat, or release a task",
        "description": "Reuse an activity UUID for heartbeats and release. Expired task leases remain protective until explicitly released or allocation release is confirmed.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "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)$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "release": {
                    "default": false,
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "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)$"
                    },
                    "heartbeatSeconds": {
                      "type": "number",
                      "const": 30
                    },
                    "expiresInSeconds": {
                      "type": "number",
                      "const": 300
                    }
                  },
                  "required": [
                    "id",
                    "heartbeatSeconds",
                    "expiresInSeconds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/services/{id}/browser-session": {
      "post": {
        "operationId": "createBrowserSession",
        "tags": [
          "Services"
        ],
        "summary": "Create a short-lived browser launch URL",
        "description": "Requires a verified account and enabled browser-access capability. The URL is sensitive and should not be logged or shared.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/volumes": {
      "get": {
        "operationId": "listVolumes",
        "tags": [
          "Storage"
        ],
        "summary": "List retained volumes",
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "volumes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Volume"
                      }
                    }
                  },
                  "required": [
                    "volumes"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createVolume",
        "tags": [
          "Storage"
        ],
        "summary": "Create independent storage",
        "description": "Verified account and adequate funds required. Does not launch compute. Backing allocation and billing are asynchronous.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VolumeCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volume"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/volumes/{id}": {
      "get": {
        "operationId": "getVolume",
        "tags": [
          "Storage"
        ],
        "summary": "Read a volume",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "volume": {
                      "$ref": "#/components/schemas/Volume"
                    }
                  },
                  "required": [
                    "volume"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateVolume",
        "tags": [
          "Storage"
        ],
        "summary": "Rename or expand a volume",
        "description": "Verified account, current revision, and name or size required. No shrink. Pause attached compute before expansion.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VolumePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Volume"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVolume",
        "tags": [
          "Storage"
        ],
        "summary": "Delete detached independent storage",
        "description": "Destructive. Files are removed. Only unattached independent volumes can be deleted directly.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "volumeId": {
                      "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)$"
                    },
                    "operationId": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "const": "deleting"
                    }
                  },
                  "required": [
                    "volumeId",
                    "operationId",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/templates": {
      "get": {
        "operationId": "listTemplates",
        "tags": [
          "Templates"
        ],
        "summary": "Read built-in and workspace templates",
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    }
                  },
                  "required": [
                    "templates"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Save a workspace template",
        "description": "Verified account. Up to 50 workspace templates. Stores environment names only. Returns a bare Template.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/templates/{id}": {
      "put": {
        "operationId": "updateTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Replace a workspace template",
        "description": "Verified account and current revision required. Supply the complete spec, not a patch. Existing services are unchanged.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "spec": {
                    "$ref": "#/components/schemas/TemplateCreate"
                  }
                },
                "required": [
                  "revision",
                  "spec"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTemplate",
        "tags": [
          "Templates"
        ],
        "summary": "Delete a workspace template",
        "description": "Request includes a JSON body with the current revision. Existing services are unchanged.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "revision"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "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)$"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/keys": {
      "get": {
        "operationId": "listKeys",
        "tags": [
          "Account"
        ],
        "summary": "Read active API key metadata",
        "description": "Does not return secret tokens. created_at is Unix milliseconds.",
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "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)$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991,
                            "description": "Unix timestamp in milliseconds."
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "prefix",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "keys"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createKey",
        "tags": [
          "Account"
        ],
        "summary": "Create an API key from an interactive session",
        "description": "Requires a verified Firebase identity from interactive sign-in; an API key cannot create another key. Maximum 20 active keys. The token is returned once.",
        "security": [
          {
            "FirebaseIdToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "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)$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "token": {
                      "type": "string",
                      "description": "New secret token. Store it securely; later reads do not return it."
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "token"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/keys/{id}": {
      "delete": {
        "operationId": "revokeKey",
        "tags": [
          "Account"
        ],
        "summary": "Revoke an account API key",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "required": [
                    "ok"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/billing/summary": {
      "get": {
        "operationId": "getBillingSummary",
        "tags": [
          "Billing"
        ],
        "summary": "Summarize every matching ledger posting",
        "description": "Requires an explicit inclusive 1–90-day UTC window. Aggregates every matching row, independent of pagination. Monetary totals use micro-USD. Credits include positive adjustments, so do not add credits and adjustments to reconstruct net. Daily buckets use posting dates. Resource rankings are capped at 20 while totals remain complete. Existing meters accrue through current time; this does not initiate payment or change rates.",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "format": "date"
            },
            "description": "First inclusive UTC calendar date (YYYY-MM-DD). Required in the HTTP API."
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "format": "date"
            },
            "description": "Last inclusive UTC date. Window must span 1–90 days and end no later than today."
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "adjustment",
                "compute",
                "storage",
                "topup"
              ]
            },
            "description": "Posting kind. Must be compute for serviceId or storage for volumeId when supplied."
          },
          {
            "in": "query",
            "name": "serviceId",
            "required": false,
            "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)$"
            },
            "description": "Selects one service's compute charges. Mutually exclusive with volumeId."
          },
          {
            "in": "query",
            "name": "volumeId",
            "required": false,
            "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)$"
            },
            "description": "Selects one volume's storage charges. Mutually exclusive with serviceId."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSummary"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/billing/ledger": {
      "get": {
        "operationId": "getBillingLedger",
        "tags": [
          "Billing"
        ],
        "summary": "Read cursor-paginated billing postings",
        "description": "Use the same from/to/kind/resource filters with nextCursor. A cursor fixes the insertion ceiling, not immutable amounts: open hourly postings may update. Refresh without a cursor for new insertions. balanceMicros is the balance at the row's latest posting, not a running balance for the displayed page.",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "format": "date"
            },
            "description": "First inclusive UTC calendar date (YYYY-MM-DD). Required in the HTTP API."
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "format": "date"
            },
            "description": "Last inclusive UTC date. Window must span 1–90 days and end no later than today."
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "adjustment",
                "compute",
                "storage",
                "topup"
              ]
            },
            "description": "Posting kind. Must be compute for serviceId or storage for volumeId when supplied."
          },
          {
            "in": "query",
            "name": "serviceId",
            "required": false,
            "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)$"
            },
            "description": "Selects one service's compute charges. Mutually exclusive with volumeId."
          },
          {
            "in": "query",
            "name": "volumeId",
            "required": false,
            "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)$"
            },
            "description": "Selects one volume's storage charges. Mutually exclusive with serviceId."
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            },
            "description": "Opaque nextCursor from the previous page. Keep the original dates and filters."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingPage"
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/billing/checkout": {
      "post": {
        "operationId": "createCheckout",
        "tags": [
          "Billing"
        ],
        "summary": "Create a hosted prepaid Checkout session",
        "description": "Requires payments enabled and a verified interactive Firebase identity. Personal API keys cannot initiate payment. This creates an order/session; credit is recorded only after signed payment confirmation.",
        "security": [
          {
            "FirebaseIdToken": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amountCents": {
                    "type": "integer",
                    "minimum": 500,
                    "maximum": 1000000
                  }
                },
                "required": [
                  "amountCents"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "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)$"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "id",
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/billing/topups/{id}": {
      "get": {
        "operationId": "getTopUp",
        "tags": [
          "Billing"
        ],
        "summary": "Read a top-up order",
        "description": "expiresAt is Unix seconds, unlike account timestamps in milliseconds. Pending does not prove payment failed; inspect before creating another order.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Resource UUID belonging to the authenticated account."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response. Lifecycle and provisioning acknowledgements do not imply application readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "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)$"
                    },
                    "amountCents": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "paid"
                      ]
                    },
                    "expiresAt": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "amountCents",
                    "status",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds to wait before retrying."
              }
            }
          },
          "503": {
            "description": "Request rejected. Inspect error.code and error.message; do not automatically repeat uncertain mutations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Resources": {
        "type": "object",
        "properties": {
          "gpuCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8
          },
          "gpuModel": {
            "default": "rtx-pro-6000-blackwell",
            "type": "string",
            "enum": [
              "rtx-pro-6000-blackwell",
              "h200",
              "b200",
              "b300"
            ]
          },
          "gpuMemoryGb": {
            "default": 96,
            "anyOf": [
              {
                "type": "number",
                "const": 24
              },
              {
                "type": "number",
                "const": 48
              },
              {
                "type": "number",
                "const": 96
              },
              {
                "type": "number",
                "const": 141
              },
              {
                "type": "number",
                "const": 180
              },
              {
                "type": "number",
                "const": 288
              }
            ]
          },
          "cpu": {
            "type": "integer",
            "minimum": 1,
            "maximum": 64
          },
          "memoryGb": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          }
        },
        "required": [
          "gpuCount",
          "cpu",
          "memoryGb"
        ],
        "allOf": [
          {
            "if": {
              "anyOf": [
                {
                  "not": {
                    "required": [
                      "gpuModel"
                    ]
                  }
                },
                {
                  "properties": {
                    "gpuModel": {
                      "const": "rtx-pro-6000-blackwell"
                    }
                  },
                  "required": [
                    "gpuModel"
                  ]
                }
              ]
            },
            "then": {
              "properties": {
                "gpuMemoryGb": {
                  "enum": [
                    24,
                    48,
                    96
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "gpuMemoryGb": {
                        "enum": [
                          24,
                          48
                        ]
                      }
                    },
                    "required": [
                      "gpuMemoryGb"
                    ]
                  },
                  "then": {
                    "properties": {
                      "gpuCount": {
                        "maximum": 1
                      }
                    }
                  }
                }
              ]
            }
          },
          {
            "if": {
              "properties": {
                "gpuModel": {
                  "const": "h200"
                }
              },
              "required": [
                "gpuModel"
              ]
            },
            "then": {
              "properties": {
                "gpuMemoryGb": {
                  "enum": [
                    141
                  ]
                }
              },
              "required": [
                "gpuMemoryGb"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "gpuModel": {
                  "const": "b200"
                }
              },
              "required": [
                "gpuModel"
              ]
            },
            "then": {
              "properties": {
                "gpuMemoryGb": {
                  "enum": [
                    180
                  ]
                }
              },
              "required": [
                "gpuMemoryGb"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "gpuModel": {
                  "const": "b300"
                }
              },
              "required": [
                "gpuModel"
              ]
            },
            "then": {
              "properties": {
                "gpuMemoryGb": {
                  "enum": [
                    288
                  ]
                }
              },
              "required": [
                "gpuMemoryGb"
              ]
            }
          }
        ]
      },
      "RegistryCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "repository": {
            "type": "string",
            "minLength": 3,
            "maxLength": 512,
            "pattern": "^[a-z0-9][a-z0-9.-]*(?::[0-9]{1,5})?(?:\\/[a-z0-9][a-z0-9._-]*)+$",
            "description": "Exact fully qualified OCI repository without scheme, tag, or digest. Immutable after creation.",
            "allOf": [
              {
                "pattern": "^(?:localhost|[a-z0-9][a-z0-9.-]*\\.[a-z0-9.-]+|[a-z0-9][a-z0-9.-]*:[0-9]{1,5})(?:/[a-z0-9][a-z0-9._-]*)+$"
              },
              {
                "not": {
                  "pattern": "^docker\\.io/[^/]+$"
                }
              }
            ]
          },
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[^\\r\\n\\0:]+$",
            "writeOnly": true
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192,
            "writeOnly": true,
            "description": "Write-only pull credential. Never place it in logs, chat messages, or application environment variables."
          }
        },
        "required": [
          "name",
          "repository",
          "username",
          "password"
        ],
        "additionalProperties": false
      },
      "RegistryMetadata": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "repository": {
            "type": "string",
            "minLength": 3,
            "maxLength": 512,
            "pattern": "^[a-z0-9][a-z0-9.-]*(?::[0-9]{1,5})?(?:\\/[a-z0-9][a-z0-9._-]*)+$"
          },
          "id": {
            "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)$"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          }
        },
        "required": [
          "name",
          "repository",
          "id",
          "revision",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "ImageRegistry": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "repository": {
            "type": "string",
            "minLength": 3,
            "maxLength": 512,
            "pattern": "^[a-z0-9][a-z0-9.-]*(?::[0-9]{1,5})?(?:\\/[a-z0-9][a-z0-9._-]*)+$"
          },
          "id": {
            "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)$"
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "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)$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "queued",
                    "starting",
                    "running",
                    "sleeping",
                    "stopping",
                    "resizing",
                    "deleting",
                    "deleted",
                    "error"
                  ]
                },
                "allocated": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "status",
                "allocated"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "name",
          "repository",
          "id",
          "revision",
          "createdAt",
          "updatedAt",
          "services"
        ],
        "additionalProperties": false
      },
      "ServiceAction": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "restart",
              "resize",
              "delete"
            ]
          },
          "resources": {
            "$ref": "#/components/schemas/Resources"
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "resize"
                }
              },
              "required": [
                "action"
              ]
            },
            "then": {
              "required": [
                "resources"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "resources"
                ]
              }
            }
          }
        ]
      },
      "BillingFilter": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "format": "date"
          },
          "to": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "format": "date"
          },
          "kind": {
            "type": "string",
            "enum": [
              "adjustment",
              "compute",
              "storage",
              "topup"
            ]
          },
          "serviceId": {
            "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)$"
          },
          "volumeId": {
            "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)$"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "additionalProperties": false,
        "description": "Inclusive UTC window of 1–90 days; the end cannot be in the future. Date ordering, window length, and today-relative bounds are enforced by the server.",
        "allOf": [
          {
            "not": {
              "required": [
                "serviceId",
                "volumeId"
              ]
            }
          },
          {
            "if": {
              "required": [
                "serviceId"
              ]
            },
            "then": {
              "properties": {
                "kind": {
                  "const": "compute"
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "volumeId"
              ]
            },
            "then": {
              "properties": {
                "kind": {
                  "const": "storage"
                }
              }
            }
          }
        ]
      },
      "BillingSummary": {
        "type": "object",
        "properties": {
          "window": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "adjustment",
                  "compute",
                  "storage",
                  "topup"
                ]
              },
              "serviceId": {
                "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)$"
              },
              "volumeId": {
                "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)$"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "generatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "totals": {
            "type": "object",
            "properties": {
              "entries": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "compute": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
              },
              "storage": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
              },
              "credits": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
              },
              "adjustments": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
              },
              "net": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
              }
            },
            "required": [
              "entries",
              "compute",
              "storage",
              "credits",
              "adjustments",
              "net"
            ],
            "additionalProperties": false
          },
          "days": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string"
                },
                "compute": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                },
                "storage": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                },
                "credits": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                }
              },
              "required": [
                "date",
                "compute",
                "storage",
                "credits"
              ],
              "additionalProperties": false
            }
          },
          "resources": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resource": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "service",
                            "volume"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "compute",
                    "storage"
                  ]
                },
                "chargedMicros": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                }
              },
              "required": [
                "resource",
                "kind",
                "chargedMicros"
              ],
              "additionalProperties": false
            }
          },
          "resourcesTruncated": {
            "type": "boolean"
          }
        },
        "required": [
          "window",
          "generatedAt",
          "currency",
          "totals",
          "days",
          "resources",
          "resourcesTruncated"
        ],
        "additionalProperties": false
      },
      "BillingPage": {
        "type": "object",
        "properties": {
          "window": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "to": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "adjustment",
                  "compute",
                  "storage",
                  "topup"
                ]
              },
              "serviceId": {
                "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)$"
              },
              "volumeId": {
                "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)$"
              }
            },
            "required": [
              "from",
              "to"
            ],
            "additionalProperties": false
          },
          "entries": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "deltaMicros": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                },
                "balanceMicros": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "adjustment",
                    "compute",
                    "storage",
                    "topup"
                  ]
                },
                "reason": {
                  "type": "string"
                },
                "actor": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Unix timestamp in milliseconds."
                },
                "serviceId": {
                  "anyOf": [
                    {
                      "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)$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "resource": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "enum": [
                            "service",
                            "volume"
                          ]
                        },
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "type",
                        "id",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "deltaMicros",
                "balanceMicros",
                "kind",
                "reason",
                "actor",
                "createdAt",
                "serviceId",
                "resource"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "generatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "amountsMayUpdate": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "window",
          "entries",
          "nextCursor",
          "generatedAt",
          "amountsMayUpdate"
        ],
        "additionalProperties": false
      },
      "ServiceCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "region": {
            "type": "string",
            "enum": [
              "economy",
              "standard"
            ]
          },
          "geography": {
            "default": "auto",
            "type": "string",
            "enum": [
              "auto",
              "north-america",
              "oceania"
            ]
          },
          "image": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/:@-]+$"
          },
          "command": {
            "default": [],
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "environment": {
            "default": {},
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 8192
            },
            "maxProperties": 64
          },
          "resources": {
            "$ref": "#/components/schemas/Resources"
          },
          "httpPort": {
            "default": 8080,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1024,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ],
            "description": "1024–65535 except reserved port 9090. null disables HTTP exposure.",
            "not": {
              "const": 9090
            }
          },
          "containerDiskGb": {
            "default": 20,
            "type": "integer",
            "minimum": 5,
            "maximum": 500
          },
          "volumeGb": {
            "default": 20,
            "type": "integer",
            "minimum": 10,
            "maximum": 4096
          },
          "volumeMode": {
            "default": "service",
            "type": "string",
            "enum": [
              "service",
              "independent"
            ]
          },
          "volumeId": {
            "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)$"
          },
          "sleepAfterMinutes": {
            "default": 15,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 1440
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "region",
          "image",
          "resources"
        ]
      },
      "ServicePatch": {
        "type": "object",
        "properties": {
          "image": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/:@-]+$"
          },
          "command": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "environment": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 8192
            },
            "maxProperties": 64,
            "description": "Replaces the entire map when supplied. Omit to retain existing secret values."
          },
          "httpPort": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1024,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ],
            "not": {
              "const": 9090
            }
          }
        },
        "additionalProperties": false,
        "minProperties": 1
      },
      "Service": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "region": {
            "type": "string",
            "enum": [
              "economy",
              "standard"
            ]
          },
          "image": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/:@-]+$"
          },
          "command": {
            "default": [],
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "resources": {
            "$ref": "#/components/schemas/Resources"
          },
          "httpPort": {
            "default": 8080,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1024,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "containerDiskGb": {
            "default": 20,
            "type": "integer",
            "minimum": 5,
            "maximum": 500
          },
          "volumeGb": {
            "default": 20,
            "type": "integer",
            "minimum": 10,
            "maximum": 4096
          },
          "volumeMode": {
            "default": "service",
            "type": "string",
            "enum": [
              "service",
              "independent"
            ]
          },
          "volumeId": {
            "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)$"
          },
          "sleepAfterMinutes": {
            "default": 15,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 1440
              },
              {
                "type": "null"
              }
            ]
          },
          "geography": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "north-america",
                  "oceania"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "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)$"
          },
          "environmentKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "starting",
              "running",
              "sleeping",
              "stopping",
              "resizing",
              "deleting",
              "deleted",
              "error"
            ]
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "lastActivityAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "hourlyMicros": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "allocated": {
            "type": "boolean"
          },
          "endpoint": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "region",
          "image",
          "command",
          "resources",
          "httpPort",
          "containerDiskGb",
          "volumeGb",
          "volumeMode",
          "volumeId",
          "sleepAfterMinutes",
          "geography",
          "id",
          "environmentKeys",
          "status",
          "revision",
          "createdAt",
          "updatedAt",
          "lastActivityAt",
          "hourlyMicros",
          "error",
          "allocated",
          "endpoint"
        ],
        "additionalProperties": false
      },
      "Volume": {
        "type": "object",
        "properties": {
          "id": {
            "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)$"
          },
          "placementId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "region": {
            "type": "string",
            "enum": [
              "economy",
              "standard"
            ]
          },
          "geography": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "north-america",
                  "oceania"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "sizeGb": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "mode": {
            "type": "string",
            "enum": [
              "service",
              "independent"
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "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)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "updatedAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "requestedSizeGb": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "provisioned": {
            "type": "boolean"
          },
          "hourlyMicros": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "ready",
              "resizing",
              "deleting",
              "deleted",
              "error"
            ]
          }
        },
        "required": [
          "id",
          "placementId",
          "name",
          "region",
          "geography",
          "sizeGb",
          "mode",
          "serviceId",
          "createdAt",
          "updatedAt",
          "revision",
          "requestedSizeGb",
          "error",
          "provisioned",
          "hourlyMicros",
          "status"
        ],
        "additionalProperties": false
      },
      "VolumeCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "region": {
            "type": "string",
            "enum": [
              "economy",
              "standard"
            ]
          },
          "geography": {
            "default": "auto",
            "type": "string",
            "enum": [
              "auto",
              "north-america",
              "oceania"
            ]
          },
          "sizeGb": {
            "type": "integer",
            "minimum": 10,
            "maximum": 4096
          }
        },
        "required": [
          "name",
          "region",
          "sizeGb"
        ],
        "additionalProperties": false
      },
      "VolumePatch": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "sizeGb": {
            "type": "integer",
            "minimum": 10,
            "maximum": 4096
          }
        },
        "required": [
          "revision"
        ],
        "additionalProperties": false,
        "anyOf": [
          {
            "required": [
              "name"
            ]
          },
          {
            "required": [
              "sizeGb"
            ]
          }
        ]
      },
      "TemplateCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "description": {
            "default": "",
            "type": "string",
            "maxLength": 500
          },
          "image": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/:@-]+$"
          },
          "command": {
            "default": [],
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "httpPort": {
            "default": 8080,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1024,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ],
            "not": {
              "const": 9090
            }
          },
          "resources": {
            "$ref": "#/components/schemas/Resources"
          },
          "containerDiskGb": {
            "default": 20,
            "type": "integer",
            "minimum": 5,
            "maximum": 500
          },
          "volumeGb": {
            "default": 20,
            "type": "integer",
            "minimum": 10,
            "maximum": 4096
          },
          "sleepAfterMinutes": {
            "default": 15,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 1440
              },
              {
                "type": "null"
              }
            ]
          },
          "requiredEnvironment": {
            "default": [],
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
            },
            "uniqueItems": true
          }
        },
        "required": [
          "name",
          "image"
        ],
        "additionalProperties": false
      },
      "Template": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "description": {
            "default": "",
            "type": "string",
            "maxLength": 500
          },
          "image": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512,
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._/:@-]+$"
          },
          "command": {
            "default": [],
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 4096
            }
          },
          "httpPort": {
            "default": 8080,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1024,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "resources": {
            "$ref": "#/components/schemas/Resources"
          },
          "containerDiskGb": {
            "default": 20,
            "type": "integer",
            "minimum": 5,
            "maximum": 500
          },
          "volumeGb": {
            "default": 20,
            "type": "integer",
            "minimum": 10,
            "maximum": 4096
          },
          "sleepAfterMinutes": {
            "default": 15,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 1440
              },
              {
                "type": "null"
              }
            ]
          },
          "requiredEnvironment": {
            "default": [],
            "maxItems": 64,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
            }
          },
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "built-in",
              "workspace"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix timestamp in milliseconds."
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Unix timestamp in milliseconds."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "description",
          "image",
          "command",
          "httpPort",
          "resources",
          "containerDiskGb",
          "volumeGb",
          "sleepAfterMinutes",
          "requiredEnvironment",
          "id",
          "source",
          "revision",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "Region": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{0,62}$"
          },
          "tier": {
            "type": "string",
            "enum": [
              "economy",
              "standard"
            ]
          },
          "geography": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "north-america",
                  "oceania"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "location": {
            "type": "string",
            "maxLength": 80
          },
          "gpuModels": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "rtx-pro-6000-blackwell",
                "h200",
                "b200",
                "b300"
              ]
            }
          },
          "gpuCapacity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 128
          },
          "enabled": {
            "type": "boolean"
          },
          "price": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "gpu24HourlyMicros": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpu48HourlyMicros": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuHourlyMicros": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuH200HourlyMicros": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuB200HourlyMicros": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuB300HourlyMicros": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 1000000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cpuHourlyMicros": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000
                  },
                  "memoryGbHourlyMicros": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000
                  },
                  "storageGbHourlyMicros": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000000
                  }
                },
                "required": [
                  "gpu24HourlyMicros",
                  "gpu48HourlyMicros",
                  "gpuHourlyMicros",
                  "gpuH200HourlyMicros",
                  "gpuB200HourlyMicros",
                  "gpuB300HourlyMicros",
                  "cpuHourlyMicros",
                  "memoryGbHourlyMicros",
                  "storageGbHourlyMicros"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "connected": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "tier",
          "geography",
          "name",
          "location",
          "gpuModels",
          "gpuCapacity",
          "enabled",
          "price",
          "connected"
        ],
        "additionalProperties": false
      },
      "Identity": {
        "type": "object",
        "properties": {
          "uid": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "admin": {
            "type": "boolean"
          },
          "canManageAdmins": {
            "type": "boolean"
          },
          "method": {
            "type": "string",
            "enum": [
              "firebase",
              "api-key"
            ]
          }
        },
        "required": [
          "uid",
          "email",
          "name",
          "verified",
          "admin",
          "canManageAdmins",
          "method"
        ],
        "additionalProperties": false
      },
      "LedgerEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "deltaMicros": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
          },
          "balanceMicros": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Micro-USD. 1 USD = 1,000,000 micro-USD."
          },
          "kind": {
            "type": "string",
            "enum": [
              "adjustment",
              "compute",
              "storage",
              "topup"
            ]
          },
          "reason": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "createdAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "serviceId": {
            "anyOf": [
              {
                "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)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "deltaMicros",
          "balanceMicros",
          "kind",
          "reason",
          "actor",
          "createdAt",
          "serviceId"
        ],
        "additionalProperties": false
      },
      "Activity": {
        "type": "object",
        "properties": {
          "id": {
            "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)$"
          },
          "serviceId": {
            "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)$"
          },
          "name": {
            "type": "string"
          },
          "expiresAt": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Unix timestamp in milliseconds."
          },
          "kind": {
            "type": "string",
            "enum": [
              "task",
              "connection"
            ]
          }
        },
        "required": [
          "id",
          "serviceId",
          "name",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "MetricsHistory": {
        "type": "object",
        "properties": {
          "serviceId": {
            "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)$"
          },
          "intervalSeconds": {
            "type": "number",
            "const": 30
          },
          "retentionSeconds": {
            "type": "number",
            "const": 21600
          },
          "state": {
            "type": "string",
            "enum": [
              "live",
              "partial",
              "stale",
              "unavailable",
              "inactive"
            ]
          },
          "latest": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "observedAt": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "revision": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "generation": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{16}$"
                  },
                  "cpuPercent": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memoryPercent": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuPercent": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "vramPercent": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 100
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cpuCoresUsed": {
                    "anyOf": [
                      {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 4096
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "cpuCoresTotal": {
                    "anyOf": [
                      {
                        "type": "number",
                        "exclusiveMinimum": 0,
                        "maximum": 4096
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memoryUsedBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "memoryTotalBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuMemoryUsedBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "gpuMemoryTotalBytes": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "devices": {
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "index": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 7
                        },
                        "gpuPercent": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "vramPercent": {
                          "anyOf": [
                            {
                              "type": "number",
                              "minimum": 0,
                              "maximum": 100
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "memoryUsedBytes": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "memoryTotalBytes": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "index",
                        "gpuPercent",
                        "vramPercent",
                        "memoryUsedBytes",
                        "memoryTotalBytes"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "unavailable": {
                    "type": "object",
                    "properties": {
                      "cpu": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not-allocated",
                              "not-running",
                              "not-reported",
                              "collection-failed",
                              "unsupported-profile",
                              "stale-source"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "memory": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not-allocated",
                              "not-running",
                              "not-reported",
                              "collection-failed",
                              "unsupported-profile",
                              "stale-source"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "gpu": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not-allocated",
                              "not-running",
                              "not-reported",
                              "collection-failed",
                              "unsupported-profile",
                              "stale-source"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "vram": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "not-allocated",
                              "not-running",
                              "not-reported",
                              "collection-failed",
                              "unsupported-profile",
                              "stale-source"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "cpu",
                      "memory",
                      "gpu",
                      "vram"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "observedAt",
                  "revision",
                  "generation",
                  "cpuPercent",
                  "memoryPercent",
                  "gpuPercent",
                  "vramPercent",
                  "cpuCoresUsed",
                  "cpuCoresTotal",
                  "memoryUsedBytes",
                  "memoryTotalBytes",
                  "gpuMemoryUsedBytes",
                  "gpuMemoryTotalBytes",
                  "devices",
                  "unavailable"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "samples": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "observedAt": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "revision": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "generation": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{16}$"
                },
                "cpuPercent": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "memoryPercent": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "gpuPercent": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "vramPercent": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "observedAt",
                "revision",
                "generation",
                "cpuPercent",
                "memoryPercent",
                "gpuPercent",
                "vramPercent"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "serviceId",
          "intervalSeconds",
          "retentionSeconds",
          "state",
          "latest",
          "samples"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "A personal Oiy API key, supplied through Authorization. Does not grant interactive or administrator privileges."
      },
      "FirebaseIdToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "A Firebase ID token from interactive console sign-in. A verified identity is required for allocation, key creation, and Checkout."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128
        },
        "description": "Unique per logical mutation. Reuse only for an identical retry after checking state."
      }
    }
  }
}
