{
  "openapi": "3.1.0",
  "info": {
    "title": "21 Cloud Functions Runtime — control API",
    "description": "Self-hosted functions runtime: management API.",
    "contact": {
      "name": "Alex Sayfi",
      "email": "alex@sayfi.uz"
    },
    "license": {
      "name": "Apache-2.0",
      "identifier": "Apache-2.0"
    },
    "version": "1.0.0"
  },
  "paths": {
    "/v1/keys": {
      "get": {
        "tags": [
          "keys"
        ],
        "summary": "The keys of the caller's own tenant that are not revoked (a key limited to some projects sees\nonly the keys limited to some of those). Never shows a secret.",
        "operationId": "tokens_list",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TokenView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "keys"
        ],
        "summary": "Create a key in the caller's own tenant. The new key holds at most the caller's scopes and\nproject and environment restriction and does not outlive it; an omitted restriction or expiry is the caller's\nown. The secret is shown once.",
        "operationId": "tokens_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTokenBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyCreated"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/keys/{key}": {
      "delete": {
        "tags": [
          "keys"
        ],
        "summary": "Revoke a key of the caller's own tenant; it stops authenticating at once.",
        "operationId": "tokens_delete",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "description": "key id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/limits": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "The caller's tenant: its plan, and per quota the limit, what is used and what remains. Daily\ncounters (invocations, egress) reset at UTC midnight (`resets_at`).",
        "operationId": "limits_get",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitsView"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "Who the credentials are: principal, tenant, key, scopes, project and environment restriction, and the\ntenant's effective plan (with its overrides). Any authenticated caller.",
        "operationId": "me_get",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeView"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/node/cache": {
      "get": {
        "tags": [
          "node"
        ],
        "summary": "Tier sizes, hit rates, top entries.",
        "operationId": "node_cache",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/node/config": {
      "get": {
        "tags": [
          "node"
        ],
        "summary": "The configuration the node runs with (`rt.toml` plus reloads), credentials masked; operator\nonly. Node secrets (root token, master keys) are never part of it.",
        "operationId": "node_config_get",
        "responses": {
          "200": {
            "description": "The node configuration (rt.toml sections), credentials masked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "node"
        ],
        "summary": "Live-updatable knobs; restart-only keys come back as `pending_restart`.",
        "operationId": "node_config_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NodeConfigUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeConfigApplied"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/node/drain": {
      "post": {
        "tags": [
          "node"
        ],
        "operationId": "node_drain",
        "responses": {
          "202": {
            "description": "draining"
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/node/scheduler": {
      "get": {
        "tags": [
          "node"
        ],
        "summary": "P/M/queue snapshot (schedtrace JSON) plus `admission` (node-wide waiting tasks and bounds) and\n`services` (per service: `service_id`, `tenant_id`, `slug` and the `AdmissionView` fields:\nadaptive limit and its instance bounds, running, queued, smoothed queue wait, timeouts, demand,\nwarm target, arrival rate, the reason of the limit's last move); operator only.",
        "operationId": "node_scheduler",
        "responses": {
          "200": {
            "description": "SchedSnapshot + admission + services",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/node/status": {
      "get": {
        "tags": [
          "node"
        ],
        "summary": "Capacity, memory, profile, mode, P kinds.",
        "operationId": "node_status",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeStatus"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/plans": {
      "get": {
        "tags": [
          "tenants"
        ],
        "summary": "The configured plans (`[plans.*]`); operator only. A tenant reads its own plan from `/v1/me`.",
        "operationId": "plans_list",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PlanView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "The tenant's projects, ordered by slug.",
        "operationId": "projects_list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50, max 200).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from a previous `next_cursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectPage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "projects"
        ],
        "summary": "Create a project. Its slug is unique within the tenant and cannot change.",
        "operationId": "projects_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{p}": {
      "get": {
        "tags": [
          "projects"
        ],
        "operationId": "projects_get",
        "parameters": [
          {
            "name": "p",
            "in": "path",
            "description": "project slug or prj_ id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "projects"
        ],
        "summary": "Delete a project that has no services.",
        "operationId": "projects_delete",
        "parameters": [
          {
            "name": "p",
            "in": "path",
            "description": "project slug or prj_ id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "projects"
        ],
        "summary": "Rename a project or replace its environment list. A service in an environment you drop makes\nthe change `409 environment_in_use`.",
        "operationId": "projects_patch",
        "parameters": [
          {
            "name": "p",
            "in": "path",
            "description": "project slug or prj_ id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchProjectBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/projects/{p}/environments": {
      "get": {
        "tags": [
          "projects"
        ],
        "summary": "The environments services of the project may be in.",
        "operationId": "environments_get",
        "parameters": [
          {
            "name": "p",
            "in": "path",
            "description": "project slug or prj_ id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentsView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdk-grants": {
      "get": {
        "tags": [
          "sdks"
        ],
        "summary": "Every grant.",
        "operationId": "grants_list",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SdkGrantView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "sdks"
        ],
        "summary": "Write the grant of `(scope, sdk)`; with no effect, requirement or channel it is deleted (`204`).",
        "operationId": "grants_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SdkGrantBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SdkGrantView"
                }
              }
            }
          },
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdks": {
      "get": {
        "tags": [
          "sdks"
        ],
        "summary": "Every SDK with its channels.",
        "operationId": "sdks_list",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SdkView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "sdks"
        ],
        "summary": "Publish a release: the source is validated like a version upload, its contract read from the\n`defineSdk` methods (or given), and it runs as a version of the SDK's system service. The first\nrelease becomes `stable`; later ones only move the `channel` asked for.",
        "operationId": "sdks_publish",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishSdkBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SdkReleaseView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdks/effective": {
      "get": {
        "tags": [
          "sdks"
        ],
        "summary": "The SDKs this key's tenant may call from a project and environment, and the release each runs.",
        "operationId": "sdks_effective",
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "description": "Project slug or `prj_…` id (default: `default`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "description": "Environment (default: `production`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "description": "`GET …/contract`, operator: a release instead of the resolved one.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EffectiveSdkView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdks/{name}": {
      "delete": {
        "tags": [
          "sdks"
        ],
        "summary": "Remove an SDK: calls answer `sdk_unavailable`, new deploys cannot import it. Its releases are\nkept; publishing again restores it.",
        "operationId": "sdks_remove",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "SDK name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdks/{name}/channels/{channel}": {
      "put": {
        "tags": [
          "sdks"
        ],
        "summary": "Point a channel at a release: promote, or roll back (the old version is kept as `previous`).",
        "operationId": "sdks_set_channel",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "SDK name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "path",
            "description": "channel",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetChannelBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SdkChannelView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdks/{name}/contract": {
      "get": {
        "tags": [
          "sdks"
        ],
        "summary": "The `.d.ts` of the release this key's grants select (`21ci sdk types`); the operator may name\nany release with `?version=`. An SDK the tenant is not granted does not exist for it (404).",
        "operationId": "sdks_contract",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "SDK name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "query",
            "description": "Project slug or `prj_…` id (default: `default`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "description": "Environment (default: `production`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "description": "`GET …/contract`, operator: a release instead of the resolved one.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "the contract (`.d.ts`)",
            "content": {
              "text/plain": {}
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sdks/{name}/releases": {
      "get": {
        "tags": [
          "sdks"
        ],
        "summary": "The releases of an SDK, oldest first.",
        "operationId": "sdks_releases",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "description": "SDK name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SdkReleaseView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services": {
      "get": {
        "tags": [
          "services"
        ],
        "summary": "`?slug=<slug>` returns a list with 0 or 1 item.",
        "operationId": "services_list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "query",
            "description": "Exact slug match.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "query",
            "description": "Only services of this project (slug or `prj_…` id).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "description": "Only services in this environment.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicePage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "services"
        ],
        "operationId": "services_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateServiceBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}": {
      "get": {
        "tags": [
          "services"
        ],
        "operationId": "services_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "services"
        ],
        "operationId": "services_delete",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "keep_data",
            "in": "query",
            "description": "`1|true|yes|on` keeps the service's data.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "services"
        ],
        "operationId": "services_patch",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchServiceBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "412": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/data/export": {
      "get": {
        "tags": [
          "services"
        ],
        "summary": "Consistent SQLite snapshot of the service's `data.db` (scope `data:admin`).",
        "operationId": "data_export",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SQLite database file",
            "content": {
              "application/vnd.sqlite3": {}
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/dlq": {
      "get": {
        "tags": [
          "queue"
        ],
        "operationId": "dlq_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "queue"
        ],
        "operationId": "dlq_purge",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/dlq/redrive": {
      "post": {
        "tags": [
          "queue"
        ],
        "operationId": "dlq_redrive",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Redriven"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/env": {
      "get": {
        "tags": [
          "env"
        ],
        "operationId": "env_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvMap"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "env"
        ],
        "summary": "Replaces the whole map.",
        "operationId": "env_put",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvMap"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvMap"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/events": {
      "get": {
        "tags": [
          "observability"
        ],
        "operationId": "events_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50, max 200).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from a previous `next_cursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventsPage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/hosts": {
      "get": {
        "tags": [
          "hosts"
        ],
        "operationId": "hosts_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HostView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/hosts/{host}": {
      "get": {
        "tags": [
          "hosts"
        ],
        "summary": "One custom host of the service (status, verify token, expiry); `404` when the host is not\nmapped to this service.",
        "operationId": "hosts_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "host",
            "in": "path",
            "description": "custom host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "hosts"
        ],
        "operationId": "hosts_put",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "host",
            "in": "path",
            "description": "custom host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HostView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "hosts"
        ],
        "operationId": "hosts_delete",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "host",
            "in": "path",
            "description": "custom host",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/live": {
      "put": {
        "tags": [
          "services"
        ],
        "summary": "`409 version_not_ready` for a failed version; `pending` is accepted.",
        "operationId": "services_set_live",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetLiveBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "412": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/logs": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "JSON page, or Server-Sent Events when `follow` is truthy (`Last-Event-ID` resumes).",
        "operationId": "logs_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "task_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "follow",
            "in": "query",
            "description": "`1|true|yes|on` switches to Server-Sent Events.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE when follow=1",
            "content": {
              "text/event-stream": {}
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/objects": {
      "get": {
        "tags": [
          "sockets"
        ],
        "operationId": "objects_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "description": "Only objects whose name starts with this.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "`next_cursor` of the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-1000 (default 100).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectPage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/objects/{name}": {
      "delete": {
        "tags": [
          "sockets"
        ],
        "operationId": "object_delete",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "object name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/objects/{name}/sockets": {
      "get": {
        "tags": [
          "sockets"
        ],
        "operationId": "sockets_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "object name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Only sockets with this tag.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1-1000 (default 100).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocketPage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "sockets"
        ],
        "operationId": "sockets_close",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "object name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "Close code: 1000 (default) or 3000-4999.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "reason",
            "in": "query",
            "description": "Close reason, at most 123 bytes.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "`DELETE …/sockets` only: close the sockets with this tag (default every socket of the object).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClosedView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/objects/{name}/sockets/{ws}": {
      "delete": {
        "tags": [
          "sockets"
        ],
        "operationId": "socket_close",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "object name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ws",
            "in": "path",
            "description": "socket id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "Close code: 1000 (default) or 3000-4999.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "reason",
            "in": "query",
            "description": "Close reason, at most 123 bytes.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "`DELETE …/sockets` only: close the sockets with this tag (default every socket of the object).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/queue": {
      "get": {
        "tags": [
          "queue"
        ],
        "operationId": "queue_stats",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueStatsView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "queue"
        ],
        "operationId": "queue_enqueue",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnqueueBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Enqueued"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/schedules": {
      "get": {
        "tags": [
          "schedules"
        ],
        "operationId": "schedules_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduleView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "schedules"
        ],
        "operationId": "schedules_create",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/schedules/once": {
      "get": {
        "tags": [
          "schedules"
        ],
        "operationId": "schedules_once_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50, max 200).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from a previous `next_cursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OncePage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/schedules/{id}": {
      "delete": {
        "tags": [
          "schedules"
        ],
        "operationId": "schedules_delete",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "schedule id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "schedules"
        ],
        "operationId": "schedules_patch",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "schedule id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/secrets": {
      "get": {
        "tags": [
          "secrets"
        ],
        "summary": "Names and update times only; values are write-only.",
        "operationId": "secrets_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SecretNameView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/secrets/{name}": {
      "put": {
        "tags": [
          "secrets"
        ],
        "operationId": "secrets_put",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "secret name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSecretBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "secrets"
        ],
        "operationId": "secrets_delete",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "secret name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/stats": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Request counts, error rate and phase percentiles of a window, plus `admission`: the service's\nqueueing and autoscaler state (`AdmissionView`, `null` while it has none).",
        "operationId": "stats_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "`5m` | `1h` | `24h`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/types": {
      "get": {
        "tags": [
          "versions"
        ],
        "summary": "The RPC surface of a Deno service as TypeScript declarations (`21ci types`): read from the\nsource of the live version (or `?version=`), never run.",
        "operationId": "services_types",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "query",
            "description": "A version number (default: the live version).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "the `.d.ts` of the service's `rpc` export",
            "content": {
              "text/plain": {}
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/versions": {
      "get": {
        "tags": [
          "versions"
        ],
        "operationId": "versions_list",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/VersionView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "versions"
        ],
        "summary": "Raw body upload; `Content-Type` selects the format.",
        "operationId": "versions_upload",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "activate",
            "in": "query",
            "description": "Activate (flip `live`) once accepted (`1|true|yes|on`).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "close_sockets",
            "in": "query",
            "description": "With `activate`: close the service's WebSockets with 1012 once the version is live\n(`1|true|yes|on`; default: sockets stay open and the next event runs the new version).",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "compile",
            "in": "query",
            "description": "`lazy` | `eager`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "format": "int32",
                  "minimum": 0
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionView"
                }
              }
            }
          },
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/versions/{v}": {
      "get": {
        "tags": [
          "versions"
        ],
        "operationId": "versions_get",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "description": "version number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/versions/{v}/build/logs": {
      "get": {
        "tags": [
          "versions"
        ],
        "summary": "Build log as Server-Sent Events.",
        "operationId": "versions_build_logs",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "description": "version number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream of build log records",
            "content": {
              "text/event-stream": {}
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/versions/{v}/rebuild": {
      "post": {
        "tags": [
          "versions"
        ],
        "summary": "Clears a failed build (negative cache) and rebuilds.",
        "operationId": "versions_rebuild",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "description": "version number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "202": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/services/{s}/versions/{v}/source": {
      "get": {
        "tags": [
          "versions"
        ],
        "operationId": "versions_source",
        "parameters": [
          {
            "name": "s",
            "in": "path",
            "description": "service id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "v",
            "in": "path",
            "description": "version number",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "source artifact bytes",
            "content": {
              "application/octet-stream": {}
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tenants": {
      "get": {
        "tags": [
          "tenants"
        ],
        "operationId": "tenants_list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 50, max 200).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from a previous `next_cursor`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantPage"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "tenants"
        ],
        "operationId": "tenants_create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tenants/{t}": {
      "get": {
        "tags": [
          "tenants"
        ],
        "operationId": "tenants_get",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "tenants"
        ],
        "operationId": "tenants_delete",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "purge",
            "in": "query",
            "description": "`1|true|yes|on` (case-insensitive) deletes the tenant's data too.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "tenants"
        ],
        "operationId": "tenants_patch",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchTenantBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantView"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tenants/{t}/keys": {
      "get": {
        "tags": [
          "keys"
        ],
        "operationId": "keys_list",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KeyView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "keys"
        ],
        "summary": "The secret is shown once.",
        "operationId": "keys_create",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyCreated"
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tenants/{t}/keys/{key}": {
      "delete": {
        "tags": [
          "keys"
        ],
        "operationId": "keys_delete",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "description": "key id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/tenants/{t}/usage": {
      "get": {
        "tags": [
          "tenants"
        ],
        "operationId": "tenants_usage",
        "parameters": [
          {
            "name": "t",
            "in": "path",
            "description": "tenant id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "`YYYY-MM-DD`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UsageView"
                  }
                }
              }
            }
          },
          "401": {
            "description": "missing, invalid, revoked or expired credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "not_found: unknown, or not visible to this key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/version": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "The node and API versions; any authenticated caller (no node internals).",
        "operationId": "version_get",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionInfo"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "insufficient_scope, quota_exceeded or another refusal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited (with Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AdmissionView": {
        "type": "object",
        "description": "A service's admission and autoscaler state (decision D-A3): the adaptive concurrency limit,\nwhat runs and waits, and what the autoscaler has learned.",
        "required": [
          "kind",
          "limit",
          "min",
          "max",
          "running",
          "queued",
          "queued_bytes",
          "max_queued",
          "queue_wait_ms",
          "queue_timeouts",
          "demand",
          "warm_per_proc",
          "instances",
          "min_instances",
          "max_instances",
          "target_instances",
          "rps",
          "idle_ms"
        ],
        "properties": {
          "demand": {
            "type": "number",
            "format": "double",
            "description": "Decaying peak of running tasks (warm capacity follows it)."
          },
          "idle_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Milliseconds since the service last started or finished a task.",
            "minimum": 0
          },
          "instances": {
            "type": "integer",
            "format": "int32",
            "description": "Instances running now: concurrently running copies of the service (the same as `running`).",
            "minimum": 0
          },
          "kind": {
            "type": "string",
            "description": "Kind of the service's latest task: `deno` | `wasm` | `build`."
          },
          "last_change": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/LimitChangeView",
                "description": "The latest move of the limit and why; `null` if it never moved."
              }
            ]
          },
          "latency_baseline_ms": {
            "type": [
              "number",
              "null"
            ],
            "format": "double",
            "description": "Latency baseline (ms) the autoscaler holds the limit against; `null` before samples."
          },
          "limit": {
            "type": "integer",
            "format": "int32",
            "description": "Current adaptive concurrency limit.",
            "minimum": 0
          },
          "max": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "max_instances": {
            "type": "integer",
            "format": "int32",
            "description": "Most instances at once (`scaling.max_instances`, the plan's `max_instances`, the profile\nceiling and the tenant cap): the same as `max`; excess requests queue.",
            "minimum": 0
          },
          "max_queued": {
            "type": "integer",
            "format": "int32",
            "description": "Bound of the service's wait queue (over it `503 overloaded`).",
            "minimum": 0
          },
          "min": {
            "type": "integer",
            "format": "int32",
            "description": "Bounds of the limit (`scaling.min`.. the ceiling and the plan's tenant cap).",
            "minimum": 0
          },
          "min_instances": {
            "type": "integer",
            "format": "int32",
            "description": "Instances kept warm and floor of the limit (`scaling.min_instances`, within the plan's\n`max_instances`; 0 = scales to zero when idle).",
            "minimum": 0
          },
          "queue_timeouts": {
            "type": "integer",
            "format": "int64",
            "description": "`503 queue_timeout` answers since the state was created.",
            "minimum": 0
          },
          "queue_wait_ms": {
            "type": "number",
            "format": "double",
            "description": "Smoothed wait (ms) of the requests that had to queue; fades to 0 while requests start\nwithout waiting."
          },
          "queued": {
            "type": "integer",
            "format": "int32",
            "description": "Tasks waiting for a run slot, and the bytes charged to them.",
            "minimum": 0
          },
          "queued_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "rps": {
            "type": "number",
            "format": "double",
            "description": "Smoothed arrival rate, requests per second."
          },
          "running": {
            "type": "integer",
            "format": "int32",
            "description": "Tasks holding a run slot.",
            "minimum": 0
          },
          "target_instances": {
            "type": "integer",
            "format": "int32",
            "description": "Warm instances the autoscaler wants kept ready in total (`warm_per_proc` times the\nprocessors of the kind; at least `min_instances` once the service has run).",
            "minimum": 0
          },
          "warm_per_proc": {
            "type": "integer",
            "format": "int32",
            "description": "Warm instances the autoscaler asks each processor of the kind to keep (0 = scale to zero).",
            "minimum": 0
          }
        }
      },
      "ClosedView": {
        "type": "object",
        "required": [
          "closed"
        ],
        "properties": {
          "closed": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "CreateKeyBody": {
        "type": "object",
        "required": [
          "scopes"
        ],
        "properties": {
          "environments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Environments the key may touch (`null` = all environments)."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "RFC 3339 timestamp."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "project_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Projects the key may touch (`prj_…` ids of the tenant; `null` = all projects)."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Scopes such as `services:read`, `deploy`, `invoke`."
          }
        }
      },
      "CreateProjectBody": {
        "type": "object",
        "required": [
          "slug"
        ],
        "properties": {
          "environments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Environments services of the project may be in (default `[\"production\"]`): 1 to 20 labels\nmatching `^[a-z][a-z0-9-]{0,31}$`."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Display name (default: the slug)."
          },
          "slug": {
            "type": "string",
            "description": "`^[a-z][a-z0-9-]{1,62}$`; unique per tenant, cannot be changed."
          }
        }
      },
      "CreateServiceBody": {
        "type": "object",
        "required": [
          "slug",
          "runtime"
        ],
        "properties": {
          "access": {
            "type": [
              "string",
              "null"
            ],
            "description": "`public` | `key` | `internal`."
          },
          "call": {
            "type": [
              "object",
              "null"
            ],
            "description": "`{\"allowed_callers\": [\"<slug>\" | \"svc_…\" | \"env:<name>\", …]}`: who may call this service\n(empty = same-environment services of the tenant)."
          },
          "deno": {
            "type": [
              "object",
              "null"
            ],
            "description": "Deno knobs: `{\"reuse_isolates\": bool}` (unset = node config, then the profile's value)."
          },
          "durable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "A durable service: its objects are chosen in code (`durable.get(name)`), each with its own\nstorage and alarm, events and requests one at a time per object (default false)."
          },
          "egress": {
            "type": [
              "object",
              "null"
            ]
          },
          "environment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Environment label, `^[a-z][a-z0-9-]{0,31}$` (default `production`); one of the project's\nenvironments."
          },
          "ingress": {
            "type": [
              "object",
              "null"
            ]
          },
          "limits": {
            "type": [
              "object",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "profile": {
            "type": [
              "string",
              "null"
            ]
          },
          "project": {
            "type": [
              "string",
              "null"
            ],
            "description": "Project to create the service in: its slug or `prj_…` id (default `default`)."
          },
          "runtime": {
            "type": "string",
            "description": "`deno` | `wasm`."
          },
          "scaling": {
            "type": [
              "object",
              "null"
            ]
          },
          "slug": {
            "type": "string",
            "description": "`^[a-z][a-z0-9-]{1,62}$`"
          },
          "triggers": {
            "type": [
              "object",
              "null"
            ]
          },
          "wasm": {
            "type": [
              "object",
              "null"
            ],
            "description": "WASM knobs: `{\"reuse_instances\": bool}` (unset = the profile's value)."
          },
          "ws": {
            "type": [
              "object",
              "null"
            ],
            "description": "WebSocket knobs: `{\"allowed_origins\": [..], \"warm\": bool}`."
          }
        }
      },
      "CreateTenantBody": {
        "type": "object",
        "required": [
          "name",
          "plan"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "overrides": {
            "type": [
              "object",
              "null"
            ]
          },
          "plan": {
            "type": "string",
            "description": "Plan name from config."
          }
        }
      },
      "CreateTokenBody": {
        "type": "object",
        "description": "`POST /v1/keys`: the scopes and project and environment restrictions must be within the\ncreating key's own; an omitted `project_ids` / `environments` / `expires_at` is the creating\nkey's own restriction / expiry.",
        "required": [
          "scopes"
        ],
        "properties": {
          "environments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Limit the key to these environments (a subset of the creating key's restriction)."
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "RFC 3339 timestamp in the future, not later than the creating key's own expiry."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "project_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Limit the key to these projects (`prj_…` ids; a subset of the creating key's restriction)."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Scopes such as `services:read`, `deploy`; each one the creating key holds."
          }
        }
      },
      "EffectiveSdkView": {
        "type": "object",
        "description": "An SDK the caller's grants allow, and the release they select (tenant view).",
        "required": [
          "name",
          "channel",
          "version_reqs",
          "members"
        ],
        "properties": {
          "channel": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "members": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": [
              "string",
              "null"
            ],
            "description": "The release a call runs now; `null` when none satisfies the grants (`reason`)."
          },
          "version_reqs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "EnqueueBody": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "object"
          },
          "dedup_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "delay_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "Enqueued": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "EnvMap": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "propertyNames": {
          "type": "string"
        }
      },
      "EnvironmentsView": {
        "type": "object",
        "description": "`GET /v1/projects/{p}/environments`.",
        "required": [
          "project",
          "environments"
        ],
        "properties": {
          "environments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "project": {
            "type": "string",
            "description": "Slug of the project."
          }
        }
      },
      "ErrorBody": {
        "type": "object",
        "description": "Body of an error response.",
        "required": [
          "code",
          "message",
          "details"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Stable machine-readable code."
          },
          "details": {
            "type": "object",
            "description": "Extra structured data (e.g. validation diagnostics `[{file,line,col,message}]`)."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "description": "The envelope returned for every control error.",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        }
      },
      "EventView": {
        "type": "object",
        "required": [
          "id",
          "ts",
          "kind",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "ts": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "EventsPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "HostView": {
        "type": "object",
        "required": [
          "host",
          "status",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms when the claim was made."
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Unix ms when a pending claim expires (`hosts.pending_ttl`); `null` once active."
          },
          "host": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "`pending_verification` | `active`."
          },
          "verify_token": {
            "type": [
              "string",
              "null"
            ],
            "description": "TXT value for `_rt-verify.<host>` while pending."
          }
        }
      },
      "KeyCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/KeyView"
          },
          {
            "type": "object",
            "required": [
              "secret"
            ],
            "properties": {
              "secret": {
                "type": "string",
                "description": "The full `rtk_<id>_<secret>` string."
              }
            }
          }
        ],
        "description": "Returned once at creation; `GET …/keys` never shows the secret again."
      },
      "KeyView": {
        "type": "object",
        "required": [
          "id",
          "scopes",
          "created_at"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "environments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "`null` = every environment."
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "id": {
            "type": "string"
          },
          "last_used_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "project_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "`null` = every project of the tenant."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "LimitChangeView": {
        "type": "object",
        "description": "One move of a service's concurrency limit (`admission.last_change`).",
        "required": [
          "reason",
          "from",
          "to",
          "ago_ms"
        ],
        "properties": {
          "ago_ms": {
            "type": "integer",
            "format": "int64",
            "description": "Milliseconds since the move.",
            "minimum": 0
          },
          "from": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "reason": {
            "type": "string",
            "description": "What moved it: `queue` (requests waited), `trend` (arrival rate rose fast), `latency`,\n`memory`, `cpu`, `idle` (unused limit decays), `bounds` (the service or its plan changed)."
          },
          "to": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "LimitsView": {
        "type": "object",
        "description": "`GET /v1/limits`: the tenant's plan limits and what is left of them today.",
        "required": [
          "plan",
          "day",
          "resets_at",
          "invocations",
          "egress_bytes",
          "storage_bytes",
          "services",
          "schedules"
        ],
        "properties": {
          "day": {
            "type": "string",
            "description": "UTC day the daily counters belong to (`YYYY-MM-DD`)."
          },
          "egress_bytes": {
            "$ref": "#/components/schemas/QuotaView"
          },
          "invocations": {
            "$ref": "#/components/schemas/QuotaView"
          },
          "plan": {
            "type": "string",
            "description": "Plan name."
          },
          "resets_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms when the daily counters reset."
          },
          "schedules": {
            "$ref": "#/components/schemas/QuotaView",
            "description": "`plan.max_schedules` applies per service: `used` is the most schedules any one service has."
          },
          "services": {
            "$ref": "#/components/schemas/QuotaView"
          },
          "storage_bytes": {
            "$ref": "#/components/schemas/QuotaView"
          }
        }
      },
      "LogView": {
        "type": "object",
        "required": [
          "seq",
          "ts",
          "level",
          "service_id",
          "version",
          "trigger",
          "kind",
          "msg",
          "truncated"
        ],
        "properties": {
          "fields": {
            "type": [
              "object",
              "null"
            ],
            "description": "Structured fields of a `std:log` record; absent on plain records."
          },
          "kind": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "msg": {
            "type": "string"
          },
          "seq": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "service_id": {
            "type": "string"
          },
          "task_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "trigger": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "ts": {
            "type": "integer",
            "format": "int64"
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "LogsPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MeView": {
        "type": "object",
        "description": "`GET /v1/me`: who the credentials are and what they may do.",
        "required": [
          "principal",
          "scopes",
          "version"
        ],
        "properties": {
          "environments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Environments the key is limited to (`null` = every environment)."
          },
          "key_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The key (`key_…`) of a tenant principal."
          },
          "plan": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlanView",
                "description": "The tenant's effective plan; `null` for the operator without `x-rt-tenant`."
              }
            ]
          },
          "principal": {
            "type": "string",
            "description": "`operator` | `tenant`."
          },
          "project_ids": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Projects the key is limited to (`prj_…` ids; `null` = every project of the tenant)."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Scopes held (the operator holds all)."
          },
          "tenant_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The tenant acted on: the key's tenant, or the operator's `x-rt-tenant`."
          },
          "version": {
            "type": "string",
            "description": "Node version."
          }
        }
      },
      "NodeConfigApplied": {
        "type": "object",
        "required": [
          "applied",
          "pending_restart"
        ],
        "properties": {
          "applied": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keys applied live."
          },
          "pending_restart": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Keys that need a restart."
          }
        }
      },
      "NodeConfigUpdate": {
        "type": "object",
        "description": "Body of `PUT /v1/node/config`.",
        "properties": {
          "default_profile": {
            "type": [
              "string",
              "null"
            ],
            "description": "Profile name: `max_density` | `balanced` | `min_latency`."
          },
          "degradation_mode": {
            "type": [
              "string",
              "null"
            ],
            "description": "`normal` | `shed` | `drain`."
          },
          "rate_limit": {
            "type": [
              "object",
              "null"
            ],
            "description": "Rate-limit tweaks (`rps`, `burst`)."
          }
        }
      },
      "NodeSockets": {
        "type": "object",
        "description": "`status.sockets`: open sockets, objects holding them, accepted sockets not connected yet, and\nthe node's cap (`ws.max_sockets`).",
        "required": [
          "open",
          "objects",
          "pending",
          "max"
        ],
        "properties": {
          "max": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "objects": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "open": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "pending": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "NodeStatus": {
        "type": "object",
        "required": [
          "version",
          "mode",
          "default_profile",
          "v8_sandbox",
          "processors",
          "kinds",
          "memory",
          "inflight",
          "sockets"
        ],
        "properties": {
          "default_profile": {
            "type": "string"
          },
          "inflight": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "kinds": {
            "type": "object",
            "description": "Processors per kind: `{\"deno\": 3, \"wasm\": 1, \"build\": 1}`."
          },
          "memory": {
            "type": "object"
          },
          "mode": {
            "type": "string",
            "description": "`normal` | `shed` | `drain`."
          },
          "processors": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "sockets": {
            "$ref": "#/components/schemas/NodeSockets",
            "description": "WebSockets the node holds."
          },
          "v8_sandbox": {
            "type": "boolean",
            "description": "`false` with the prebuilt-V8 MVP builds."
          },
          "version": {
            "type": "string"
          }
        }
      },
      "ObjectPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ObjectView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ObjectView": {
        "type": "object",
        "required": [
          "name",
          "sockets",
          "storage"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "sockets": {
            "type": "integer",
            "format": "int32",
            "description": "Open sockets of the object.",
            "minimum": 0
          },
          "storage": {
            "type": "boolean",
            "description": "The object has durable storage (keys or an alarm)."
          }
        }
      },
      "OncePage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnceScheduleView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "OnceScheduleView": {
        "type": "object",
        "description": "A pending one-off schedule (`std:schedule`). Its payload and enabled flag are not listed.",
        "required": [
          "id",
          "kind",
          "run_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "Always `once`."
          },
          "run_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms when the schedule is due."
          }
        }
      },
      "PatchProjectBody": {
        "type": "object",
        "description": "Each provided field replaces that field.",
        "properties": {
          "environments": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "The complete new list. Dropping an environment a service is in is `409 environment_in_use`."
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PatchServiceBody": {
        "type": "object",
        "description": "Top-level block merge: each provided block replaces that block.",
        "properties": {
          "access": {
            "type": [
              "string",
              "null"
            ]
          },
          "call": {
            "type": [
              "object",
              "null"
            ],
            "description": "Replaces the `call` block (`allowed_callers`)."
          },
          "deno": {
            "type": [
              "object",
              "null"
            ],
            "description": "Replaces the `deno` block (`reuse_isolates`)."
          },
          "durable": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Makes the service durable (or not)."
          },
          "egress": {
            "type": [
              "object",
              "null"
            ]
          },
          "environment": {
            "type": [
              "string",
              "null"
            ],
            "description": "Environment label, `^[a-z][a-z0-9-]{0,31}$`; one of the service's project's environments."
          },
          "ingress": {
            "type": [
              "object",
              "null"
            ]
          },
          "limits": {
            "type": [
              "object",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "profile": {
            "type": [
              "string",
              "null"
            ]
          },
          "project": {
            "type": [
              "string",
              "null"
            ],
            "description": "The service's current project (slug or `prj_…` id). A service cannot move between\nprojects: any other project is `422`."
          },
          "scaling": {
            "type": [
              "object",
              "null"
            ]
          },
          "triggers": {
            "type": [
              "object",
              "null"
            ]
          },
          "wasm": {
            "type": [
              "object",
              "null"
            ],
            "description": "Replaces the `wasm` block (`reuse_instances`)."
          },
          "ws": {
            "type": [
              "object",
              "null"
            ],
            "description": "Replaces the `ws` block (`allowed_origins`, `warm`)."
          }
        }
      },
      "PatchTenantBody": {
        "type": "object",
        "properties": {
          "disabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "overrides": {
            "type": [
              "object",
              "null"
            ],
            "description": "Replaces the tenant's plan overrides."
          },
          "plan": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlanView": {
        "type": "object",
        "description": "One plan from the node config (`GET /v1/plans`), or a tenant's effective plan (`GET /v1/me`).",
        "required": [
          "name",
          "settings"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "settings": {
            "type": "object",
            "description": "The plan's settings (`max_services`, `rps`, `limits_max`, `custom_host_suffixes`, …); in\n`/v1/me` with the tenant's overrides applied."
          }
        }
      },
      "ProjectPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProjectView": {
        "type": "object",
        "required": [
          "id",
          "tenant_id",
          "slug",
          "name",
          "environments",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "environments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PublishSdkBody": {
        "type": "object",
        "description": "`POST /v1/sdks`: one release of an SDK.",
        "required": [
          "name",
          "version",
          "source"
        ],
        "properties": {
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "description": "Point this channel at the release (default: `stable` for the SDK's first release)."
          },
          "content_type": {
            "type": [
              "string",
              "null"
            ],
            "description": "The upload's format, as for a version upload (default `application/typescript` for Deno,\n`application/wasm` for WASM)."
          },
          "contract": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `.d.ts` tenants download (default: generated from the `defineSdk` methods). Required\nfor a WASM SDK, with `members`."
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "members": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Top-level contract names (default: from the `defineSdk` methods)."
          },
          "name": {
            "type": "string",
            "description": "`^[a-z][a-z0-9_]{1,31}$`: what tenants import (`std:sdk` export, `sdk:<name>`)."
          },
          "runtime": {
            "type": [
              "string",
              "null"
            ],
            "description": "`deno` (default) or `wasm`."
          },
          "source": {
            "type": "string",
            "description": "The upload, base64."
          },
          "version": {
            "type": "string",
            "description": "Semver, `1.4.2`."
          }
        },
        "additionalProperties": false
      },
      "PutSecretBody": {
        "type": "object",
        "required": [
          "value"
        ],
        "properties": {
          "value": {
            "type": "string"
          }
        }
      },
      "QueueStatsView": {
        "type": "object",
        "required": [
          "depth",
          "in_flight",
          "oldest_age_ms",
          "dlq"
        ],
        "properties": {
          "depth": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "dlq": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "in_flight": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "oldest_age_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "QuotaView": {
        "type": "object",
        "description": "One quota: the plan's limit and what is used.",
        "required": [
          "used",
          "period"
        ],
        "properties": {
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "The plan's limit; `null` = unlimited.",
            "minimum": 0
          },
          "period": {
            "type": "string",
            "description": "`day` (counted since UTC midnight), `total` (current holdings), `per_service`."
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "`limit - used` (0 when over); `null` = unlimited.",
            "minimum": 0
          },
          "used": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "Redriven": {
        "type": "object",
        "required": [
          "redriven"
        ],
        "properties": {
          "redriven": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "ScheduleBody": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "cron": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cron expression."
          },
          "enabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "every_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "kind": {
            "type": "string",
            "description": "`interval` | `cron`."
          },
          "payload": {
            "type": [
              "object",
              "null"
            ],
            "description": "JSON handed to the handler; on `PATCH` an absent payload keeps the current one."
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "description": "IANA timezone, default `UTC`."
          }
        }
      },
      "ScheduleView": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "payload",
          "enabled"
        ],
        "properties": {
          "cron": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "every_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "minimum": 0
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "next_due": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "payload": {
            "type": "object"
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SdkChannelView": {
        "type": "object",
        "description": "A channel.",
        "required": [
          "channel",
          "version",
          "updated_at"
        ],
        "properties": {
          "channel": {
            "type": "string"
          },
          "previous": {
            "type": [
              "string",
              "null"
            ],
            "description": "The version it pointed to before the last move (`21ci sdk rollback`)."
          },
          "updated_at": {
            "type": "integer",
            "format": "int64"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "SdkGrantBody": {
        "type": "object",
        "description": "A grant: what a scope may use of an SDK (or of all, `*`). A field left out or `null` inherits.",
        "required": [
          "scope",
          "sdk"
        ],
        "properties": {
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "description": "The channel followed (default `stable`)."
          },
          "effect": {
            "type": [
              "string",
              "null"
            ],
            "description": "`allow` | `deny`."
          },
          "scope": {
            "type": "string",
            "description": "`node`, `plan:<name>`, `tenant:ten_…`, `project:prj_…` or `environment:prj_…/<env>`."
          },
          "sdk": {
            "type": "string",
            "description": "An SDK name or `*`."
          },
          "version_req": {
            "type": [
              "string",
              "null"
            ],
            "description": "Semver requirement (`^1`, `~1.4`, `1.4.2`, `*`). An `allow` without one is pinned to the\nmajor of the SDK's stable release (a new major is a grant change)."
          }
        }
      },
      "SdkGrantView": {
        "type": "object",
        "description": "A stored grant.",
        "required": [
          "scope",
          "sdk",
          "created_by",
          "updated_at"
        ],
        "properties": {
          "channel": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_by": {
            "type": "string"
          },
          "effect": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope": {
            "type": "string"
          },
          "sdk": {
            "type": "string"
          },
          "updated_at": {
            "type": "integer",
            "format": "int64"
          },
          "version_req": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SdkReleaseView": {
        "type": "object",
        "description": "A release.",
        "required": [
          "sdk",
          "version",
          "version_no",
          "members",
          "channels",
          "created_at"
        ],
        "properties": {
          "channels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The channels that point at it."
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "members": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sdk": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "version_no": {
            "type": "integer",
            "format": "int32",
            "description": "The SDK service's version that runs it.",
            "minimum": 0
          }
        }
      },
      "SdkView": {
        "type": "object",
        "description": "An SDK (operator view).",
        "required": [
          "name",
          "state",
          "service_id",
          "channels",
          "releases",
          "created_at"
        ],
        "properties": {
          "channels": {
            "type": "object"
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "latest": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "releases": {
            "type": "integer",
            "description": "Number of releases.",
            "minimum": 0
          },
          "service_id": {
            "type": "string",
            "description": "Its service in the system tenant."
          },
          "state": {
            "type": "string",
            "description": "`active` | `removed`."
          }
        }
      },
      "SecretNameView": {
        "type": "object",
        "required": [
          "name",
          "updated_at"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "updated_at": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ServicePage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ServiceStatus": {
        "type": "object",
        "required": [
          "build_state",
          "tier",
          "inflight"
        ],
        "properties": {
          "admission": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AdmissionView",
                "description": "Queueing and autoscaler state; `null` while the service has none (never run, or idle\nlong enough to be forgotten)."
              }
            ]
          },
          "build_state": {
            "type": "string",
            "description": "`pending` | `building` | `ready` | `failed`."
          },
          "inflight": {
            "type": "integer",
            "format": "int32",
            "description": "Tasks of the service holding a run slot now.",
            "minimum": 0
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "tier": {
            "type": "string",
            "description": "`T1` | `T2` | `T3`."
          }
        }
      },
      "ServiceView": {
        "type": "object",
        "description": "`GET /v1/services/{s}`.",
        "required": [
          "id",
          "tenant_id",
          "slug",
          "runtime",
          "etag",
          "limits",
          "scaling",
          "access",
          "triggers",
          "ingress",
          "egress",
          "project_id",
          "project",
          "environment",
          "call",
          "durable",
          "status",
          "effective"
        ],
        "properties": {
          "access": {
            "type": "string"
          },
          "call": {
            "type": "object",
            "description": "`{\"allowed_callers\": […]}`."
          },
          "deno": {
            "type": "object",
            "description": "`{\"reuse_isolates\": bool}`; omitted while no Deno knob is set."
          },
          "durable": {
            "type": "boolean",
            "description": "A durable service (its objects are chosen in code)."
          },
          "effective": {
            "type": "object",
            "description": "Each value with its source: `{\"cpu_ms\": {\"value\": 1000, \"source\": \"profile:balanced\"}}`."
          },
          "egress": {
            "type": "object"
          },
          "environment": {
            "type": "string",
            "description": "Environment label (default `production`), one of the project's environments."
          },
          "etag": {
            "type": "string",
            "description": "Also sent as the `ETag` header."
          },
          "id": {
            "type": "string"
          },
          "ingress": {
            "type": "object"
          },
          "limits": {
            "type": "object"
          },
          "live_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "minimum": 0
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "profile": {
            "type": [
              "string",
              "null"
            ]
          },
          "project": {
            "type": "string",
            "description": "Slug of that project (default `default`)."
          },
          "project_id": {
            "type": "string",
            "description": "Id of the project the service belongs to (`prj_…`)."
          },
          "runtime": {
            "type": "string"
          },
          "scaling": {
            "type": "object"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/ServiceStatus"
          },
          "tenant_id": {
            "type": "string"
          },
          "triggers": {
            "type": "object"
          },
          "wasm": {
            "type": "object",
            "description": "`{\"reuse_instances\": bool}`; omitted while no WASM knob is set."
          },
          "ws": {
            "type": "object",
            "description": "`{\"allowed_origins\": […], \"warm\": bool, \"max_sockets\": n}`; omitted while no WebSocket knob is set."
          }
        }
      },
      "SetChannelBody": {
        "type": "object",
        "description": "`PUT /v1/sdks/{name}/channels/{channel}`.",
        "required": [
          "version"
        ],
        "properties": {
          "version": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "SetLiveBody": {
        "type": "object",
        "required": [
          "version"
        ],
        "properties": {
          "close_sockets": {
            "type": "boolean",
            "description": "Close the service's WebSockets with 1012 once the version is live (default false: they\nstay open and the next event runs this version)."
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      },
      "SocketPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocketView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "SocketView": {
        "type": "object",
        "description": "One open socket.",
        "required": [
          "id",
          "object",
          "tags",
          "created_at",
          "buffered_amount"
        ],
        "properties": {
          "auto_response_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "buffered_amount": {
            "type": "integer",
            "format": "int64",
            "description": "Bytes queued for the client.",
            "minimum": 0
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "Unix ms."
          },
          "id": {
            "type": "string",
            "description": "`ws_…`"
          },
          "last_message_at": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "object": {
            "type": "string"
          },
          "protocol": {
            "type": [
              "string",
              "null"
            ]
          },
          "remote_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "TenantPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantView"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "TenantView": {
        "type": "object",
        "required": [
          "id",
          "name",
          "plan",
          "overrides",
          "created_at",
          "disabled"
        ],
        "properties": {
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "disabled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "overrides": {
            "type": "object"
          },
          "plan": {
            "type": "string"
          }
        }
      },
      "TokenView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/KeyView"
          },
          {
            "type": "object",
            "properties": {
              "parent_key_id": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The key that created this one through `POST /v1/keys`; revoking it revokes this one too.\n`null` for keys the operator created."
              }
            }
          }
        ],
        "description": "A key as `GET /v1/keys` lists it: the usual view plus the key that minted it."
      },
      "UsageView": {
        "type": "object",
        "required": [
          "service_id",
          "day",
          "invocations",
          "cpu_ms",
          "egress_bytes",
          "storage_bytes"
        ],
        "properties": {
          "cpu_ms": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "day": {
            "type": "string"
          },
          "egress_bytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "invocations": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "service_id": {
            "type": "string"
          },
          "storage_bytes": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "VersionInfo": {
        "type": "object",
        "description": "`GET /v1/version`: what any authenticated caller may know about the node.",
        "required": [
          "version",
          "api"
        ],
        "properties": {
          "api": {
            "type": "string",
            "description": "Version of the control API document (`info.version` of `/v1/openapi.json`)."
          },
          "version": {
            "type": "string",
            "description": "Node (crate) version."
          }
        }
      },
      "VersionView": {
        "type": "object",
        "description": "Upload response: `201 {\"version\":N,\"source_digest\":\"sha256:…\",\"build_state\":\"pending\"}`;\neager compile → `202` with the same shape and `build_state:\"building\"`. Also the shape of\n`GET …/versions/{v}` (plus `lock_digest`, `failure`, `created_at`).",
        "required": [
          "version",
          "source_digest",
          "build_state",
          "created_at"
        ],
        "properties": {
          "build_state": {
            "type": "string",
            "description": "`pending` | `building` | `ready` | `failed`."
          },
          "created_at": {
            "type": "integer",
            "format": "int64"
          },
          "failure": {
            "type": [
              "object",
              "null"
            ]
          },
          "lock_digest": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_digest": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Root token (`RT_ROOT_TOKEN`) or a tenant key `rtk_<key_id>_<secret>`. `x-rt-key: <key>` works too."
      }
    }
  },
  "tags": [
    {
      "name": "meta",
      "description": "Who am I, versions"
    },
    {
      "name": "node",
      "description": "Node status, config, drain, scheduler, cache (operator)"
    },
    {
      "name": "tenants",
      "description": "Tenants (operator)"
    },
    {
      "name": "keys",
      "description": "API keys; self-service tokens of a tenant (scope keys:write)"
    },
    {
      "name": "projects",
      "description": "Projects and their environments"
    },
    {
      "name": "services",
      "description": "Services"
    },
    {
      "name": "versions",
      "description": "Immutable versions and builds"
    },
    {
      "name": "env",
      "description": "Environment variables"
    },
    {
      "name": "secrets",
      "description": "Write-only secrets"
    },
    {
      "name": "hosts",
      "description": "Custom hosts"
    },
    {
      "name": "schedules",
      "description": "Interval and cron schedules; the pending one-off schedules of std:schedule"
    },
    {
      "name": "queue",
      "description": "Queue and dead-letter queue"
    },
    {
      "name": "sdks",
      "description": "Operator SDKs: releases, channels and grants (operator); the effective SDKs and contracts of a tenant"
    },
    {
      "name": "observability",
      "description": "Logs, stats, events"
    }
  ],
  "servers": [
    {
      "url": "http://127.0.0.1:8081",
      "description": "Local node (control listener)"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ]
}
