{
  "components": {
    "schemas": {
      "APIKeyIssuanceError": {
        "properties": {
          "api_key_id": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          }
        },
        "required": [
          "detail"
        ],
        "type": "object"
      },
      "APIKeyModel": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          },
          "last_used": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used"
          }
        },
        "required": [
          "id",
          "key_prefix",
          "created"
        ],
        "title": "APIKey",
        "type": "object"
      },
      "APIKeyModelCollection": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/APIKeyModel"
            },
            "title": "Data",
            "type": "array"
          },
          "object": {
            "const": "list",
            "default": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "APIKeyList",
        "type": "object"
      },
      "AccountType": {
        "enum": [
          "user",
          "admin",
          "service"
        ],
        "title": "AccountType",
        "type": "string"
      },
      "ActiveOrganizationResponse": {
        "properties": {
          "organization": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OrganizationModel"
              },
              {
                "type": "null"
              }
            ]
          },
          "organization_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Organization ID"
          }
        },
        "title": "ActiveOrganization",
        "type": "object"
      },
      "AddMemberRequest": {
        "properties": {
          "email_address": {
            "title": "Email Address",
            "type": "string"
          },
          "role": {
            "enum": [
              "org:admin",
              "org:member"
            ],
            "title": "Role",
            "type": "string"
          },
          "user_id": {
            "title": "User ID",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "AddMemberRequest",
        "type": "object"
      },
      "BootInstanceFromImageRequest": {
        "properties": {
          "disk_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Size of the disk in MB. If not provided, defaults to the image's disk size.",
            "title": "Disk Size"
          },
          "memory": {
            "default": 128,
            "description": "Memory in MB",
            "title": "Memory",
            "type": "integer"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set of key-value pairs for storing additional information",
            "title": "Metadata"
          },
          "ttl_action": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "pause"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Action to take when the instance expires. If not provided, the instance will not expire.",
            "title": "Ttl Action"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time to live in seconds for the instance. If not provided, the instance will not expire.",
            "title": "Ttl Seconds"
          },
          "vcpus": {
            "default": 1,
            "description": "Number of vCPUs",
            "title": "Vcpus",
            "type": "integer"
          }
        },
        "title": "BootInstanceFromImageRequest",
        "type": "object"
      },
      "BootInstanceRequest": {
        "properties": {
          "disk_size": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disk Size"
          },
          "memory": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Memory"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "ttl_action": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "pause"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Action to take when the instance expires. Defaults to 'stop'.",
            "title": "Ttl Action"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time to live in seconds for the instance",
            "title": "Ttl Seconds"
          },
          "vcpus": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Vcpus"
          }
        },
        "title": "BootInstanceRequest",
        "type": "object"
      },
      "BranchInstanceRequest": {
        "examples": [
          {
            "instance_metadata": {},
            "snapshot_metadata": {}
          }
        ],
        "properties": {
          "instance_metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "items": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata for the new instances. If a list is provided, each instance will have the corresponding metadata.",
            "title": "Instance Metadata"
          },
          "snapshot_metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metadata for the new snapshot",
            "title": "Snapshot Metadata"
          }
        },
        "title": "BranchInstanceRequest",
        "type": "object"
      },
      "BranchInstanceResponse": {
        "properties": {
          "instances": {
            "items": {
              "$ref": "#/components/schemas/InstanceModel"
            },
            "title": "Instances",
            "type": "array"
          },
          "snapshot": {
            "$ref": "#/components/schemas/SnapshotModel"
          }
        },
        "required": [
          "snapshot",
          "instances"
        ],
        "title": "BranchInstanceResponse",
        "type": "object"
      },
      "CodedError": {
        "properties": {
          "detail": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          }
        },
        "required": [
          "detail"
        ],
        "title": "CodedError",
        "type": "object"
      },
      "CreateAPIKeyResponse": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "created_by_user_id": {
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "key": {
            "title": "Key",
            "type": "string"
          },
          "key_prefix": {
            "title": "Key Prefix",
            "type": "string"
          }
        },
        "required": [
          "id",
          "key",
          "key_prefix",
          "created"
        ],
        "title": "CreateAPIKeyResponse",
        "type": "object"
      },
      "CreateInviteRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "email_address": {
            "title": "Email Address",
            "type": "string"
          },
          "role": {
            "enum": [
              "org:admin",
              "org:member"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "CreateInviteRequest",
        "type": "object"
      },
      "CreateInviteResponse": {
        "properties": {
          "invite": {
            "$ref": "#/components/schemas/OrganizationInviteModel"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "invite",
          "token"
        ],
        "title": "CreateInviteResponse",
        "type": "object"
      },
      "CreateManagedSSHKeyRequest": {
        "additionalProperties": false,
        "properties": {
          "expires": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional future Unix timestamp."
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "public_key": {
            "description": "Exactly one OpenSSH public key without authorized_keys options. ED25519 is recommended; RSA must be at least 3072 bits.",
            "maxLength": 16384,
            "type": "string"
          }
        },
        "required": [
          "name",
          "public_key"
        ],
        "title": "CreateManagedSSHKeyRequest",
        "type": "object"
      },
      "CreateOrganizationRequest": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateOrganizationRequest",
        "type": "object"
      },
      "CreateSecretRequest": {
        "examples": [
          {
            "description": "My API key for external service",
            "metadata": {
              "environment": "production"
            },
            "name": "my_api_key",
            "value": "secret_value_here"
          }
        ],
        "properties": {
          "description": {
            "anyOf": [
              {
                "maxLength": 1000,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Metadata",
            "type": "object"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "value": {
            "minLength": 1,
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ],
        "title": "CreateSecretRequest",
        "type": "object"
      },
      "CreateSnapshotRequest": {
        "examples": [
          {
            "disk_size": 700,
            "image_id": "morphvm-minimal",
            "memory": 128,
            "metadata": {},
            "readiness_check": {
              "timeout": 5,
              "type": "timeout"
            },
            "vcpus": 1
          }
        ],
        "properties": {
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User provided digest of the snapshot content",
            "title": "Digest"
          },
          "disk_size": {
            "default": 700,
            "description": "Size of the disk in MB",
            "title": "Disk Size",
            "type": "integer"
          },
          "image_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": "morphvm-minimal",
            "description": "ID of the base image to use.",
            "title": "Image Id"
          },
          "memory": {
            "default": 128,
            "description": "Memory in MB",
            "title": "Memory",
            "type": "integer"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set of key-value pairs for storing additional information",
            "title": "Metadata"
          },
          "readiness_check": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeoutCheck"
              },
              {
                "type": "null"
              }
            ],
            "description": "Configuration for checking instance readiness. Can be either a timeout-based check or an HTTP-based check."
          },
          "vcpus": {
            "default": 1,
            "description": "Number of vCPUs",
            "title": "Vcpus",
            "type": "integer"
          }
        },
        "title": "CreateSnapshotRequest",
        "type": "object"
      },
      "CreateSnapshotTokenResponse": {
        "properties": {
          "expires_in": {
            "title": "Expires In",
            "type": "integer"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "token",
          "expires_in"
        ],
        "title": "CreateSnapshotTokenResponse",
        "type": "object"
      },
      "EnsureResourceRequest": {
        "properties": {
          "client_key": {
            "title": "Client Key",
            "type": "string"
          },
          "idempotency_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idempotency Key"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "quantity": {
            "default": 1,
            "title": "Quantity",
            "type": "integer"
          },
          "quantity_units": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quantity Units"
          },
          "quota_usages": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/QuotaUsageSpec"
            },
            "title": "Quota Usages",
            "type": "array"
          },
          "rate_cents_per_hour": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rate Cents Per Hour"
          },
          "rate_umcu_per_s": {
            "default": 0,
            "title": "Rate Umcu Per S",
            "type": "integer"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "resource_type",
          "client_key"
        ],
        "title": "EnsureResourceRequest",
        "type": "object"
      },
      "EnsureResourceResponse": {
        "properties": {
          "already_exists": {
            "title": "Already Exists",
            "type": "boolean"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          }
        },
        "required": [
          "resource_id",
          "already_exists"
        ],
        "title": "EnsureResourceResponse",
        "type": "object"
      },
      "ExecRequest": {
        "examples": [
          {
            "command": [
              "echo",
              "Hello, World!"
            ]
          }
        ],
        "properties": {
          "command": {
            "items": {
              "type": "string"
            },
            "title": "Command",
            "type": "array"
          }
        },
        "required": [
          "command"
        ],
        "title": "InstanceExecRequest",
        "type": "object"
      },
      "ExecResponse": {
        "properties": {
          "exit_code": {
            "title": "Exit Code",
            "type": "integer"
          },
          "stderr": {
            "title": "Stderr",
            "type": "string"
          },
          "stdout": {
            "title": "Stdout",
            "type": "string"
          }
        },
        "required": [
          "stdout",
          "stderr",
          "exit_code"
        ],
        "title": "InstanceExecResponse",
        "type": "object"
      },
      "ExposeHttpServiceRequest": {
        "examples": [
          {
            "name": "web",
            "port": 8000
          }
        ],
        "properties": {
          "auth_mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/HttpServiceAuthMode"
              },
              {
                "type": "null"
              }
            ],
            "default": "none",
            "description": "Authentication mode for the HTTP service"
          },
          "name": {
            "maxLength": 40,
            "minLength": 1,
            "pattern": "^[a-z0-9]([a-z0-9-_]*[a-z0-9])?$",
            "title": "Name",
            "type": "string"
          },
          "port": {
            "maximum": 65535,
            "minimum": 1,
            "title": "Port",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "port"
        ],
        "title": "ExposeHttpServiceRequest",
        "type": "object"
      },
      "GetSecretRequest": {
        "properties": {
          "api_key": {
            "description": "User's MORPH API key for authentication",
            "title": "Api Key",
            "type": "string"
          },
          "secret_name": {
            "description": "Name of the secret to retrieve",
            "title": "Secret Name",
            "type": "string"
          }
        },
        "required": [
          "api_key",
          "secret_name"
        ],
        "title": "GetSecretRequest",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HttpServiceAuthMode": {
        "enum": [
          "none",
          "api_key"
        ],
        "title": "HttpServiceAuthMode",
        "type": "string"
      },
      "ImageModel": {
        "properties": {
          "created": {
            "description": "Unix timestamp of when the base image was created",
            "title": "Created",
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Description of the base image",
            "title": "Description"
          },
          "disk_size": {
            "description": "Size of the base image in bytes",
            "title": "Disk Size",
            "type": "integer"
          },
          "id": {
            "description": "Unique identifier for the base image, like img_xxxx",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "description": "Name of the base image",
            "title": "Name",
            "type": "string"
          },
          "object": {
            "const": "image",
            "default": "image",
            "description": "Object type, always 'image'",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "id",
          "created",
          "name",
          "disk_size"
        ],
        "title": "Image",
        "type": "object"
      },
      "ImageModelCollection": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ImageModel"
            },
            "title": "Data",
            "type": "array"
          },
          "object": {
            "const": "list",
            "default": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "ImageList",
        "type": "object"
      },
      "InstanceExpireAction": {
        "enum": [
          "stop",
          "pause"
        ],
        "title": "InstanceExpireAction",
        "type": "string"
      },
      "InstanceHttpService": {
        "properties": {
          "auth_mode": {
            "$ref": "#/components/schemas/HttpServiceAuthMode",
            "default": "none"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "port": {
            "title": "Port",
            "type": "integer"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "name",
          "port",
          "url"
        ],
        "title": "InstanceHttpService",
        "type": "object"
      },
      "InstanceModel": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "User provided metadata for the instance",
            "title": "Metadata",
            "type": "object"
          },
          "networking": {
            "$ref": "#/components/schemas/InstanceNetworking"
          },
          "object": {
            "const": "instance",
            "default": "instance",
            "title": "Object",
            "type": "string"
          },
          "refs": {
            "$ref": "#/components/schemas/InstanceRefs"
          },
          "spec": {
            "$ref": "#/components/schemas/ResourceSpec"
          },
          "status": {
            "$ref": "#/components/schemas/InstanceStatus",
            "default": "pending"
          },
          "ttl": {
            "$ref": "#/components/schemas/InstanceTTL",
            "description": "Time to live settings for the instance. If not set, the instance will not expire."
          },
          "wake_on": {
            "$ref": "#/components/schemas/InstanceWakeOn",
            "description": "Wake on settings for the instance. If not set, the instance will not wake on access."
          }
        },
        "required": [
          "id",
          "created",
          "spec",
          "refs",
          "networking",
          "ttl",
          "wake_on"
        ],
        "title": "Instance",
        "type": "object"
      },
      "InstanceModelCollection": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/InstanceModel"
            },
            "title": "Data",
            "type": "array"
          },
          "object": {
            "const": "list",
            "default": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "InstanceList",
        "type": "object"
      },
      "InstanceModelCollectionPaginated": {
        "properties": {
          "has_next": {
            "title": "Has Next",
            "type": "boolean"
          },
          "has_prev": {
            "title": "Has Prev",
            "type": "boolean"
          },
          "instances": {
            "items": {
              "$ref": "#/components/schemas/InstanceModel"
            },
            "title": "Instances",
            "type": "array"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "size": {
            "title": "Size",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "total_pages": {
            "title": "Total Pages",
            "type": "integer"
          }
        },
        "required": [
          "instances",
          "total",
          "page",
          "size",
          "total_pages",
          "has_next",
          "has_prev"
        ],
        "title": "InstanceListPaginated",
        "type": "object"
      },
      "InstanceNetworking": {
        "properties": {
          "http_services": {
            "items": {
              "$ref": "#/components/schemas/InstanceHttpService"
            },
            "title": "Http Services",
            "type": "array"
          },
          "internal_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internal Ip"
          }
        },
        "title": "InstanceNetworking",
        "type": "object"
      },
      "InstanceRefs": {
        "properties": {
          "image_id": {
            "title": "Image Id",
            "type": "string"
          },
          "snapshot_id": {
            "title": "Snapshot Id",
            "type": "string"
          }
        },
        "required": [
          "snapshot_id",
          "image_id"
        ],
        "title": "InstanceRefs",
        "type": "object"
      },
      "InstanceSshKey": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "object": {
            "const": "instance_ssh_key",
            "default": "instance_ssh_key",
            "title": "Object",
            "type": "string"
          },
          "password": {
            "title": "Password",
            "type": "string"
          },
          "private_key": {
            "title": "Private Key",
            "type": "string"
          },
          "public_key": {
            "title": "Public Key",
            "type": "string"
          }
        },
        "required": [
          "private_key",
          "public_key",
          "password",
          "access_token"
        ],
        "title": "InstanceSshKey",
        "type": "object"
      },
      "InstanceStatus": {
        "enum": [
          "pending",
          "ready",
          "paused",
          "saving",
          "error"
        ],
        "title": "InstanceStatus",
        "type": "string"
      },
      "InstanceTTL": {
        "properties": {
          "ttl_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/InstanceExpireAction"
              },
              {
                "type": "null"
              }
            ],
            "description": "Action to take when the instance expires"
          },
          "ttl_expire_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Unix timestamp of when the instance will expire",
            "title": "Ttl Expire At"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time to live in seconds for the instance",
            "title": "Ttl Seconds"
          }
        },
        "required": [
          "ttl_seconds"
        ],
        "title": "InstanceTTL",
        "type": "object"
      },
      "InstanceWakeOn": {
        "properties": {
          "wake_on_http": {
            "default": false,
            "description": "Whether to wake the instance on HTTP access",
            "title": "Wake On Http",
            "type": "boolean"
          },
          "wake_on_ssh": {
            "default": false,
            "description": "Whether to wake the instance on SSH access",
            "title": "Wake On Ssh",
            "type": "boolean"
          }
        },
        "title": "InstanceWakeOn",
        "type": "object"
      },
      "ListResourcesResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ResourceItem"
            },
            "title": "Data",
            "type": "array"
          },
          "has_next": {
            "title": "Has Next",
            "type": "boolean"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "page_size": {
            "title": "Page Size",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "page",
          "page_size",
          "total",
          "has_next"
        ],
        "title": "ListResourcesResponse",
        "type": "object"
      },
      "ManagedSSHKey": {
        "description": "A user-owned SSH public credential. Morph stores only public material; direct-SSH scope is derived from live organization membership.",
        "properties": {
          "algorithm": {
            "description": "Validated uploads use ED25519, ECDSA, RSA, or OpenSSH security-key algorithms. Malformed migrated rows may report unknown or unsupported and have migration_warning=true.",
            "type": "string"
          },
          "created": {
            "description": "Unix timestamp. For migrated rows this is legacy account provenance, not a verified upload time.",
            "format": "int64",
            "type": "integer"
          },
          "expires": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "description": "OpenSSH-compatible SHA256 fingerprint without base64 padding. Malformed legacy records use a deterministic legacy: marker and have migration_warning=true.",
            "pattern": "^(SHA256:[A-Za-z0-9+/]+|legacy:[0-9a-f]{32})$",
            "type": "string"
          },
          "id": {
            "pattern": "^usk_[a-z0-9]+$",
            "type": "string"
          },
          "last_used": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "migrated_from_legacy": {
            "type": "boolean"
          },
          "migration_warning": {
            "type": "boolean"
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          },
          "object": {
            "const": "user_ssh_key",
            "type": "string"
          },
          "public_key": {
            "description": "Canonical OpenSSH public-key record. Never submit private-key material.",
            "type": "string"
          },
          "revoked": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "active",
              "expired",
              "revoked",
              "migration_warning"
            ],
            "type": "string"
          },
          "updated": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "public_key",
          "fingerprint",
          "algorithm",
          "created",
          "updated",
          "expires",
          "last_used",
          "revoked",
          "status",
          "migrated_from_legacy",
          "migration_warning"
        ],
        "title": "ManagedSSHKey",
        "type": "object"
      },
      "ManagedSSHKeyError": {
        "properties": {
          "detail": {
            "type": "string"
          },
          "error_code": {
            "enum": [
              "invalid_ssh_public_key",
              "unsupported_ssh_key_type",
              "weak_ssh_rsa_key",
              "duplicate_ssh_key",
              "duplicate_ssh_key_name",
              "ssh_key_limit_reached",
              "invalid_ssh_key_expiry",
              "invalid_ssh_key_name",
              "invalid_ssh_key_patch",
              "ssh_key_not_found",
              "ssh_key_audit_forbidden",
              "ssh_key_store_unavailable"
            ],
            "type": "string"
          }
        },
        "required": [
          "detail",
          "error_code"
        ],
        "title": "ManagedSSHKeyError",
        "type": "object"
      },
      "ManagedSSHKeyList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ManagedSSHKey"
            },
            "maxItems": 100,
            "type": "array"
          },
          "object": {
            "const": "list",
            "type": "string"
          }
        },
        "required": [
          "object",
          "data"
        ],
        "title": "ManagedSSHKeyList",
        "type": "object"
      },
      "OrganizationInviteListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/OrganizationInviteModel"
            },
            "title": "Data",
            "type": "array"
          },
          "total_count": {
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "total_count"
        ],
        "title": "OrganizationInviteList",
        "type": "object"
      },
      "OrganizationInviteModel": {
        "properties": {
          "accepted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Accepted At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email_address": {
            "title": "Email Address",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "id": {
            "title": "ID",
            "type": "string"
          },
          "invited_by_user_id": {
            "title": "Invited By User ID",
            "type": "string"
          },
          "organization_id": {
            "title": "Organization ID",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "accepted",
              "declined",
              "revoked"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "id",
          "organization_id",
          "email_address",
          "role",
          "status"
        ],
        "title": "OrganizationInvite",
        "type": "object"
      },
      "OrganizationListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/OrganizationMembershipModel"
            },
            "title": "Data",
            "type": "array"
          },
          "total_count": {
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "total_count"
        ],
        "title": "OrganizationList",
        "type": "object"
      },
      "OrganizationManagedSSHKey": {
        "description": "Metadata-only effective-access record. Full public-key material is deliberately omitted.",
        "properties": {
          "algorithm": {
            "type": "string"
          },
          "created": {
            "format": "int64",
            "type": "integer"
          },
          "expires": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "fingerprint": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_used": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "migrated_from_legacy": {
            "type": "boolean"
          },
          "migration_warning": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "revoked": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "active",
              "expired",
              "migration_warning"
            ],
            "type": "string"
          },
          "updated": {
            "format": "int64",
            "type": "integer"
          },
          "user": {
            "properties": {
              "identifier": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "user_id": {
                "type": "string"
              }
            },
            "required": [
              "user_id"
            ],
            "type": "object"
          },
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "name",
          "fingerprint",
          "algorithm",
          "created",
          "updated",
          "expires",
          "last_used",
          "revoked",
          "status",
          "migrated_from_legacy",
          "migration_warning"
        ],
        "title": "OrganizationManagedSSHKey",
        "type": "object"
      },
      "OrganizationManagedSSHKeyList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/OrganizationManagedSSHKey"
            },
            "maxItems": 500,
            "type": "array"
          },
          "object": {
            "const": "list",
            "type": "string"
          }
        },
        "required": [
          "object",
          "data"
        ],
        "title": "OrganizationManagedSSHKeyList",
        "type": "object"
      },
      "OrganizationMemberListResponse": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/OrganizationMembershipModel"
            },
            "title": "Data",
            "type": "array"
          },
          "total_count": {
            "title": "Total Count",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "total_count"
        ],
        "title": "OrganizationMemberList",
        "type": "object"
      },
      "OrganizationMembershipModel": {
        "properties": {
          "id": {
            "title": "ID",
            "type": "string"
          },
          "organization": {
            "$ref": "#/components/schemas/OrganizationModel"
          },
          "public_user_data": {
            "$ref": "#/components/schemas/PublicUserDataModel"
          },
          "role": {
            "enum": [
              "org:admin",
              "org:member"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "OrganizationMembership",
        "type": "object"
      },
      "OrganizationModel": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "title": "ID",
            "type": "string"
          },
          "is_personal": {
            "title": "Is Personal",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "owner_id": {
            "title": "Owner ID",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "owner_id",
          "is_personal"
        ],
        "title": "Organization",
        "type": "object"
      },
      "PatchManagedSSHKeyRequest": {
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "expires": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Future Unix timestamp, or null to clear expiry."
          },
          "name": {
            "maxLength": 80,
            "minLength": 1,
            "type": "string"
          }
        },
        "title": "PatchManagedSSHKeyRequest",
        "type": "object"
      },
      "PublicUserDataModel": {
        "properties": {
          "identifier": {
            "title": "Identifier",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "user_id": {
            "title": "User ID",
            "type": "string"
          }
        },
        "title": "PublicUserData",
        "type": "object"
      },
      "QuotaDeleteRequest": {
        "properties": {
          "quota_code": {
            "title": "Quota Code",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "quota_code"
        ],
        "title": "QuotaDeleteRequest",
        "type": "object"
      },
      "QuotaItem": {
        "properties": {
          "limit_value": {
            "title": "Limit Value",
            "type": "integer"
          },
          "quota_code": {
            "title": "Quota Code",
            "type": "string"
          },
          "used_value": {
            "title": "Used Value",
            "type": "integer"
          }
        },
        "required": [
          "quota_code",
          "limit_value",
          "used_value"
        ],
        "title": "QuotaItem",
        "type": "object"
      },
      "QuotaItemOut": {
        "properties": {
          "limit_value": {
            "title": "Limit Value",
            "type": "integer"
          },
          "quota_code": {
            "title": "Quota Code",
            "type": "string"
          },
          "used_value": {
            "title": "Used Value",
            "type": "integer"
          }
        },
        "required": [
          "quota_code",
          "limit_value",
          "used_value"
        ],
        "title": "QuotaItemOut",
        "type": "object"
      },
      "QuotaListResponse": {
        "properties": {
          "quotas": {
            "items": {
              "$ref": "#/components/schemas/QuotaItem"
            },
            "title": "Quotas",
            "type": "array"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "quotas"
        ],
        "title": "QuotaListResponse",
        "type": "object"
      },
      "QuotaSetRequest": {
        "properties": {
          "limit_value": {
            "title": "Limit Value",
            "type": "integer"
          }
        },
        "required": [
          "limit_value"
        ],
        "title": "QuotaSetRequest",
        "type": "object"
      },
      "QuotaTypeDeleteRequest": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "title": "QuotaTypeDeleteRequest",
        "type": "object"
      },
      "QuotaTypeResponse": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "default_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Limit"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "service_id": {
            "title": "Service Id",
            "type": "string"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          }
        },
        "required": [
          "id",
          "service_id",
          "code"
        ],
        "title": "QuotaTypeResponse",
        "type": "object"
      },
      "QuotaTypeUpsertRequest": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "default_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Limit"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          }
        },
        "required": [
          "code"
        ],
        "title": "QuotaTypeUpsertRequest",
        "type": "object"
      },
      "QuotaUsageSpec": {
        "properties": {
          "amount": {
            "title": "Amount",
            "type": "integer"
          },
          "quota_code": {
            "title": "Quota Code",
            "type": "string"
          }
        },
        "required": [
          "quota_code",
          "amount"
        ],
        "title": "QuotaUsageSpec",
        "type": "object"
      },
      "RedeemPromoCodeRequest": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "title": "RedeemPromoCodeRequest",
        "type": "object"
      },
      "RedeemPromoCodeResponse": {
        "properties": {
          "credits_granted_mcus": {
            "title": "Credits Granted Mcus",
            "type": "integer"
          },
          "effective_tier": {
            "title": "Effective Tier",
            "type": "string"
          },
          "organization_id": {
            "title": "Organization Id",
            "type": "string"
          },
          "promo_code_id": {
            "title": "Promo Code Id",
            "type": "string"
          },
          "tier_grant_ends_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier Grant Ends At"
          },
          "tier_granted": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier Granted"
          }
        },
        "required": [
          "promo_code_id",
          "organization_id",
          "credits_granted_mcus",
          "effective_tier"
        ],
        "title": "RedeemPromoCodeResponse",
        "type": "object"
      },
      "ResourceItem": {
        "properties": {
          "active": {
            "title": "Active",
            "type": "boolean"
          },
          "client_key": {
            "title": "Client Key",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "deleted_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "resource_type",
          "client_key",
          "metadata",
          "created_at",
          "active"
        ],
        "title": "ResourceItem",
        "type": "object"
      },
      "ResourceSpec": {
        "properties": {
          "disk_size": {
            "description": "Size of the snapshot in megabytes",
            "title": "Disk Size",
            "type": "integer"
          },
          "memory": {
            "description": "Memory of the snaphshot in megabytes",
            "title": "Memory",
            "type": "integer"
          },
          "vcpus": {
            "description": "VCPU Count of the snaphshot",
            "title": "Vcpus",
            "type": "integer"
          }
        },
        "required": [
          "vcpus",
          "memory",
          "disk_size"
        ],
        "title": "ResourceSpec",
        "type": "object"
      },
      "ResourceTypeDeleteRequest": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "title": "ResourceTypeDeleteRequest",
        "type": "object"
      },
      "ResourceTypeResponse": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "service_id": {
            "title": "Service Id",
            "type": "string"
          },
          "stripe_price_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Price Id"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          }
        },
        "required": [
          "id",
          "service_id",
          "code"
        ],
        "title": "ResourceTypeResponse",
        "type": "object"
      },
      "ResourceTypeUpsertRequest": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "stripe_price_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stripe Price Id"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          }
        },
        "required": [
          "code"
        ],
        "title": "ResourceTypeUpsertRequest",
        "type": "object"
      },
      "SecretModel": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "default": {},
            "title": "Metadata",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "updated": {
            "title": "Updated",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "created",
          "updated"
        ],
        "title": "Secret",
        "type": "object"
      },
      "SecretModelCollection": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SecretModel"
            },
            "title": "Data",
            "type": "array"
          },
          "object": {
            "const": "list",
            "default": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "SecretList",
        "type": "object"
      },
      "SecretValueResponse": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "default": {},
            "title": "Metadata",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "updated": {
            "title": "Updated",
            "type": "integer"
          },
          "value": {
            "title": "Value",
            "type": "string"
          }
        },
        "required": [
          "name",
          "value",
          "created",
          "updated"
        ],
        "title": "SecretValueResponse",
        "type": "object"
      },
      "ServiceAuthDelegationRequest": {
        "description": "token may instead be supplied as a Bearer credential.",
        "properties": {
          "audience": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "required_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "token": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ServiceAuthDelegationResponse": {
        "properties": {
          "account_type": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "expires_at": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "is_restricted": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "service_id": {
            "type": "string"
          },
          "service_name": {
            "type": "string"
          },
          "subscription_tier": {
            "type": "string"
          },
          "subscription_tier_grant_ends_at": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "subscription_tier_source": {
            "type": "string"
          },
          "token_id": {
            "type": "string"
          }
        },
        "required": [
          "active",
          "id",
          "email",
          "name",
          "account_type",
          "is_restricted",
          "subscription_tier",
          "subscription_tier_source",
          "subscription_tier_grant_ends_at",
          "organization_id",
          "service_id",
          "service_name",
          "scopes",
          "token_id",
          "expires_at"
        ],
        "type": "object"
      },
      "ServiceAuthPrincipalRequest": {
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "organization_id"
        ],
        "type": "object"
      },
      "ServiceAuthPrincipalResponse": {
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "organization_id": {
            "type": "string"
          },
          "reason": {
            "enum": [
              "allowed",
              "account_restricted",
              "organization_restricted",
              "billing_restricted",
              "credits_exhausted",
              "developer_setup_required"
            ],
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "organization_id",
          "allowed",
          "reason"
        ],
        "type": "object"
      },
      "ServiceAuthResourceOwnerRequest": {
        "properties": {
          "owner_organization_id": {
            "type": "string"
          },
          "publisher_user_id": {
            "type": "string"
          }
        },
        "required": [
          "publisher_user_id",
          "owner_organization_id"
        ],
        "type": "object"
      },
      "ServiceAuthResourceOwnerResponse": {
        "properties": {
          "allowed": {
            "type": "boolean"
          },
          "owner_organization_id": {
            "type": "string"
          },
          "publisher_user_id": {
            "type": "string"
          },
          "reason": {
            "enum": [
              "allowed",
              "account_restricted",
              "organization_restricted",
              "billing_restricted",
              "credits_exhausted",
              "developer_setup_required"
            ],
            "type": "string"
          }
        },
        "required": [
          "publisher_user_id",
          "owner_organization_id",
          "allowed",
          "reason"
        ],
        "type": "object"
      },
      "ServiceAuthUserRequest": {
        "description": "A user API key may be supplied as api_key, morph_api_key, or X-Morph-Api-Key. At least one credential source is required.",
        "properties": {
          "api_key": {
            "type": "string"
          },
          "morph_api_key": {
            "type": "string"
          }
        },
        "title": "ServiceAuthUserRequest",
        "type": "object"
      },
      "ServiceDelegationClaimSummary": {
        "properties": {
          "actor_type": {
            "type": "string"
          },
          "audience": {
            "type": "string"
          },
          "expires_at": {
            "type": "integer"
          },
          "issued_at": {
            "type": "integer"
          },
          "issuer": {
            "type": "string"
          },
          "key_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "service_id": {
            "type": "string"
          },
          "service_name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "token_id": {
            "type": "string"
          }
        },
        "title": "ServiceDelegationClaimSummary",
        "type": "object"
      },
      "ServiceDelegationPolicy": {
        "properties": {
          "allowed_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "title": "ServiceDelegationPolicy",
        "type": "object"
      },
      "ServiceDelegationTokenRequest": {
        "properties": {
          "audience": {
            "description": "Optional audience. When supplied it must match the target service id or name.",
            "type": "string"
          },
          "client_context": {
            "additionalProperties": true,
            "type": "object"
          },
          "idempotency_key": {
            "type": "string"
          },
          "organization_id": {
            "description": "Internal or external organization id. Defaults to the authenticated user's active organization.",
            "type": "string"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "scopes"
        ],
        "title": "ServiceDelegationTokenRequest",
        "type": "object"
      },
      "ServiceDelegationTokenResponse": {
        "properties": {
          "access_token": {
            "type": "string"
          },
          "claims": {
            "$ref": "#/components/schemas/ServiceDelegationClaimSummary"
          },
          "expires_at": {
            "type": "integer"
          },
          "policy": {
            "$ref": "#/components/schemas/ServiceDelegationPolicy"
          },
          "token_type": {
            "type": "string"
          }
        },
        "required": [
          "token_type",
          "access_token",
          "expires_at",
          "claims",
          "policy"
        ],
        "title": "ServiceDelegationTokenResponse",
        "type": "object"
      },
      "ServiceInfo": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Metadata",
            "type": "object"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "metadata"
        ],
        "title": "ServiceInfo",
        "type": "object"
      },
      "ServiceLogEntry": {
        "properties": {
          "attributes": {
            "additionalProperties": true,
            "title": "Attributes",
            "type": "object"
          },
          "body": {
            "title": "Body"
          },
          "labels": {
            "additionalProperties": true,
            "title": "Labels",
            "type": "object"
          },
          "resources": {
            "additionalProperties": true,
            "title": "Resources",
            "type": "object"
          },
          "timestamp": {
            "format": "date-time",
            "title": "Timestamp",
            "type": "string"
          }
        },
        "required": [
          "timestamp",
          "body"
        ],
        "title": "ServiceLogEntry",
        "type": "object"
      },
      "ServiceQuotaItem": {
        "properties": {
          "quotas": {
            "items": {
              "$ref": "#/components/schemas/QuotaItemOut"
            },
            "title": "Quotas",
            "type": "array"
          },
          "service_id": {
            "title": "Service Id",
            "type": "string"
          },
          "service_name": {
            "title": "Service Name",
            "type": "string"
          }
        },
        "required": [
          "service_id",
          "service_name",
          "quotas"
        ],
        "title": "ServiceQuotaItem",
        "type": "object"
      },
      "ServiceResourceBuckets": {
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/UserServiceUsageBucket"
            },
            "title": "Buckets",
            "type": "array"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          }
        },
        "required": [
          "resource_type",
          "buckets"
        ],
        "title": "ServiceResourceBuckets",
        "type": "object"
      },
      "ServiceUsageItem": {
        "properties": {
          "resource_types": {
            "items": {
              "$ref": "#/components/schemas/ServiceResourceBuckets"
            },
            "title": "Resource Types",
            "type": "array"
          },
          "service_id": {
            "title": "Service Id",
            "type": "string"
          },
          "service_name": {
            "title": "Service Name",
            "type": "string"
          }
        },
        "required": [
          "service_id",
          "service_name",
          "resource_types"
        ],
        "title": "ServiceUsageItem",
        "type": "object"
      },
      "ServiceUserInfo": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Metadata",
            "type": "object"
          },
          "service_id": {
            "title": "Service Id",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "service_id",
          "metadata"
        ],
        "title": "ServiceUserInfo",
        "type": "object"
      },
      "SetActiveOrganizationRequest": {
        "properties": {
          "organization_id": {
            "title": "Organization ID",
            "type": "string"
          }
        },
        "required": [
          "organization_id"
        ],
        "title": "SetActiveOrganizationRequest",
        "type": "object"
      },
      "SetMetadataRequest": {
        "properties": {
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Metadata",
            "type": "object"
          }
        },
        "required": [
          "metadata"
        ],
        "title": "SetMetadataRequest",
        "type": "object"
      },
      "SnapshotInstanceRequest": {
        "examples": [
          {
            "metadata": {},
            "sync": false
          }
        ],
        "properties": {
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "sync": {
            "default": true,
            "title": "Sync",
            "type": "boolean"
          }
        },
        "title": "SnapshotInstanceRequest",
        "type": "object"
      },
      "SnapshotModel": {
        "properties": {
          "created": {
            "description": "Unix timestamp of when the snapshot was created",
            "title": "Created",
            "type": "integer"
          },
          "digest": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "User provided digest of the snapshot content. Useful for caching if the snapshot takes a long time to create.",
            "title": "Digest"
          },
          "id": {
            "description": "Unique identifier for the snapshot, like snapshot_xxxx",
            "title": "Id",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "User provided metadata for the snapshot",
            "title": "Metadata",
            "type": "object"
          },
          "object": {
            "const": "snapshot",
            "default": "snapshot",
            "description": "Object type, always 'snapshot'",
            "title": "Object",
            "type": "string"
          },
          "refs": {
            "$ref": "#/components/schemas/SnapshotRefs"
          },
          "spec": {
            "$ref": "#/components/schemas/ResourceSpec"
          },
          "status": {
            "$ref": "#/components/schemas/SnapshotStatus",
            "description": "Status of the snapshot"
          },
          "ttl": {
            "$ref": "#/components/schemas/SnapshotTTL",
            "description": "Time to live settings for the snapshot. If not set, the snapshot will not expire."
          }
        },
        "required": [
          "id",
          "created",
          "status",
          "spec",
          "refs",
          "ttl"
        ],
        "title": "Snapshot",
        "type": "object"
      },
      "SnapshotModelCollection": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/SnapshotModel"
            },
            "title": "Data",
            "type": "array"
          },
          "object": {
            "const": "list",
            "default": "list",
            "title": "Object",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "SnapshotList",
        "type": "object"
      },
      "SnapshotModelCollectionPaginated": {
        "properties": {
          "has_next": {
            "title": "Has Next",
            "type": "boolean"
          },
          "has_prev": {
            "title": "Has Prev",
            "type": "boolean"
          },
          "page": {
            "title": "Page",
            "type": "integer"
          },
          "size": {
            "title": "Size",
            "type": "integer"
          },
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/SnapshotModel"
            },
            "title": "Snapshots",
            "type": "array"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          },
          "total_pages": {
            "title": "Total Pages",
            "type": "integer"
          }
        },
        "required": [
          "snapshots",
          "total",
          "page",
          "size",
          "total_pages",
          "has_next",
          "has_prev"
        ],
        "title": "SnapshotListPaginated",
        "type": "object"
      },
      "SnapshotRefs": {
        "properties": {
          "image_id": {
            "title": "Image Id",
            "type": "string"
          }
        },
        "required": [
          "image_id"
        ],
        "title": "SnapshotRefs",
        "type": "object"
      },
      "SnapshotStatus": {
        "enum": [
          "pending",
          "ready",
          "failed",
          "deleting",
          "deleted"
        ],
        "title": "SnapshotStatus",
        "type": "string"
      },
      "SnapshotTTL": {
        "properties": {
          "ttl_expire_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Unix timestamp of when the snapshot will expire",
            "title": "Ttl Expire At"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time to live in seconds for the snapshot",
            "title": "Ttl Seconds"
          }
        },
        "required": [
          "ttl_seconds"
        ],
        "title": "SnapshotTTL",
        "type": "object"
      },
      "StartInstanceRequest": {
        "examples": [
          {
            "metadata": {}
          }
        ],
        "properties": {
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "ttl_action": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "pause"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Action to take when the instance expires. Defaults to 'stop'.",
            "title": "Ttl Action"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time to live in seconds for the instance",
            "title": "Ttl Seconds"
          }
        },
        "title": "StartInstanceRequest",
        "type": "object"
      },
      "StopResourceRequest": {
        "properties": {
          "client_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Key"
          },
          "resource_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Id"
          },
          "resource_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resource Type"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          }
        },
        "title": "StopResourceRequest",
        "type": "object"
      },
      "TimeoutCheck": {
        "properties": {
          "timeout": {
            "default": 10,
            "title": "Timeout",
            "type": "number"
          },
          "type": {
            "const": "timeout",
            "default": "timeout",
            "title": "Type",
            "type": "string"
          }
        },
        "title": "TimeoutCheck",
        "type": "object"
      },
      "UpdateMemberRoleRequest": {
        "properties": {
          "role": {
            "enum": [
              "org:admin",
              "org:member"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "role"
        ],
        "title": "UpdateMemberRoleRequest",
        "type": "object"
      },
      "UpdateOrganizationRequest": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "title": "UpdateOrganizationRequest",
        "type": "object"
      },
      "UpdateSSHKeyRequest": {
        "examples": [
          {
            "public_key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAflLPl4mc5o7Fz00pnSmYDNZ/GmThT/79ZM5Exkgyux user@host"
          }
        ],
        "properties": {
          "public_key": {
            "title": "Public Key",
            "type": "string"
          }
        },
        "required": [
          "public_key"
        ],
        "title": "UpdateSSHKeyRequest",
        "type": "object"
      },
      "UpdateSnapshotTTLRequest": {
        "properties": {
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "New TTL in seconds. To clear TTL pass null.",
            "title": "Ttl Seconds"
          }
        },
        "required": [
          "ttl_seconds"
        ],
        "title": "UpdateSnapshotTTLRequest",
        "type": "object"
      },
      "UpdateTTLRequest": {
        "properties": {
          "ttl_action": {
            "anyOf": [
              {
                "enum": [
                  "stop",
                  "pause"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Action to take when the instance expires. Defaults to the current action or 'stop'.",
            "title": "Ttl Action"
          },
          "ttl_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "description": "New TTL in seconds. To clear TTL pass null.",
            "title": "Ttl Seconds"
          }
        },
        "required": [
          "ttl_seconds"
        ],
        "title": "UpdateTTLRequest",
        "type": "object"
      },
      "UpdateWakeRequest": {
        "properties": {
          "wake_on_http": {
            "default": false,
            "description": "Whether to wake the instance on HTTP request",
            "title": "Wake On Http",
            "type": "boolean"
          },
          "wake_on_ssh": {
            "default": false,
            "description": "Whether to wake the instance on SSH request",
            "title": "Wake On Ssh",
            "type": "boolean"
          }
        },
        "title": "UpdateWakeRequest",
        "type": "object"
      },
      "UsageSummaryResponse": {
        "properties": {
          "end": {
            "format": "date-time",
            "title": "End",
            "type": "string"
          },
          "estimated_credits": {
            "title": "Estimated Credits",
            "type": "integer"
          },
          "service_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Id"
          },
          "start": {
            "format": "date-time",
            "title": "Start",
            "type": "string"
          },
          "usage_umcu_seconds": {
            "title": "Usage Umcu Seconds",
            "type": "integer"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "start",
          "end",
          "usage_umcu_seconds",
          "estimated_credits"
        ],
        "title": "UsageSummaryResponse",
        "type": "object"
      },
      "UserCreditsResponse": {
        "properties": {
          "included_remaining": {
            "description": "Remaining subscription-included MCU credits, never below zero.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "is_restricted": {
            "description": "Whether organization access is currently blocked.",
            "type": "boolean"
          },
          "topup_balance": {
            "description": "Available purchased top-up MCU credits, capped at total_available.",
            "format": "int64",
            "type": "integer"
          },
          "total_available": {
            "description": "Total available MCU credits for the active organization.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "total_available",
          "included_remaining",
          "topup_balance",
          "is_restricted"
        ],
        "title": "UserCreditsResponse",
        "type": "object"
      },
      "UserInfo": {
        "properties": {
          "account_type": {
            "$ref": "#/components/schemas/AccountType"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_restricted": {
            "title": "Is Restricted",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "organization_id": {
            "title": "Organization Id",
            "type": "string"
          },
          "subscription_tier": {
            "title": "Subscription Tier",
            "type": "string"
          },
          "subscription_tier_grant_ends_at": {
            "anyOf": [
              {
                "format": "int64",
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "subscription_tier_source": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "account_type",
          "is_restricted",
          "subscription_tier",
          "subscription_tier_source",
          "subscription_tier_grant_ends_at",
          "organization_id"
        ],
        "title": "UserInfo",
        "type": "object"
      },
      "UserInstanceUsageModel": {
        "properties": {
          "instance_cpu_time": {
            "title": "Instance Cpu Time",
            "type": "integer"
          },
          "instance_disk_time": {
            "title": "Instance Disk Time",
            "type": "integer"
          },
          "instance_memory_time": {
            "title": "Instance Memory Time",
            "type": "integer"
          },
          "period_end": {
            "title": "Period End",
            "type": "integer"
          },
          "period_start": {
            "title": "Period Start",
            "type": "integer"
          }
        },
        "required": [
          "instance_cpu_time",
          "instance_memory_time",
          "instance_disk_time",
          "period_start",
          "period_end"
        ],
        "title": "UserInstanceUsage",
        "type": "object"
      },
      "UserSSHKeyModel": {
        "properties": {
          "created": {
            "title": "Created",
            "type": "integer"
          },
          "public_key": {
            "title": "Public Key",
            "type": "string"
          }
        },
        "required": [
          "public_key",
          "created"
        ],
        "title": "UserSSHKey",
        "type": "object"
      },
      "UserServiceQuotaResponse": {
        "properties": {
          "services": {
            "items": {
              "$ref": "#/components/schemas/ServiceQuotaItem"
            },
            "title": "Services",
            "type": "array"
          }
        },
        "required": [
          "services"
        ],
        "title": "UserServiceQuotaResponse",
        "type": "object"
      },
      "UserServiceUsageBucket": {
        "properties": {
          "cents": {
            "title": "Cents",
            "type": "integer"
          },
          "period_end": {
            "title": "Period End",
            "type": "integer"
          },
          "period_start": {
            "title": "Period Start",
            "type": "integer"
          },
          "seconds": {
            "title": "Seconds",
            "type": "integer"
          }
        },
        "required": [
          "period_start",
          "period_end",
          "seconds",
          "cents"
        ],
        "title": "UserServiceUsageBucket",
        "type": "object"
      },
      "UserServiceUsageResponse": {
        "properties": {
          "services": {
            "items": {
              "$ref": "#/components/schemas/ServiceUsageItem"
            },
            "title": "Services",
            "type": "array"
          }
        },
        "required": [
          "services"
        ],
        "title": "UserServiceUsageResponse",
        "type": "object"
      },
      "UserSnapshotUsageModel": {
        "properties": {
          "period_end": {
            "title": "Period End",
            "type": "integer"
          },
          "period_start": {
            "title": "Period Start",
            "type": "integer"
          },
          "snapshot_disk_time": {
            "title": "Snapshot Disk Time",
            "type": "integer"
          },
          "snapshot_memory_time": {
            "title": "Snapshot Memory Time",
            "type": "integer"
          }
        },
        "required": [
          "snapshot_memory_time",
          "snapshot_disk_time",
          "period_start",
          "period_end"
        ],
        "title": "UserSnapshotUsage",
        "type": "object"
      },
      "UserUsageOverviewModel": {
        "properties": {
          "instance": {
            "items": {
              "$ref": "#/components/schemas/UserInstanceUsageModel"
            },
            "title": "Instance",
            "type": "array"
          },
          "items": {
            "items": {
              "type": "string"
            },
            "title": "Items",
            "type": "array"
          },
          "snapshot": {
            "items": {
              "$ref": "#/components/schemas/UserSnapshotUsageModel"
            },
            "title": "Snapshot",
            "type": "array"
          }
        },
        "required": [
          "instance",
          "snapshot",
          "items"
        ],
        "title": "UserUsageOverview",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "User-scoped API for managing instances, snapshots, billing, and user settings.",
    "title": "Morphcloud API",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/image": {
      "get": {
        "description": "List available images for creating snapshots.",
        "operationId": "list_images_image_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageModelCollection"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Images",
        "tags": [
          "Images"
        ]
      }
    },
    "/api/image/{image_id}/boot": {
      "post": {
        "description": "Boot an instance from a specified image.\n\nNote: Boot performs a cold restart of the operating system and does not\npreserve any in-memory process or volatile state. This is different from\ninstance start, which restores memory/process state from a snapshot. Use\nboot when you want to change the machine configuration (e.g., vCPU, memory,\nor disk) by restarting into a new configuration; use instance start if you\nneed to restore memory and running processes.",
        "operationId": "boot_image_image__image_id__boot_post",
        "parameters": [
          {
            "in": "path",
            "name": "image_id",
            "required": true,
            "schema": {
              "title": "Image Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BootInstanceFromImageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Boot Image",
        "tags": [
          "Images"
        ]
      }
    },
    "/api/instance": {
      "get": {
        "description": "List instances.",
        "operationId": "list_instances_instance_get",
        "parameters": [
          {
            "description": "metadata[...] query parameters for filtering instances",
            "example": {},
            "explode": true,
            "in": "query",
            "name": "metadata",
            "required": false,
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModelCollection"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instances",
        "tags": [
          "Instances"
        ]
      },
      "post": {
        "description": "Start a new instance from a snapshot.",
        "operationId": "start_instance_instance_post",
        "parameters": [
          {
            "in": "query",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/StartInstanceRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Start Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/list": {
      "get": {
        "description": "List instances (paginated).",
        "operationId": "list_instances_paginated_instance_list_get",
        "parameters": [
          {
            "description": "Page number (1-based)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number (1-based)",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "description": "Number of items per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of items per page",
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "metadata[...] query parameters for filtering instances",
            "example": {},
            "explode": true,
            "in": "query",
            "name": "metadata",
            "required": false,
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModelCollectionPaginated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Instances Paginated",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}": {
      "delete": {
        "description": "Stop and delete an instance by ID.",
        "operationId": "stop_instance_instance__instance_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Stop Instance",
        "tags": [
          "Instances"
        ]
      },
      "get": {
        "description": "Get an instance by ID.",
        "operationId": "get_instance_instance__instance_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/branch": {
      "post": {
        "description": "Branch an instance into multiple instances creating a new snapshot.",
        "operationId": "branch_instance_instance__instance_id__branch_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "count",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Count",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Digest"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BranchInstanceRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BranchInstanceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Branch Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/exec": {
      "post": {
        "description": "Execute a shell command inside a VM via SSH (AsyncSSH backend).",
        "operationId": "exec_instance__instance_id__exec_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Exec",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/exec/sse": {
      "post": {
        "operationId": "exec_sse_instance__instance_id__exec_sse_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "example": "data: {\"type\":\"stdout\",\"content\":\"hello\"}\\n\\ndata: {\"type\":\"exit_code\",\"content\":0}\\n\\n",
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Server-Sent Event stream"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Exec Sse",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/http": {
      "post": {
        "description": "Expose an HTTP service on an instance.",
        "operationId": "expose_http_service_instance__instance_id__http_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExposeHttpServiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Expose Http Service",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/http/{service_name}": {
      "delete": {
        "description": "Hide an HTTP service on an instance.",
        "operationId": "hide_http_service_instance__instance_id__http__service_name__delete",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "service_name",
            "required": true,
            "schema": {
              "title": "Service Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Hide Http Service",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/metadata": {
      "post": {
        "description": "Set metadata for an instance.",
        "operationId": "set_instance_metadata_instance__instance_id__metadata_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": {
                  "type": "string"
                },
                "title": "Metadata",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Instance Metadata",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/metrics": {
      "get": {
        "description": "Get a point-in-time CPU and memory usage report for an instance.",
        "operationId": "get_instance_metrics_instance__instance_id__metrics_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "cpu_usage_percent": {
                      "title": "Cpu Usage Percent",
                      "type": "number"
                    },
                    "instance_id": {
                      "title": "Instance Id",
                      "type": "string"
                    },
                    "memory_usage_bytes": {
                      "title": "Memory Usage Bytes",
                      "type": "integer"
                    },
                    "metrics_timestamp_unix_nano": {
                      "title": "Metrics Timestamp Unix Nano",
                      "type": "integer"
                    },
                    "object": {
                      "title": "Object",
                      "type": "string"
                    }
                  },
                  "required": [
                    "object",
                    "instance_id",
                    "cpu_usage_percent",
                    "memory_usage_bytes",
                    "metrics_timestamp_unix_nano"
                  ],
                  "title": "InstanceMetricsResponse",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Instance Metrics",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/pause": {
      "post": {
        "description": "Pause an instance.",
        "operationId": "pause_instance_instance__instance_id__pause_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "description": "Whether to create a snapshot when pausing the instance. Defaults to false.",
            "in": "query",
            "name": "snapshot",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Whether to create a snapshot when pausing the instance. Defaults to false.",
              "title": "Snapshot"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Pause Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/reboot": {
      "post": {
        "description": "Restart an instance. Optionally reconfigure resources and settings.\n\nIf a request body is provided, the instance will perform a cold reboot with\nthe updated resources (vCPUs, memory, disk size) and settings while preserving\nits filesystem.",
        "operationId": "reboot_instance_instance__instance_id__reboot_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BootInstanceRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Reboot Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/resume": {
      "post": {
        "description": "Resume a paused instance.",
        "operationId": "resume_instance_instance__instance_id__resume_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Resume Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/snapshot": {
      "post": {
        "description": "Create a snapshot from an instance.",
        "operationId": "snapshot_instance_instance__instance_id__snapshot_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Digest"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SnapshotInstanceRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Snapshot Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/ssh/key": {
      "get": {
        "description": "Get the SSH key pair for an instance.",
        "operationId": "get_ssh_key_instance__instance_id__ssh_key_get",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceSshKey"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Ssh Key",
        "tags": [
          "Instances"
        ]
      },
      "post": {
        "description": "Rotate the SSH key pair for an instance.",
        "operationId": "rotate_ssh_key_instance__instance_id__ssh_key_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceSshKey"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Rotate Ssh Key",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/ttl": {
      "post": {
        "description": "Update the TTL (Time To Live) for an instance.",
        "operationId": "update_instance_ttl_instance__instance_id__ttl_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTTLRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Instance Ttl",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/instance/{instance_id}/wake-on": {
      "post": {
        "description": "Update the wake-on-request settings for an instance.",
        "operationId": "update_instance_wake_on_instance__instance_id__wake_on_post",
        "parameters": [
          {
            "in": "path",
            "name": "instance_id",
            "required": true,
            "schema": {
              "title": "Instance Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWakeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Instance Wake On",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/invites/{token}/accept": {
      "post": {
        "description": "Accept an organization invite.",
        "operationId": "accept_organization_invite",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Invite Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMembershipModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Accept Organization Invite",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/invites/{token}/decline": {
      "post": {
        "description": "Decline an organization invite.",
        "operationId": "decline_organization_invite",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Invite Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response - No Content"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Decline Organization Invite",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs": {
      "get": {
        "description": "List all organizations the authenticated user is a member of.",
        "operationId": "list_organizations",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Organizations",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "description": "Create a new organization.",
        "operationId": "create_organization",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/active": {
      "get": {
        "description": "Return the effective organization for this request. For API-key authentication this is the API key's org scope (api_keys.organization_id). For Clerk/web sessions this reflects the user's persisted active organization (users.active_organization_id) after canonicalization.",
        "operationId": "get_active_organization",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveOrganizationResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Active Organization",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "description": "Set the user's persisted active organization (web/Clerk session UX). This does not change the org scope of existing API keys; API keys remain scoped to api_keys.organization_id.",
        "operationId": "set_active_organization",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetActiveOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveOrganizationResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Active Organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/{org_id}": {
      "get": {
        "description": "Get details of a specific organization.",
        "operationId": "get_organization",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Organization",
        "tags": [
          "Organizations"
        ]
      },
      "put": {
        "description": "Update an organization's details.",
        "operationId": "update_organization",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Organization",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/{org_id}/invites": {
      "get": {
        "description": "List all pending invites for an organization.",
        "operationId": "list_organization_invites",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationInviteListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Organization Invites",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "description": "Create an invite to an organization.",
        "operationId": "create_organization_invite",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateInviteResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Organization Invite",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/{org_id}/invites/{invite_id}": {
      "delete": {
        "description": "Revoke an organization invite.",
        "operationId": "revoke_organization_invite",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "invite_id",
            "required": true,
            "schema": {
              "title": "Invite ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response - No Content"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke Organization Invite",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/{org_id}/members": {
      "get": {
        "description": "List all members of an organization.",
        "operationId": "list_organization_members",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMemberListResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Organization Members",
        "tags": [
          "Organizations"
        ]
      },
      "post": {
        "description": "Add a member to an organization.",
        "operationId": "add_organization_member",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMembershipModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Add Organization Member",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/{org_id}/members/{user_id}": {
      "delete": {
        "description": "Remove a member from an organization.",
        "operationId": "remove_organization_member",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User ID",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response - No Content"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Remove Organization Member",
        "tags": [
          "Organizations"
        ]
      },
      "put": {
        "description": "Update a member's role in an organization.",
        "operationId": "update_member_role",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "title": "Organization ID",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User ID",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationMembershipModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Member Role",
        "tags": [
          "Organizations"
        ]
      }
    },
    "/api/orgs/{org_id}/ssh-keys": {
      "get": {
        "description": "Owner/admin-only metadata view of active and expired user-owned keys for current organization members. Public-key text is omitted and organization roles cannot mutate another user's global credential. Remove membership for urgent organization-scoped access removal.",
        "operationId": "list_organization_managed_ssh_keys",
        "parameters": [
          {
            "in": "path",
            "name": "org_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationManagedSSHKeyList"
                }
              }
            },
            "description": "Organization effective SSH-access inventory."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKeyError"
                }
              }
            },
            "description": "Organization owner or admin role is required."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Audit organization SSH public-key access",
        "tags": [
          "Organizations",
          "SSH Public Keys"
        ]
      }
    },
    "/api/services/{service_name}/delegation-token": {
      "post": {
        "description": "Exchange the authenticated user's web/API session for a short-lived service delegation token scoped to one service, organization, and scope set. This does not create a persistent Morph API key.",
        "operationId": "create_service_delegation_token",
        "parameters": [
          {
            "in": "path",
            "name": "service_name",
            "required": true,
            "schema": {
              "title": "Service Name",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServiceDelegationTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceDelegationTokenResponse"
                }
              }
            },
            "description": "Short-lived delegation token and redacted claim summary"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "Request, scopes, or audience is invalid"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "User authentication is missing or invalid"
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "Canonical billing policy denies token exchange"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "Organization, scope, or trust-and-safety policy denies token exchange"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "Target service does not exist"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "Delegation exchange rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "Delegation state could not be evaluated or token signing failed"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Service Delegation Token",
        "tags": [
          "Services"
        ]
      }
    },
    "/api/snapshot": {
      "get": {
        "description": "List snapshots.",
        "operationId": "list_snapshots_snapshot_get",
        "parameters": [
          {
            "in": "query",
            "name": "digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Digest"
            }
          },
          {
            "description": "metadata[...] query parameters for filtering snapshots",
            "example": {},
            "explode": true,
            "in": "query",
            "name": "metadata",
            "required": false,
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModelCollection"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Snapshots",
        "tags": [
          "Snapshots"
        ]
      },
      "post": {
        "description": "Create a snapshot from an image.\n\nSnapshots are point-in-time copies of a running instance that can be used to create new instances.",
        "operationId": "create_snapshot_snapshot_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSnapshotRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Snapshot",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/snapshot/list": {
      "get": {
        "description": "List snapshots (paginated).",
        "operationId": "list_snapshots_paginated_snapshot_list_get",
        "parameters": [
          {
            "in": "query",
            "name": "digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Digest"
            }
          },
          {
            "description": "Page number (1-based)",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "description": "Page number (1-based)",
              "minimum": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "description": "Number of items per page",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "description": "Number of items per page",
              "maximum": 1000,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "metadata[...] query parameters for filtering snapshots",
            "example": {},
            "explode": true,
            "in": "query",
            "name": "metadata",
            "required": false,
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModelCollectionPaginated"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Snapshots Paginated",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/snapshot/pull": {
      "post": {
        "description": "Pull a snapshot using a sharing token.",
        "operationId": "pull_snapshot_snapshot_pull_post",
        "parameters": [
          {
            "description": "Snapshot sharing token",
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "description": "Snapshot sharing token",
              "title": "Token",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Digest"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Metadata"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Pull Snapshot",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/snapshot/{snapshot_id}": {
      "delete": {
        "description": "Delete a snapshot by ID.",
        "operationId": "delete_snapshot_snapshot__snapshot_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Snapshot",
        "tags": [
          "Snapshots"
        ]
      },
      "get": {
        "description": "Get a snapshot by ID.",
        "operationId": "get_snapshot_snapshot__snapshot_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get Snapshot",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/snapshot/{snapshot_id}/boot": {
      "post": {
        "description": "Boot an instance from a snapshot.\n\nNote: Boot performs a cold restart of the operating system and destroys\nvolatile in-memory state. It is useful for resizing an instance (changing\nvCPU, memory, or disk) by restarting into a different machine configuration.\nIf you want to restore memory and process state, use instance start instead.",
        "operationId": "boot_instance_snapshot__snapshot_id__boot_post",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BootInstanceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InstanceModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Boot Instance",
        "tags": [
          "Instances"
        ]
      }
    },
    "/api/snapshot/{snapshot_id}/metadata": {
      "post": {
        "description": "Set metadata for a snapshot.",
        "operationId": "set_snapshot_metadata_snapshot__snapshot_id__metadata_post",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": {
                  "type": "string"
                },
                "title": "Metadata",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Set Snapshot Metadata",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/snapshot/{snapshot_id}/token": {
      "post": {
        "description": "Generate a stateless token for sharing a snapshot.",
        "operationId": "create_snapshot_token_snapshot__snapshot_id__token_post",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          },
          {
            "description": "Token expiration in seconds (default 1 hour)",
            "in": "query",
            "name": "expires_in",
            "required": false,
            "schema": {
              "default": 3600,
              "description": "Token expiration in seconds (default 1 hour)",
              "maximum": 86400,
              "minimum": 60,
              "title": "Expires In",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSnapshotTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Snapshot Token",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/snapshot/{snapshot_id}/ttl": {
      "post": {
        "description": "Update the TTL (Time To Live) for a snapshot.",
        "operationId": "update_snapshot_ttl_snapshot__snapshot_id__ttl_post",
        "parameters": [
          {
            "in": "path",
            "name": "snapshot_id",
            "required": true,
            "schema": {
              "title": "Snapshot Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSnapshotTTLRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update Snapshot Ttl",
        "tags": [
          "Snapshots"
        ]
      }
    },
    "/api/user/api-key": {
      "get": {
        "description": "List all active API keys for the authenticated user.",
        "operationId": "list_api_keys_user_api_key_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyModelCollection"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Api Keys",
        "tags": [
          "API Keys"
        ]
      },
      "post": {
        "description": "Issues an organization-bound user API key transactionally against fresh restriction state and the current authorization generation. Plaintext is returned once.",
        "operationId": "create_api_key_user_api_key_post",
        "parameters": [
          {
            "description": "Stable caller key. A committed replay returns 409 because plaintext key material is not recoverable.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 256,
              "type": "string"
            }
          },
          {
            "description": "Opaque request correlation identifier.",
            "in": "header",
            "name": "X-Request-ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAPIKeyResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIssuanceError"
                }
              }
            },
            "description": "Issuance input or Idempotency-Key is invalid"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CodedError"
                }
              }
            },
            "description": "User authentication is missing or invalid"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIssuanceError"
                }
              }
            },
            "description": "Trust-and-safety restriction denies credential issuance"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIssuanceError"
                }
              }
            },
            "description": "The exact organization, user, or service target does not exist"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIssuanceError"
                }
              }
            },
            "description": "A committed idempotent result cannot replay its plaintext key"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIssuanceError"
                }
              }
            },
            "description": "Credential issuance failed before a confirmed commit"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIKeyIssuanceError"
                }
              }
            },
            "description": "Issuance is disabled or its commit outcome cannot be reconciled"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Api Key",
        "tags": [
          "API Keys"
        ]
      }
    },
    "/api/user/api-key/{api_key_id}": {
      "delete": {
        "description": "Delete an API key.",
        "operationId": "delete_api_key_user_api_key__api_key_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "api_key_id",
            "required": true,
            "schema": {
              "title": "Api Key Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Api Key",
        "tags": [
          "API Keys"
        ]
      }
    },
    "/api/user/credits": {
      "get": {
        "description": "Return the active organization's available, included, and top-up credit balances plus its effective restriction state.",
        "operationId": "get_user_credits",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCreditsResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "400": {
            "description": "The authenticated user has no active organization."
          },
          "401": {
            "description": "The Clerk session or Morph API key is missing or invalid."
          },
          "500": {
            "description": "Credit state could not be synchronized."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get User Credits",
        "tags": [
          "Users"
        ]
      }
    },
    "/api/user/promo-code/redeem": {
      "post": {
        "description": "Redeem a promo code. Applies to the active organization and is single-use.",
        "operationId": "redeem_promo_code_user_promo_code_redeem_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RedeemPromoCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedeemPromoCodeResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Redeem Promo Code",
        "tags": [
          "Promo Codes"
        ]
      }
    },
    "/api/user/secret": {
      "get": {
        "description": "List all secrets for the authenticated user. Does not include secret values.",
        "operationId": "list_secrets_user_secret_get",
        "parameters": [
          {
            "description": "metadata[...] query parameters for filtering secrets",
            "example": {},
            "explode": true,
            "in": "query",
            "name": "metadata",
            "required": false,
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "style": "deepObject"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretModelCollection"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List Secrets",
        "tags": [
          "Secrets"
        ]
      },
      "post": {
        "description": "Create a new secret or update an existing one for the authenticated user.",
        "operationId": "create_secret_user_secret_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSecretRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Create Secret",
        "tags": [
          "Secrets"
        ]
      }
    },
    "/api/user/secret/{secret_name}": {
      "delete": {
        "description": "Delete a secret by name.",
        "operationId": "delete_secret_user_secret__secret_name__delete",
        "parameters": [
          {
            "in": "path",
            "name": "secret_name",
            "required": true,
            "schema": {
              "title": "Secret Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Delete Secret",
        "tags": [
          "Secrets"
        ]
      }
    },
    "/api/user/service/quota": {
      "get": {
        "description": "Return the user's quotas grouped by service, then quota_type.",
        "operationId": "get_user_service_quota_user_service_quota_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserServiceQuotaResponse"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get User Service Quota",
        "tags": [
          "Quotas"
        ]
      }
    },
    "/api/user/service/usage": {
      "get": {
        "description": "Bucketed service resource usage for the current user, grouped by service then resource_type.\n\nFor each (service, resource_type), returns 120 buckets over the requested interval with:\n  - seconds: overlapped active seconds for resources in the bucket\n  - cents: estimated cost in integer cents for the bucket",
        "operationId": "get_user_service_usage_user_service_usage_get",
        "parameters": [
          {
            "in": "query",
            "name": "interval",
            "required": false,
            "schema": {
              "default": "3h",
              "title": "Interval",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserServiceUsageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get User Service Usage",
        "tags": [
          "Usage"
        ]
      }
    },
    "/api/user/ssh-key": {
      "get": {
        "deprecated": true,
        "description": "Deprecated compatibility adapter returning the current user's active default SSH public key. Use GET /api/user/ssh-keys for managed credentials.",
        "operationId": "get_user_ssh_key_user_ssh_key_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSSHKeyModel"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get User Ssh Key",
        "tags": [
          "SSH Keys"
        ]
      },
      "put": {
        "deprecated": true,
        "description": "Deprecated compatibility adapter that atomically replaces the current user's default managed SSH public key and mirrors it to the legacy column. Use POST /api/user/ssh-keys and targeted lifecycle operations for new integrations.",
        "operationId": "update_user_ssh_key_user_ssh_key_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSSHKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSSHKeyModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Update User Ssh Key",
        "tags": [
          "SSH Keys"
        ]
      }
    },
    "/api/user/ssh-keys": {
      "get": {
        "description": "Lists up to 100 user-owned managed SSH public keys, including revoked history. Active, unexpired keys authorize direct public-key SSH to instances in every organization where the user is currently a member. Morph never accepts the corresponding private key.",
        "operationId": "list_managed_ssh_keys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKeyList"
                }
              }
            },
            "description": "Managed SSH public-key inventory."
          },
          "401": {
            "description": "Authentication is missing or invalid."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "List managed SSH public keys",
        "tags": [
          "SSH Public Keys"
        ]
      },
      "post": {
        "description": "Registers exactly one supported OpenSSH public key. The public key is user-owned; current organization membership derives its direct-SSH scope. ED25519 is recommended. Private keys, certificates, authorized_keys options, DSA, RSA keys below 3072 bits, duplicates, and past expiries are rejected.",
        "operationId": "create_managed_ssh_key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateManagedSSHKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKey"
                }
              }
            },
            "description": "SSH public key registered."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKeyError"
                }
              }
            },
            "description": "Duplicate active key/name or the 20-active-key limit was reached."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKeyError"
                }
              }
            },
            "description": "The name, public key, algorithm, RSA strength, or expiry is invalid."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Register an SSH public key",
        "tags": [
          "SSH Public Keys"
        ]
      }
    },
    "/api/user/ssh-keys/{id}": {
      "delete": {
        "description": "Revokes this key for new direct public-key SSH sessions across every current organization membership. Browser terminal access and Morph-generated instance credentials are separate and unchanged.",
        "operationId": "revoke_managed_ssh_key",
        "parameters": [
          {
            "description": "Stable managed SSH public-key ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^usk_[a-z0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Key revoked, or already revoked."
          },
          "404": {
            "description": "No key with this ID belongs to the authenticated user."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Revoke a managed SSH public key",
        "tags": [
          "SSH Public Keys"
        ]
      },
      "get": {
        "operationId": "get_managed_ssh_key",
        "parameters": [
          {
            "description": "Stable managed SSH public-key ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^usk_[a-z0-9]+$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKey"
                }
              }
            },
            "description": "Managed SSH public key."
          },
          "404": {
            "description": "No key with this ID belongs to the authenticated user."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get a managed SSH public key",
        "tags": [
          "SSH Public Keys"
        ]
      },
      "patch": {
        "description": "Updates only descriptive/lifecycle metadata. Public-key material is immutable; register a new row to rotate key material. Set expires to null to clear expiry.",
        "operationId": "update_managed_ssh_key_metadata",
        "parameters": [
          {
            "description": "Stable managed SSH public-key ID.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^usk_[a-z0-9]+$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchManagedSSHKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKey"
                }
              }
            },
            "description": "Updated managed SSH public key."
          },
          "404": {
            "description": "No active key with this ID belongs to the authenticated user."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKeyError"
                }
              }
            },
            "description": "Another active key already uses the requested name."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedSSHKeyError"
                }
              }
            },
            "description": "The name or expiry is invalid."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Rename a key or change its expiry",
        "tags": [
          "SSH Public Keys"
        ]
      }
    },
    "/api/user/usage": {
      "get": {
        "description": "Returns usage metrics for the authenticated user over a specified lookback\ninterval, divided into 120 sequential time buckets.\n\nQuery Parameters:\n- interval (str, optional): Total lookback window to aggregate usage over.\n  Default is `\"3h\"`.\n\n  Interval format: an integer value followed by a single unit character.\n  The unit is case-insensitive. Valid units are:\n  - `m` for minutes (e.g., `\"1m\"`, `\"30m\"`)\n  - `h` for hours   (e.g., `\"3h\"`)\n  - `d` for days    (e.g., `\"1d\"`, `\"7d\"`, `\"30d\"`)\n\n  A valid interval is therefore a positive integer immediately followed by\n  one of `m`, `h`, or `d` (no spaces), such as `\"30m\"`, `\"3h\"`, or `\"7d\"`.\n  Any other format or unit will be rejected.",
        "operationId": "get_user_usage_user_usage_get",
        "parameters": [
          {
            "in": "query",
            "name": "interval",
            "required": false,
            "schema": {
              "default": "3h",
              "title": "Interval",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserUsageOverviewModel"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "summary": "Get User Usage",
        "tags": [
          "Usage"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "/"
    }
  ]
}
