{
  "openapi": "3.1.0",
  "info": {
    "title": "Ample API",
    "version": "0.1.21",
    "summary": "Deploy and operate AI-built applications.",
    "description": "REST API behind the Ample CLI and remote MCP server. Agents normally drive Ample through the CLI (ample plan, ample up, ample deploy) or MCP; this description exists so an agent can understand the surface, authenticate and read state directly. Errors are JSON objects of the form {\"error\":{\"code\":\"...\",\"message\":\"...\"}}.",
    "contact": {
      "name": "Ample Computer",
      "url": "https://ample.computer"
    },
    "termsOfService": "https://ample.computer/terms"
  },
  "externalDocs": {
    "description": "Agent instructions",
    "url": "https://ample.computer/AGENTS.md"
  },
  "servers": [
    {
      "url": "https://api.ample.computer",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "auth"
    },
    {
      "name": "servers"
    },
    {
      "name": "deployments"
    },
    {
      "name": "domains"
    },
    {
      "name": "operations"
    },
    {
      "name": "databases"
    },
    {
      "name": "buckets"
    },
    {
      "name": "volumes"
    },
    {
      "name": "workspaces"
    },
    {
      "name": "account"
    },
    {
      "name": "catalog"
    },
    {
      "name": "mcp"
    },
    {
      "name": "meta"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "API health",
        "description": "Returns 200 when the API is serving requests. No authentication.",
        "security": [],
        "tags": [
          "meta"
        ],
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    },
    "/v1/auth/signup": {
      "post": {
        "operationId": "signup",
        "summary": "Create a self-serve account",
        "description": "Creates an account with free-plan quotas and returns an access token, OAuth client credentials and a claim URL. Reusing the same request_key within ten minutes returns the same receipt. No authentication, no browser, no payment.",
        "security": [],
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account created or receipt replayed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/oauth/token": {
      "post": {
        "operationId": "issueToken",
        "summary": "Exchange client credentials for an access token",
        "description": "OAuth 2.0 client_credentials grant. Send the issued client_id and client_secret as form fields or with HTTP Basic authentication. Access tokens last at most 15 minutes and are bound to the resource.",
        "security": [],
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/auth/whoami": {
      "get": {
        "operationId": "whoami",
        "summary": "Describe the current credential",
        "description": "Returns the account and scopes behind the bearer token.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Identity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Account identity and scopes",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/auth/tokens/{id}": {
      "delete": {
        "operationId": "revokeToken",
        "summary": "Revoke an API token",
        "description": "Revokes a token issued to this account.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token id"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/auth/agents": {
      "get": {
        "operationId": "listAgentCredentials",
        "summary": "List agent credentials",
        "description": "Lists agent credentials without exposing secrets.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Agent credential",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createAgentCredential",
        "summary": "Provision an agent credential",
        "description": "Creates a scoped credential whose secret is shown once.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Credential request",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "description": "Space-separated scopes"
                  }
                },
                "required": [
                  "name",
                  "scope"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential with one-time secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Agent credential",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Credential with one-time secret",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Agent credential",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/auth/agents/{id}": {
      "delete": {
        "operationId": "revokeAgentCredential",
        "summary": "Revoke an agent credential",
        "description": "Revokes the credential and every access token and descendant credential derived from it.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "tokens:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Credential id"
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers": {
      "get": {
        "operationId": "listServers",
        "summary": "List servers",
        "description": "Lists the account's servers, optionally filtered by status.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Servers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Server"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createServer",
        "summary": "Create a server",
        "description": "Boots a microVM from a build template. Most agents should use ample deploy or ample up instead, which create servers as needed.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServerRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "201": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}": {
      "get": {
        "operationId": "getServer",
        "summary": "Get a server",
        "description": "Returns one server.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id (srv_...)"
          }
        ],
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "destroyServer",
        "summary": "Destroy a server",
        "description": "Destroys the server and its root disk. Attached volumes and databases survive.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "204": {
            "description": "Destroyed"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/pause": {
      "put": {
        "operationId": "pauseServer",
        "summary": "Pause a server",
        "description": "Snapshots and pauses the VM. It wakes on the next request.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/resume": {
      "put": {
        "operationId": "resumeServer",
        "summary": "Resume a server",
        "description": "Wakes a paused or cold server.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "200": {
            "description": "Server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Server"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/exec": {
      "post": {
        "operationId": "execCommand",
        "summary": "Run a command on a server",
        "description": "Runs a shell command inside the VM and returns its output, optionally streamed.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:exec"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Command",
                "properties": {
                  "command": {
                    "type": "string"
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "command"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Command output",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Exit code and output",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/upload": {
      "post": {
        "operationId": "uploadFile",
        "summary": "Upload a file to a server",
        "description": "Copies a file into the VM.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:exec"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Upload",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uploaded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Upload result",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/download": {
      "post": {
        "operationId": "downloadFile",
        "summary": "Download a file from a server",
        "description": "Reads a file from the VM.",
        "tags": [
          "servers"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:exec"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Download",
                "properties": {
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File contents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "File contents",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/servers/{id}/deployments": {
      "get": {
        "operationId": "listServerDeployments",
        "summary": "List deployments of a server",
        "description": "Lists deployments that target this server.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Deployment"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments": {
      "get": {
        "operationId": "listDeployments",
        "summary": "List deployments",
        "description": "Lists the account's deployments (apps).",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Deployments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Deployment"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createDeployment",
        "summary": "Create a deployment",
        "description": "Starts a synchronous, content-addressed deployment. The Ample CLI builds this request from the repository (packaged files, detected build and start commands, environment). Agents should run ample deploy or ample up rather than call this directly. An unchanged source produces a no-op with unchanged=true.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Deployment request built by the Ample CLI",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "App name"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "201": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}": {
      "get": {
        "operationId": "getDeployment",
        "summary": "Get a deployment",
        "description": "Returns the deployment, its status and live URL.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id (dep_...)"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteDeployment",
        "summary": "Delete an app",
        "description": "Deletes the app and its releases; shared servers and declared resources are preserved.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/logs": {
      "get": {
        "operationId": "getDeploymentLogs",
        "summary": "Read build or runtime logs",
        "description": "Returns stored build or runtime log entries. For a running app the runtime kind falls back to a live journal tail.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "build",
                "runtime"
              ]
            }
          },
          {
            "name": "tail",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            },
            "description": "Live runtime lines to tail"
          }
        ],
        "responses": {
          "200": {
            "description": "Log entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Log entries",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/finalize": {
      "post": {
        "operationId": "finalizeDeployment",
        "summary": "Finalize a deployment",
        "description": "Completes the upload phase and activates the release. Used by the CLI.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Deployment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/domains": {
      "get": {
        "operationId": "listDomains",
        "summary": "List custom domains",
        "description": "Lists custom domains attached to the app.",
        "tags": [
          "domains"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Domains",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Domain",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "addDomain",
        "summary": "Attach a custom domain",
        "description": "Attaches a domain and returns the DNS record to create before verification.",
        "tags": [
          "domains"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Domain",
                "properties": {
                  "domain": {
                    "type": "string"
                  }
                },
                "required": [
                  "domain"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain with DNS instructions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Domain",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Domain with DNS instructions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Domain",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/domains/{domain}/verify": {
      "post": {
        "operationId": "verifyDomain",
        "summary": "Verify a custom domain",
        "description": "Checks the DNS record and activates TLS routing when it resolves.",
        "tags": [
          "domains"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Fully qualified domain name"
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Domain",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/deployments/{id}/secrets": {
      "get": {
        "operationId": "listSecrets",
        "summary": "List secret names",
        "description": "Lists environment variable names stored for the app. Values are never returned.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "responses": {
          "200": {
            "description": "Secret names",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Secret names",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "setSecret",
        "summary": "Set a secret",
        "description": "Stores an encrypted environment variable for future releases.",
        "tags": [
          "deployments"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Deployment id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Secret",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Secret names",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}": {
      "get": {
        "operationId": "getOperation",
        "summary": "Get an operation",
        "description": "Returns a long-running operation such as a deployment.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Operation",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}/events": {
      "get": {
        "operationId": "listOperationEvents",
        "summary": "List operation events",
        "description": "Returns the event log of an operation.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Event",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}/watch": {
      "get": {
        "operationId": "watchOperation",
        "summary": "Wait for an operation",
        "description": "Long-polls until the operation finishes or wait_secs elapses.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:read"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          },
          {
            "name": "wait_secs",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Operation",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/operations/{id}/cancel": {
      "post": {
        "operationId": "cancelOperation",
        "summary": "Cancel an operation",
        "description": "Cancels a running deployment operation.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "servers:write"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Operation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Operation",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/executions/{id}": {
      "get": {
        "operationId": "getExecution",
        "summary": "Get an MCP execution",
        "description": "Returns the status of an execution started through the remote MCP server.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Execution id"
          }
        ],
        "responses": {
          "200": {
            "description": "Execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Execution",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/executions/{id}/cancel": {
      "post": {
        "operationId": "cancelExecution",
        "summary": "Cancel an MCP execution",
        "description": "Cancels a running execution.",
        "tags": [
          "operations"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Execution id"
          }
        ],
        "responses": {
          "200": {
            "description": "Execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Execution",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/databases": {
      "get": {
        "operationId": "listDatabases",
        "summary": "List managed databases",
        "description": "Lists Postgres, MySQL, Redis and MongoDB databases in the account.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Databases",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Database",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createDatabase",
        "summary": "Create a managed database",
        "description": "Provisions a database microVM (about 15 seconds) and returns its connection details.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDatabaseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Database",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Database",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/databases/{id}": {
      "get": {
        "operationId": "getDatabase",
        "summary": "Get a managed database",
        "description": "Returns one database.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Database id"
          }
        ],
        "responses": {
          "200": {
            "description": "Database",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Database",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteDatabase",
        "summary": "Delete a managed database",
        "description": "Destroys the database and its data.",
        "tags": [
          "databases"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "databases:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Database id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets": {
      "get": {
        "operationId": "listBuckets",
        "summary": "List buckets",
        "description": "Lists S3-compatible object storage buckets.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Buckets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Bucket",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createBucket",
        "summary": "Create a bucket",
        "description": "Creates a bucket and issues S3 credentials.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBucketRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}": {
      "get": {
        "operationId": "getBucket",
        "summary": "Get a bucket",
        "description": "Returns one bucket.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteBucket",
        "summary": "Delete a bucket",
        "description": "Deletes the bucket and its objects.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/credentials": {
      "get": {
        "operationId": "getBucketCredentials",
        "summary": "Get bucket credentials",
        "description": "Returns the S3 endpoint and access keys.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "S3 credentials",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/publish": {
      "post": {
        "operationId": "publishBucket",
        "summary": "Publish a bucket",
        "description": "Serves objects publicly through the CDN.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/unpublish": {
      "post": {
        "operationId": "unpublishBucket",
        "summary": "Unpublish a bucket",
        "description": "Stops public serving.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Bucket",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/buckets/{id}/rotate-key": {
      "post": {
        "operationId": "rotateBucketKey",
        "summary": "Rotate bucket keys",
        "description": "Issues new S3 access keys and revokes the old ones.",
        "tags": [
          "buckets"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "buckets:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bucket id"
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "S3 credentials",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes": {
      "get": {
        "operationId": "listVolumes",
        "summary": "List volumes",
        "description": "Lists persistent volumes.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Volumes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Volume",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createVolume",
        "summary": "Create a volume",
        "description": "Creates a persistent volume.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVolumeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes/{id}": {
      "get": {
        "operationId": "getVolume",
        "summary": "Get a volume",
        "description": "Returns one volume.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          }
        ],
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteVolume",
        "summary": "Delete a volume",
        "description": "Deletes a detached volume and its data.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes/{id}/attach/{server_id}": {
      "post": {
        "operationId": "attachVolume",
        "summary": "Attach a volume",
        "description": "Mounts the volume in a server at mount_path.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          },
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Server id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Mount",
                "properties": {
                  "mount_path": {
                    "type": "string"
                  }
                },
                "required": [
                  "mount_path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/volumes/{id}/detach": {
      "post": {
        "operationId": "detachVolume",
        "summary": "Detach a volume",
        "description": "Unmounts the volume from its server.",
        "tags": [
          "volumes"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "volumes:*"
            ]
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Volume id"
          }
        ],
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Volume",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "operationId": "listWorkspaces",
        "summary": "List workspaces",
        "description": "Lists account-owned workspaces used as the working directory for remote MCP and CLI-in-the-cloud runs.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Workspaces",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "Workspace",
                    "properties": {},
                    "additionalProperties": true
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "createWorkspace",
        "summary": "Create a workspace",
        "description": "Creates an empty workspace.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Workspace",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "201": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}": {
      "get": {
        "operationId": "getWorkspace",
        "summary": "Get a workspace",
        "description": "Returns one workspace.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspace",
        "summary": "Delete a workspace",
        "description": "Deletes the workspace and its files.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/archive": {
      "get": {
        "operationId": "downloadWorkspaceArchive",
        "summary": "Download a workspace as tar.gz",
        "description": "Streams the workspace contents.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "responses": {
          "200": {
            "description": "tar.gz archive",
            "content": {
              "application/gzip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "put": {
        "operationId": "uploadWorkspaceArchive",
        "summary": "Upload a tar.gz into a workspace",
        "description": "Replaces the workspace contents.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/gzip": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/archive/base64": {
      "post": {
        "operationId": "uploadWorkspaceArchiveBase64",
        "summary": "Upload a base64 tar.gz into a workspace",
        "description": "JSON variant of the archive upload.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Archive",
                "properties": {
                  "data_base64": {
                    "type": "string"
                  }
                },
                "required": [
                  "data_base64"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/files/read": {
      "post": {
        "operationId": "readWorkspaceFile",
        "summary": "Read a workspace file",
        "description": "Returns one file.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Path",
                "properties": {
                  "path": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "File",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "File contents",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/files/write": {
      "post": {
        "operationId": "writeWorkspaceFile",
        "summary": "Write a workspace file",
        "description": "Writes text or base64 data to a path.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "File",
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "data_base64": {
                    "type": "string"
                  }
                },
                "required": [
                  "path"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Written",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Write result",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/workspaces/{id}/import": {
      "post": {
        "operationId": "importWorkspace",
        "summary": "Import a repository into a workspace",
        "description": "Imports source from a public repository URL.",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Import source",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Workspace",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Current usage",
        "description": "Returns compute, storage and egress usage for the account.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Usage",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/quota": {
      "get": {
        "operationId": "getQuota",
        "summary": "Plan quotas",
        "description": "Returns the plan limits and how much of each is used. A null limit means unlimited.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "responses": {
          "200": {
            "description": "Quota",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Quota",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/budget": {
      "get": {
        "operationId": "getBudget",
        "summary": "Budget status",
        "description": "Returns the monthly and daily spend caps and current spend.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": [
              "budgets:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Budget",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      },
      "post": {
        "operationId": "setBudget",
        "summary": "Set a budget",
        "description": "Sets monthly and daily caps and whether to hard-stop at the cap.",
        "tags": [
          "account"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetBudgetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Budget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Budget",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog": {
      "get": {
        "operationId": "getCatalogIndex",
        "summary": "Recipe catalog index",
        "description": "Facets, counts and typed next actions for the deployment recipe catalog. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Catalog index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Catalog index",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/status": {
      "get": {
        "operationId": "getCatalogStatus",
        "summary": "Catalog publication status",
        "description": "Catalog revision and publication counts. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Catalog status",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/nodes/{node_id}": {
      "get": {
        "operationId": "browseCatalogNode",
        "summary": "Browse a catalog facet node",
        "description": "Children, published recipes and dependents of one facet node. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "parameters": [
          {
            "name": "node_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Node id"
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Node",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Catalog node",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/recipes/{recipe_id}": {
      "get": {
        "operationId": "inspectRecipe",
        "summary": "Inspect a recipe",
        "description": "Full recipe contract: framework, template, resources, constraints, evidence. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "parameters": [
          {
            "name": "recipe_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Recipe id"
          }
        ],
        "responses": {
          "200": {
            "description": "Recipe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Recipe contract",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/search": {
      "post": {
        "operationId": "searchRecipes",
        "summary": "Search recipes",
        "description": "Ranked recipe search with filters, hard constraints and preferences. An unknown hard constraint is never a fit. Public.",
        "tags": [
          "catalog"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Search results",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/v1/catalog/plan": {
      "post": {
        "operationId": "planFromRecipe",
        "summary": "Plan a deployment from a recipe",
        "description": "Produces a side-effect-free deployment plan for a project from a recipe; deploying still goes through the authenticated deploy flow.",
        "tags": [
          "catalog"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Plan request",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Plan",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Deployment plan",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Remote MCP endpoint",
        "description": "Model Context Protocol over Streamable HTTP. Tools mirror the CLI (ample_plan, ample_up, ample_deploy, ample_logs, ...). Authenticate with a bearer token from /v1/auth/signup or /oauth/token.",
        "tags": [
          "mcp"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "oauthClientCredentials": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request",
                "properties": {},
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "JSON-RPC 2.0 response",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp/catalog": {
      "get": {
        "operationId": "getMcpCatalog",
        "summary": "MCP tool catalog",
        "description": "Every MCP tool with its JSON schema. Public.",
        "tags": [
          "mcp"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Tool catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Tools",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp/server.json": {
      "get": {
        "operationId": "getMcpServerJson",
        "summary": "MCP registry record",
        "description": "server.json for the MCP Registry. Public.",
        "tags": [
          "mcp"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "server.json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "MCP server record",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/mcp/setup": {
      "get": {
        "operationId": "getMcpSetup",
        "summary": "MCP setup guide",
        "description": "Markdown instructions for registering, authenticating and deploying through remote MCP. Public.",
        "tags": [
          "mcp"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Markdown",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "get": {
        "operationId": "getOAuthMetadata",
        "summary": "OAuth authorization server metadata",
        "description": "RFC 8414 metadata: token endpoint, grant types and supported scopes. Public.",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "OAuth metadata",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "operationId": "getProtectedResourceMetadata",
        "summary": "OAuth protected resource metadata",
        "description": "RFC 9728 metadata for the MCP resource. Public.",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Protected resource metadata",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "BadRequest": {
        "description": "Malformed request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid credentials",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Credential lacks the required scope",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "No such resource in this account",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict with the current state (for example a quota, budget or busy resource)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token from POST /v1/auth/signup or POST /oauth/token, or a scoped API token issued by the CLI."
      },
      "oauthClientCredentials": {
        "type": "oauth2",
        "description": "Client credentials issued by POST /v1/auth/signup. Include resource=https://api.ample.computer/mcp when the token is for MCP.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.ample.computer/oauth/token",
            "scopes": {
              "servers:read": "Read servers, apps, deployments, logs and operations",
              "servers:write": "Create, deploy, pause, resume and destroy servers and apps",
              "servers:exec": "Run commands and transfer files on a server",
              "volumes:*": "Manage persistent volumes",
              "databases:*": "Manage managed databases",
              "buckets:*": "Manage object storage buckets and credentials",
              "tokens:*": "Manage API tokens and agent credentials",
              "budgets:read": "Read budget status"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "authentication_required"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "SignupRequest": {
        "type": "object",
        "required": [
          "name",
          "request_key"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the agent or person creating the account"
          },
          "request_key": {
            "type": "string",
            "format": "uuid",
            "description": "Fresh UUID v4. Reuse it after a disconnect to fetch the same receipt for ten minutes."
          }
        }
      },
      "SignupResponse": {
        "type": "object",
        "description": "Registration receipt: account identity, free-plan quotas and budget, the claim URL to hand to the person, the fixed account expiry, an access token and reusable client credentials.",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "credentials": {
            "type": "object",
            "properties": {
              "client_id": {
                "type": "string"
              },
              "client_secret": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": true
      },
      "TokenRequest": {
        "type": "object",
        "required": [
          "grant_type"
        ],
        "properties": {
          "grant_type": {
            "type": "string",
            "enum": [
              "client_credentials"
            ]
          },
          "client_id": {
            "type": "string"
          },
          "client_secret": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "description": "Space-separated scopes; defaults to the credential's scopes"
          },
          "resource": {
            "type": "string",
            "format": "uri",
            "example": "https://api.ample.computer/mcp"
          }
        }
      },
      "TokenResponse": {
        "type": "object",
        "description": "OAuth 2.0 token response. Access tokens last at most 15 minutes.",
        "properties": {
          "access_token": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Server": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "srv_8b9d0771"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "Lifecycle state such as running, standby, paused, cold or stopped"
          },
          "region": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "s-1vcpu-1gb"
          },
          "template": {
            "type": "string",
            "description": "Build template (node, python, go, ...)"
          },
          "ipv4": {
            "type": [
              "string",
              "null"
            ]
          },
          "always_on": {
            "type": "boolean"
          },
          "auto_pause_secs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "wake_strategy": {
            "type": "string"
          },
          "root_disk_limit_mb": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "ready_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "CreateServerRequest": {
        "type": "object",
        "required": [
          "name",
          "size"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "s-1vcpu-1gb"
          },
          "region": {
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "always_on": {
            "type": "boolean",
            "default": false,
            "description": "Operator privilege; non-admin requests receive always_on_unavailable"
          },
          "auto_pause_secs": {
            "type": "integer"
          },
          "wake_strategy": {
            "type": "string"
          },
          "root_disk_limit_mb": {
            "type": "integer"
          },
          "volume": {
            "type": "string",
            "description": "Volume id to attach"
          },
          "placement_node_id": {
            "type": "string"
          }
        }
      },
      "Deployment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "dep_48ed136b"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "live, failed, or an in-progress state"
          },
          "unchanged": {
            "type": "boolean",
            "description": "True when the source, config and env matched the live release and nothing was rebuilt"
          },
          "server_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      },
      "CreateDatabaseRequest": {
        "type": "object",
        "required": [
          "name",
          "engine"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "engine": {
            "type": "string",
            "enum": [
              "postgres",
              "mysql",
              "redis",
              "mongodb"
            ]
          },
          "version": {
            "type": "string"
          },
          "size": {
            "type": "string",
            "example": "s-1vcpu-1gb"
          },
          "region": {
            "type": "string"
          }
        }
      },
      "CreateBucketRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "size_quota_mb": {
            "type": "integer"
          },
          "region": {
            "type": "string"
          }
        }
      },
      "CreateVolumeRequest": {
        "type": "object",
        "required": [
          "name",
          "size_mb"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "size_mb": {
            "type": "integer"
          },
          "database_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SetBudgetRequest": {
        "type": "object",
        "properties": {
          "monthly_max": {
            "type": [
              "number",
              "null"
            ]
          },
          "daily_max": {
            "type": [
              "number",
              "null"
            ]
          },
          "hard_stop": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "CatalogSearchRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "hard_constraints": {
            "type": "object",
            "additionalProperties": true,
            "description": "Unknown constraints are never a fit"
          },
          "preferences": {
            "type": "object",
            "additionalProperties": true
          },
          "limit": {
            "type": "integer"
          },
          "cursor": {
            "type": "string"
          }
        }
      }
    }
  }
}
