{
  "openapi": "3.1.0",
  "info": {
    "title": "Capy API",
    "version": "1.0.0",
    "description": "Programmatic access to Capy's agent platform."
  },
  "paths": {
    "/api/v1/automations": {
      "get": {
        "tags": ["automations"],
        "operationId": "automations.list",
        "parameters": [
          {
            "name": "projectId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^\\d{1,15}:.+"
                }
              ]
            },
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "AutomationPage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationPage"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ProjectNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ProjectNotFound"
                }
              }
            }
          }
        },
        "summary": "List automations"
      },
      "post": {
        "tags": ["automations"],
        "operationId": "automations.create",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "AutomationCreated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationCreated"
                }
              }
            }
          },
          "400": {
            "description": "capy/InvalidRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_InvalidRequest"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "402": {
            "description": "capy/PaidFeatureUnavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_PaidFeatureUnavailable"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "capy/ProjectNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ProjectNotFound"
                }
              }
            }
          },
          "503": {
            "description": "capy/BillingAuthorityUnavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_BillingAuthorityUnavailable"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAutomationRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Create automation"
      }
    },
    "/api/v1/automations/{automationId}/enable": {
      "post": {
        "tags": ["automations"],
        "operationId": "automations.enable",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "400": {
            "description": "capy/InvalidRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_InvalidRequest"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "capy/AutomationNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_AutomationNotFound"
                }
              }
            }
          }
        },
        "summary": "Enable automation"
      }
    },
    "/api/v1/automations/{automationId}/disable": {
      "post": {
        "tags": ["automations"],
        "operationId": "automations.disable",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "capy/AutomationNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_AutomationNotFound"
                }
              }
            }
          }
        },
        "summary": "Disable automation"
      }
    },
    "/api/v1/automations/{automationId}/delete": {
      "post": {
        "tags": ["automations"],
        "operationId": "automations.delete",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "capy/AutomationNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_AutomationNotFound"
                }
              }
            }
          }
        },
        "summary": "Delete automation"
      }
    },
    "/api/v1/automations/{automationId}/restore": {
      "post": {
        "tags": ["automations"],
        "operationId": "automations.restore",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Automation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Automation"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "404": {
            "description": "capy/AutomationNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_AutomationNotFound"
                }
              }
            }
          }
        },
        "summary": "Restore automation"
      }
    },
    "/api/v1/threads": {
      "get": {
        "tags": ["threads"],
        "operationId": "threads.list",
        "parameters": [
          {
            "name": "projectId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["active", "waiting", "pending_user", "error", "ready_for_review", "idle"]
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "allOf": [
                {
                  "pattern": "^\\d{1,15}:.+"
                }
              ]
            },
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ThreadPage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadPage"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ProjectNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ProjectNotFound"
                }
              }
            }
          }
        },
        "summary": "List threads"
      },
      "post": {
        "tags": ["threads"],
        "operationId": "threads.create",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "402": {
            "description": "capy/PaidFeatureUnavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_PaidFeatureUnavailable"
                }
              }
            }
          },
          "404": {
            "description": "capy/ProjectNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ProjectNotFound"
                }
              }
            }
          },
          "503": {
            "description": "capy/BillingAuthorityUnavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_BillingAuthorityUnavailable"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateThreadRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Create thread"
      }
    },
    "/api/v1/threads/{threadId}": {
      "get": {
        "tags": ["threads"],
        "operationId": "threads.get",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Get thread"
      },
      "patch": {
        "tags": ["threads"],
        "operationId": "threads.rename",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameThreadRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Rename thread"
      }
    },
    "/api/v1/threads/{threadId}/archive": {
      "post": {
        "tags": ["threads"],
        "operationId": "threads.archive",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Archive thread"
      }
    },
    "/api/v1/threads/{threadId}/unarchive": {
      "post": {
        "tags": ["threads"],
        "operationId": "threads.unarchive",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Unarchive thread"
      }
    },
    "/api/v1/threads/{threadId}/regenerate-title": {
      "post": {
        "tags": ["threads"],
        "operationId": "threads.regenerateTitle",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Thread"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Regenerate thread title"
      }
    },
    "/api/v1/threads/{threadId}/tasks": {
      "get": {
        "tags": ["tasks"],
        "operationId": "tasks.list",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "TaskPage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskPage"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "List tasks"
      }
    },
    "/api/v1/tasks/{taskId}": {
      "get": {
        "tags": ["tasks"],
        "operationId": "tasks.get",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Task",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Task"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/TaskNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_TaskNotFound"
                }
              }
            }
          }
        },
        "summary": "Get task"
      }
    },
    "/api/v1/tasks/{taskId}/messages": {
      "get": {
        "tags": ["tasks"],
        "operationId": "tasks.messages",
        "parameters": [
          {
            "name": "taskId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "allOf": [
                {
                  "minLength": 26
                },
                {
                  "maxLength": 26
                }
              ]
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "MessagePage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagePage"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/TaskNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_TaskNotFound"
                }
              }
            }
          }
        },
        "summary": "List task messages"
      }
    },
    "/api/v1/threads/{threadId}/messages": {
      "get": {
        "tags": ["messages"],
        "operationId": "messages.list",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "allOf": [
                {
                  "minLength": 26
                },
                {
                  "maxLength": 26
                }
              ]
            },
            "required": false
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "MessagePage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagePage"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "List thread messages"
      }
    },
    "/api/v1/threads/{threadId}/message": {
      "post": {
        "tags": ["messages"],
        "operationId": "messages.send",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "AdmitReceipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmitReceipt"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Send message"
      }
    },
    "/api/v1/threads/{threadId}/interrupt": {
      "post": {
        "tags": ["messages"],
        "operationId": "messages.interrupt",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "AdmitReceipt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmitReceipt"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Interrupt thread"
      }
    },
    "/api/v1/threads/{threadId}/messages/{eventId}/cancel": {
      "post": {
        "tags": ["messages"],
        "operationId": "messages.cancel",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "eventId",
            "in": "path",
            "schema": {
              "type": "string",
              "allOf": [
                {
                  "minLength": 26
                },
                {
                  "maxLength": 26
                }
              ]
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "CancelMessageOutcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelMessageOutcome"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Cancel queued message"
      }
    },
    "/api/v1/threads/{threadId}/messages/{eventId}/send-now": {
      "post": {
        "tags": ["messages"],
        "operationId": "messages.sendNow",
        "parameters": [
          {
            "name": "threadId",
            "in": "path",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "name": "eventId",
            "in": "path",
            "schema": {
              "type": "string",
              "allOf": [
                {
                  "minLength": 26
                },
                {
                  "maxLength": 26
                }
              ]
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "SendNowOutcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendNowOutcome"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "404": {
            "description": "capy/ThreadNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ThreadNotFound"
                }
              }
            }
          }
        },
        "summary": "Send queued message now"
      }
    },
    "/api/v1/review-settings": {
      "get": {
        "tags": ["reviews"],
        "operationId": "reviews.settings",
        "parameters": [
          {
            "name": "repo",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewSettings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettings"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "summary": "Get review settings"
      },
      "put": {
        "tags": ["reviews"],
        "operationId": "reviews.configure",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewSettings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewSettings"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigureReviewRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Configure review settings"
      }
    },
    "/api/v1/review-billing-transfer": {
      "get": {
        "tags": ["reviews"],
        "operationId": "reviews.billingTransfer",
        "parameters": [
          {
            "name": "repo",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewBillingTransferState",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBillingTransferState"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "summary": "Get review billing transfer"
      }
    },
    "/api/v1/review-billing-transfer/offer": {
      "post": {
        "tags": ["reviews"],
        "operationId": "reviews.offerBillingTransfer",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewBillingTransferState",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBillingTransferState"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OfferReviewBillingTransferRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Offer review billing transfer"
      }
    },
    "/api/v1/review-billing-transfer/accept": {
      "post": {
        "tags": ["reviews"],
        "operationId": "reviews.acceptBillingTransfer",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewBillingTransferState",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBillingTransferState"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewBillingTransferRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Accept review billing transfer"
      }
    },
    "/api/v1/review-billing-transfer/cancel": {
      "post": {
        "tags": ["reviews"],
        "operationId": "reviews.cancelBillingTransfer",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewBillingTransferState",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBillingTransferState"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewBillingTransferRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Cancel review billing transfer"
      }
    },
    "/api/v1/review-billing-transfer/decline": {
      "post": {
        "tags": ["reviews"],
        "operationId": "reviews.declineBillingTransfer",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewBillingTransferState",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewBillingTransferState"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "403": {
            "description": "capy/Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Forbidden"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewBillingTransferRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Decline review billing transfer"
      }
    },
    "/api/v1/reviews": {
      "post": {
        "tags": ["reviews"],
        "operationId": "reviews.start",
        "parameters": [],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReviewStarted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewStarted"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          },
          "402": {
            "description": "capy/PaidFeatureUnavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_PaidFeatureUnavailable"
                }
              }
            }
          },
          "422": {
            "description": "capy/ReviewRefused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_ReviewRefused"
                }
              }
            }
          },
          "503": {
            "description": "capy/BillingAuthorityUnavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_BillingAuthorityUnavailable"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartReviewRequest"
              }
            }
          },
          "required": true
        },
        "summary": "Start review"
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": ["usage"],
        "operationId": "usage.get",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "required": false
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "UsageReport",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReport"
                }
              }
            }
          },
          "400": {
            "description": "capy/InvalidRequest",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_InvalidRequest"
                }
              }
            }
          },
          "401": {
            "description": "capy/Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/capy_Unauthorized"
                }
              }
            }
          }
        },
        "summary": "Get usage report"
      }
    }
  },
  "components": {
    "schemas": {
      "Automation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prompt": {
            "type": "string"
          },
          "triggers": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["schedule"]
                    },
                    "cron": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Five-field cron expression, e.g. `0 9 * * *` for daily at 09:00."
                        }
                      ]
                    },
                    "timezone": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "IANA timezone for the schedule, e.g. `America/New_York`."
                        }
                      ]
                    }
                  },
                  "required": ["type", "cron", "timezone"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["github"]
                    },
                    "event": {
                      "type": "string",
                      "enum": [
                        "draft_opened",
                        "pull_request_opened",
                        "pull_request_pushed",
                        "pull_request_merged",
                        "comment",
                        "branch_push",
                        "label_change",
                        "checks",
                        "issue_comment",
                        "pull_request_review_comment",
                        "pull_request_review_submitted",
                        "pull_request_review_thread",
                        "workflow_run"
                      ],
                      "description": "The GitHub event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "repositories": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Full repository names to match, e.g. owner/repo."
                        },
                        "branches": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Base branch names to match."
                        },
                        "head_branches": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Head branch names to match."
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "GitHub login names of the author to match."
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Match when any of these labels is present."
                        },
                        "states": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["open", "draft", "closed", "merged"]
                          },
                          "description": "Pull request states to match."
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Raw event action names to match, e.g. opened, closed."
                        },
                        "conclusions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Check or workflow conclusions to match, e.g. success, failure."
                        },
                        "workflows": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Workflow names to match."
                        },
                        "check_names": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Check run names to match."
                        },
                        "review_states": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Review states to match, e.g. approved, changes_requested."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "GitHub login names of the actor that fired the event."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which GitHub events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["slack"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["message", "reaction", "channel_created"],
                      "description": "The Slack event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack team ids (T...) to match. Not workspace names."
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack channel ids (C...) to match. Not #channel-names."
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack user ids (U...) of the message author to match."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack user ids (U...) of the actor that fired the event."
                        },
                        "reactions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Emoji names without colons, e.g. eyes."
                        },
                        "message_placements": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["top_level", "reply"]
                          },
                          "description": "Match top-level messages, replies, or both."
                        },
                        "message_types": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["human", "bot"]
                          },
                          "description": "Match human messages, bot messages, or both."
                        },
                        "include_bots": {
                          "type": "boolean",
                          "description": "Include messages from bots. Defaults to false."
                        },
                        "grouping_window_seconds": {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 1
                            },
                            {
                              "maximum": 300,
                              "description": "Seconds to group a burst of messages into one run. Defaults to 10."
                            }
                          ]
                        },
                        "contains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Run only when the message text contains one of these substrings."
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Skip when the message text contains one of these substrings."
                        },
                        "regex": {
                          "type": "string",
                          "description": "Run only when the message text matches this regular expression."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Slack events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["sentry"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["issue_lifecycle", "any_issue", "event_alert"],
                      "description": "The Sentry event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Sentry project slugs or ids to match."
                        },
                        "levels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue levels to match, e.g. error, warning."
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Raw event action names to match."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Sentry events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["linear"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["issue_created", "status_changed", "end_cycle"],
                      "description": "The Linear event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear workspace ids to match."
                        },
                        "teams": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear team ids or keys to match."
                        },
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear project ids to match."
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue statuses to match after the change."
                        },
                        "from_statuses": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue statuses to match before the change."
                        },
                        "status_transitions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Status transitions to match, e.g. Todo->In Progress."
                        },
                        "priorities": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue priorities to match."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear user ids of the actor that fired the event."
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Match when any of these labels is present."
                        },
                        "assignees": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear user ids of the assignee to match."
                        },
                        "cycles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear cycle ids to match."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Linear events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["incoming_webhook"]
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "contains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Run only when the request body contains one of these substrings."
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Skip when the request body contains one of these substrings."
                        },
                        "regex": {
                          "type": "string",
                          "description": "Run only when the request body matches this regular expression."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which incoming requests start a run. A condition matches when the request matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["on_demand"]
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                }
              ]
            }
          },
          "model": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "modelId": {
                    "type": "string"
                  },
                  "reasoningMode": {
                    "type": "string",
                    "enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
                  },
                  "modes": {
                    "type": "object",
                    "properties": {
                      "fast": {
                        "type": "boolean"
                      },
                      "pro": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": ["modelId"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "repos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "repo": {
                  "type": "string"
                },
                "branch": {
                  "type": "string"
                }
              },
              "required": ["repo", "branch"],
              "additionalProperties": false
            }
          },
          "threadMode": {
            "type": "string",
            "enum": ["new", "single"]
          },
          "mcpOverrides": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "enabled_server_keys": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "External MCP server keys to enable for this automation's runs, beyond the project defaults. A key may not appear in both lists."
                  },
                  "disabled_server_keys": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "External MCP server keys to disable for this automation's runs."
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "maxRunsPerDay": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "machineSize": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["small", "medium", "large", "ultra", "hyper", "bigguy"]
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "deleted": {
            "type": "boolean"
          },
          "disabledReason": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": ["run_as_unavailable"]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "runAsKind": {
            "type": "string",
            "enum": ["human", "service"]
          },
          "runAsId": {
            "type": "string"
          },
          "runCount": {
            "type": "integer"
          },
          "lastTriggeredAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "projectId",
          "name",
          "description",
          "prompt",
          "triggers",
          "model",
          "repos",
          "threadMode",
          "mcpOverrides",
          "maxRunsPerDay",
          "machineSize",
          "enabled",
          "deleted",
          "disabledReason",
          "runAsKind",
          "runAsId",
          "runCount",
          "lastTriggeredAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "AutomationPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Automation"
            }
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^\\d{1,15}:.+"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["items", "cursor"],
        "additionalProperties": false
      },
      "capy_ProjectNotFound": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/ProjectNotFound"]
          },
          "projectId": {
            "type": "string"
          }
        },
        "required": ["_tag", "projectId"],
        "additionalProperties": false
      },
      "capy_Unauthorized": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/Unauthorized"]
          }
        },
        "required": ["_tag"],
        "additionalProperties": false
      },
      "CreateAutomationRequest": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 191
              }
            ]
          },
          "projectId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              }
            ]
          },
          "description": {
            "type": "string"
          },
          "prompt": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              }
            ]
          },
          "triggers": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["schedule"]
                    },
                    "cron": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Five-field cron expression, e.g. `0 9 * * *` for daily at 09:00."
                        }
                      ]
                    },
                    "timezone": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "IANA timezone for the schedule, e.g. `America/New_York`."
                        }
                      ]
                    }
                  },
                  "required": ["type", "cron", "timezone"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["github"]
                    },
                    "event": {
                      "type": "string",
                      "enum": [
                        "draft_opened",
                        "pull_request_opened",
                        "pull_request_pushed",
                        "pull_request_merged",
                        "comment",
                        "branch_push",
                        "label_change",
                        "checks",
                        "issue_comment",
                        "pull_request_review_comment",
                        "pull_request_review_submitted",
                        "pull_request_review_thread",
                        "workflow_run"
                      ],
                      "description": "The GitHub event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "repositories": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Full repository names to match, e.g. owner/repo."
                        },
                        "branches": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Base branch names to match."
                        },
                        "head_branches": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Head branch names to match."
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "GitHub login names of the author to match."
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Match when any of these labels is present."
                        },
                        "states": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["open", "draft", "closed", "merged"]
                          },
                          "description": "Pull request states to match."
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Raw event action names to match, e.g. opened, closed."
                        },
                        "conclusions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Check or workflow conclusions to match, e.g. success, failure."
                        },
                        "workflows": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Workflow names to match."
                        },
                        "check_names": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Check run names to match."
                        },
                        "review_states": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Review states to match, e.g. approved, changes_requested."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "GitHub login names of the actor that fired the event."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which GitHub events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["slack"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["message", "reaction", "channel_created"],
                      "description": "The Slack event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack team ids (T...) to match. Not workspace names."
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack channel ids (C...) to match. Not #channel-names."
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack user ids (U...) of the message author to match."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack user ids (U...) of the actor that fired the event."
                        },
                        "reactions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Emoji names without colons, e.g. eyes."
                        },
                        "message_placements": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["top_level", "reply"]
                          },
                          "description": "Match top-level messages, replies, or both."
                        },
                        "message_types": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["human", "bot"]
                          },
                          "description": "Match human messages, bot messages, or both."
                        },
                        "include_bots": {
                          "type": "boolean",
                          "description": "Include messages from bots. Defaults to false."
                        },
                        "grouping_window_seconds": {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 1
                            },
                            {
                              "maximum": 300,
                              "description": "Seconds to group a burst of messages into one run. Defaults to 10."
                            }
                          ]
                        },
                        "contains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Run only when the message text contains one of these substrings."
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Skip when the message text contains one of these substrings."
                        },
                        "regex": {
                          "type": "string",
                          "description": "Run only when the message text matches this regular expression."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Slack events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["sentry"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["issue_lifecycle", "any_issue", "event_alert"],
                      "description": "The Sentry event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Sentry project slugs or ids to match."
                        },
                        "levels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue levels to match, e.g. error, warning."
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Raw event action names to match."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Sentry events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["linear"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["issue_created", "status_changed", "end_cycle"],
                      "description": "The Linear event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear workspace ids to match."
                        },
                        "teams": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear team ids or keys to match."
                        },
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear project ids to match."
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue statuses to match after the change."
                        },
                        "from_statuses": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue statuses to match before the change."
                        },
                        "status_transitions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Status transitions to match, e.g. Todo->In Progress."
                        },
                        "priorities": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue priorities to match."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear user ids of the actor that fired the event."
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Match when any of these labels is present."
                        },
                        "assignees": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear user ids of the assignee to match."
                        },
                        "cycles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear cycle ids to match."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Linear events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["incoming_webhook"]
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "contains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Run only when the request body contains one of these substrings."
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Skip when the request body contains one of these substrings."
                        },
                        "regex": {
                          "type": "string",
                          "description": "Run only when the request body matches this regular expression."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which incoming requests start a run. A condition matches when the request matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["on_demand"]
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                }
              ]
            },
            "allOf": [
              {
                "minItems": 1
              },
              {
                "maxItems": 20
              }
            ]
          },
          "model": {
            "type": "object",
            "properties": {
              "modelId": {
                "type": "string"
              },
              "reasoningMode": {
                "type": "string",
                "enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
              },
              "modes": {
                "type": "object",
                "properties": {
                  "fast": {
                    "type": "boolean"
                  },
                  "pro": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": ["modelId"],
            "additionalProperties": false
          },
          "repos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "repo": {
                  "type": "string"
                },
                "branch": {
                  "type": "string"
                }
              },
              "required": ["repo", "branch"],
              "additionalProperties": false
            }
          },
          "threadMode": {
            "type": "string",
            "enum": ["new", "single"]
          },
          "mcpOverrides": {
            "type": "object",
            "properties": {
              "enabled_server_keys": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "External MCP server keys to enable for this automation's runs, beyond the project defaults. A key may not appear in both lists."
              },
              "disabled_server_keys": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "External MCP server keys to disable for this automation's runs."
              }
            },
            "additionalProperties": false
          },
          "maxRunsPerDay": {
            "type": "integer",
            "allOf": [
              {
                "minimum": 1
              }
            ]
          },
          "machineSize": {
            "type": "string",
            "enum": ["small", "medium", "large", "ultra", "hyper", "bigguy"]
          },
          "runAs": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": ["human"]
                  },
                  "user_id": {
                    "type": "string"
                  }
                },
                "required": ["kind"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": ["service"]
                  },
                  "service_user_id": {
                    "type": "string"
                  }
                },
                "required": ["kind", "service_user_id"],
                "additionalProperties": false
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": ["requestId", "projectId", "name", "prompt", "triggers"],
        "additionalProperties": false
      },
      "AutomationCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "prompt": {
            "type": "string"
          },
          "triggers": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["schedule"]
                    },
                    "cron": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Five-field cron expression, e.g. `0 9 * * *` for daily at 09:00."
                        }
                      ]
                    },
                    "timezone": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "IANA timezone for the schedule, e.g. `America/New_York`."
                        }
                      ]
                    }
                  },
                  "required": ["type", "cron", "timezone"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["github"]
                    },
                    "event": {
                      "type": "string",
                      "enum": [
                        "draft_opened",
                        "pull_request_opened",
                        "pull_request_pushed",
                        "pull_request_merged",
                        "comment",
                        "branch_push",
                        "label_change",
                        "checks",
                        "issue_comment",
                        "pull_request_review_comment",
                        "pull_request_review_submitted",
                        "pull_request_review_thread",
                        "workflow_run"
                      ],
                      "description": "The GitHub event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "repositories": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Full repository names to match, e.g. owner/repo."
                        },
                        "branches": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Base branch names to match."
                        },
                        "head_branches": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Head branch names to match."
                        },
                        "authors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "GitHub login names of the author to match."
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Match when any of these labels is present."
                        },
                        "states": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["open", "draft", "closed", "merged"]
                          },
                          "description": "Pull request states to match."
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Raw event action names to match, e.g. opened, closed."
                        },
                        "conclusions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Check or workflow conclusions to match, e.g. success, failure."
                        },
                        "workflows": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Workflow names to match."
                        },
                        "check_names": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Check run names to match."
                        },
                        "review_states": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Review states to match, e.g. approved, changes_requested."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "GitHub login names of the actor that fired the event."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which GitHub events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["slack"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["message", "reaction", "channel_created"],
                      "description": "The Slack event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack team ids (T...) to match. Not workspace names."
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack channel ids (C...) to match. Not #channel-names."
                        },
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack user ids (U...) of the message author to match."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Slack user ids (U...) of the actor that fired the event."
                        },
                        "reactions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Emoji names without colons, e.g. eyes."
                        },
                        "message_placements": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["top_level", "reply"]
                          },
                          "description": "Match top-level messages, replies, or both."
                        },
                        "message_types": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["human", "bot"]
                          },
                          "description": "Match human messages, bot messages, or both."
                        },
                        "include_bots": {
                          "type": "boolean",
                          "description": "Include messages from bots. Defaults to false."
                        },
                        "grouping_window_seconds": {
                          "type": "integer",
                          "allOf": [
                            {
                              "minimum": 1
                            },
                            {
                              "maximum": 300,
                              "description": "Seconds to group a burst of messages into one run. Defaults to 10."
                            }
                          ]
                        },
                        "contains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Run only when the message text contains one of these substrings."
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Skip when the message text contains one of these substrings."
                        },
                        "regex": {
                          "type": "string",
                          "description": "Run only when the message text matches this regular expression."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Slack events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["sentry"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["issue_lifecycle", "any_issue", "event_alert"],
                      "description": "The Sentry event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Sentry project slugs or ids to match."
                        },
                        "levels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue levels to match, e.g. error, warning."
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Raw event action names to match."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Sentry events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["linear"]
                    },
                    "event": {
                      "type": "string",
                      "enum": ["issue_created", "status_changed", "end_cycle"],
                      "description": "The Linear event that starts a run."
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "workspaces": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear workspace ids to match."
                        },
                        "teams": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear team ids or keys to match."
                        },
                        "projects": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear project ids to match."
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue statuses to match after the change."
                        },
                        "from_statuses": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue statuses to match before the change."
                        },
                        "status_transitions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Status transitions to match, e.g. Todo->In Progress."
                        },
                        "priorities": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Issue priorities to match."
                        },
                        "actors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear user ids of the actor that fired the event."
                        },
                        "labels": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Match when any of these labels is present."
                        },
                        "assignees": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear user ids of the assignee to match."
                        },
                        "cycles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Linear cycle ids to match."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which Linear events start a run. A condition matches when the event matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type", "event"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["incoming_webhook"]
                    },
                    "conditions": {
                      "type": "object",
                      "properties": {
                        "contains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Run only when the request body contains one of these substrings."
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Skip when the request body contains one of these substrings."
                        },
                        "regex": {
                          "type": "string",
                          "description": "Run only when the request body matches this regular expression."
                        }
                      },
                      "additionalProperties": false,
                      "description": "Filters that narrow which incoming requests start a run. A condition matches when the request matches any of its listed values."
                    },
                    "run_when": {
                      "type": "string",
                      "allOf": [
                        {
                          "minLength": 1,
                          "description": "Natural-language gate checked against each event before a run starts; non-matching events are skipped, so keep it to one sentence."
                        }
                      ]
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": ["on_demand"]
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                }
              ]
            }
          },
          "model": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "modelId": {
                    "type": "string"
                  },
                  "reasoningMode": {
                    "type": "string",
                    "enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
                  },
                  "modes": {
                    "type": "object",
                    "properties": {
                      "fast": {
                        "type": "boolean"
                      },
                      "pro": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": ["modelId"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "repos": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "repo": {
                  "type": "string"
                },
                "branch": {
                  "type": "string"
                }
              },
              "required": ["repo", "branch"],
              "additionalProperties": false
            }
          },
          "threadMode": {
            "type": "string",
            "enum": ["new", "single"]
          },
          "mcpOverrides": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "enabled_server_keys": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "External MCP server keys to enable for this automation's runs, beyond the project defaults. A key may not appear in both lists."
                  },
                  "disabled_server_keys": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "External MCP server keys to disable for this automation's runs."
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "maxRunsPerDay": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "machineSize": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["small", "medium", "large", "ultra", "hyper", "bigguy"]
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "deleted": {
            "type": "boolean"
          },
          "disabledReason": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": ["run_as_unavailable"]
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "runAsKind": {
            "type": "string",
            "enum": ["human", "service"]
          },
          "runAsId": {
            "type": "string"
          },
          "runCount": {
            "type": "integer"
          },
          "lastTriggeredAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "webhookUrl": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "projectId",
          "name",
          "description",
          "prompt",
          "triggers",
          "model",
          "repos",
          "threadMode",
          "mcpOverrides",
          "maxRunsPerDay",
          "machineSize",
          "enabled",
          "deleted",
          "disabledReason",
          "runAsKind",
          "runAsId",
          "runCount",
          "lastTriggeredAt",
          "createdAt",
          "updatedAt",
          "webhookUrl"
        ],
        "additionalProperties": false
      },
      "capy_Forbidden": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/Forbidden"]
          }
        },
        "required": ["_tag"],
        "additionalProperties": false
      },
      "capy_InvalidRequest": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/InvalidRequest"]
          },
          "message": {
            "type": "string"
          }
        },
        "required": ["_tag", "message"],
        "additionalProperties": false
      },
      "capy_PaidFeatureUnavailable": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/PaidFeatureUnavailable"]
          },
          "feature": {
            "type": "string",
            "enum": ["bigguy"]
          }
        },
        "required": ["_tag", "feature"],
        "additionalProperties": false
      },
      "capy_BillingAuthorityUnavailable": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/BillingAuthorityUnavailable"]
          }
        },
        "required": ["_tag"],
        "additionalProperties": false
      },
      "capy_AutomationNotFound": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/AutomationNotFound"]
          },
          "automationId": {
            "type": "string"
          }
        },
        "required": ["_tag", "automationId"],
        "additionalProperties": false
      },
      "UsageTotals": {
        "type": "object",
        "properties": {
          "llmCredits": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "imageCredits": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "vmCredits": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "totalCredits": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          }
        },
        "required": ["llmCredits", "imageCredits", "vmCredits", "totalCredits"],
        "additionalProperties": false
      },
      "Thread": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "projectId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "titleCustom": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "waiting",
              "pending_user",
              "error",
              "ready_for_review",
              "idle",
              "archived"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "lastModelId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/UsageTotals"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "lastActivityAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "projectId",
          "title",
          "titleCustom",
          "status",
          "archived",
          "lastModelId",
          "usage",
          "createdAt",
          "updatedAt",
          "lastActivityAt"
        ],
        "additionalProperties": false
      },
      "ThreadPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Thread"
            }
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "pattern": "^\\d{1,15}:.+"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["items", "cursor"],
        "additionalProperties": false
      },
      "capy_ThreadNotFound": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/ThreadNotFound"]
          },
          "threadId": {
            "type": "string"
          }
        },
        "required": ["_tag", "threadId"],
        "additionalProperties": false
      },
      "CreateThreadRequest": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 191
              }
            ]
          },
          "projectId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "modelId": {
                "type": "string"
              },
              "reasoningMode": {
                "type": "string",
                "enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
              },
              "modes": {
                "type": "object",
                "properties": {
                  "fast": {
                    "type": "boolean"
                  },
                  "pro": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": ["modelId"],
            "additionalProperties": false
          },
          "machineSize": {
            "type": "string",
            "enum": ["small", "medium", "large", "ultra", "hyper", "bigguy"]
          }
        },
        "required": ["requestId", "projectId", "message"],
        "additionalProperties": false
      },
      "RenameThreadRequest": {
        "type": "object",
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["title"],
        "additionalProperties": false
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "threadId": {
            "type": "string"
          },
          "parentId": {
            "type": "string"
          },
          "taskPath": {
            "type": "string"
          },
          "projectId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": ["working", "waiting", "idle", "done", "failed"]
          },
          "usage": {
            "$ref": "#/components/schemas/UsageTotals"
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "lastActivityAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "threadId",
          "parentId",
          "taskPath",
          "projectId",
          "title",
          "status",
          "usage",
          "createdAt",
          "updatedAt",
          "lastActivityAt"
        ],
        "additionalProperties": false
      },
      "TaskPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["items", "cursor"],
        "additionalProperties": false
      },
      "capy_TaskNotFound": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/TaskNotFound"]
          },
          "taskId": {
            "type": "string"
          }
        },
        "required": ["_tag", "taskId"],
        "additionalProperties": false
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": ["user", "assistant", "tool"]
          },
          "tool": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "file": {
                  "type": "object",
                  "properties": {
                    "fileId": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "mediaType": {
                      "type": "string"
                    },
                    "sizeBytes": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": ["NaN"]
                            },
                            {
                              "type": "string",
                              "enum": ["Infinity"]
                            },
                            {
                              "type": "string",
                              "enum": ["-Infinity"]
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": ["Infinity", "-Infinity", "NaN"]
                        }
                      ]
                    },
                    "preview": {
                      "type": "boolean"
                    },
                    "width": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": ["NaN"]
                            },
                            {
                              "type": "string",
                              "enum": ["Infinity"]
                            },
                            {
                              "type": "string",
                              "enum": ["-Infinity"]
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": ["Infinity", "-Infinity", "NaN"]
                        }
                      ]
                    },
                    "height": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "number"
                            },
                            {
                              "type": "string",
                              "enum": ["NaN"]
                            },
                            {
                              "type": "string",
                              "enum": ["Infinity"]
                            },
                            {
                              "type": "string",
                              "enum": ["-Infinity"]
                            }
                          ]
                        },
                        {
                          "type": "string",
                          "enum": ["Infinity", "-Infinity", "NaN"]
                        }
                      ]
                    }
                  },
                  "required": ["fileId", "name", "mediaType", "sizeBytes"],
                  "additionalProperties": false
                },
                "title": {
                  "type": "string"
                }
              },
              "required": ["file"],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": ["id", "source", "text", "createdAt"],
        "additionalProperties": false
      },
      "MessagePage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string",
                "allOf": [
                  {
                    "minLength": 26
                  },
                  {
                    "maxLength": 26
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["items", "cursor"],
        "additionalProperties": false
      },
      "SendMessageRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "model": {
            "type": "object",
            "properties": {
              "modelId": {
                "type": "string"
              },
              "reasoningMode": {
                "type": "string",
                "enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
              },
              "modes": {
                "type": "object",
                "properties": {
                  "fast": {
                    "type": "boolean"
                  },
                  "pro": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": ["modelId"],
            "additionalProperties": false
          },
          "delivery": {
            "type": "string",
            "enum": ["queue", "steer", "interrupt"]
          }
        },
        "required": ["text"],
        "additionalProperties": false
      },
      "AdmitReceipt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "allOf": [
              {
                "minLength": 26
              },
              {
                "maxLength": 26
              }
            ]
          },
          "deduped": {
            "type": "boolean"
          }
        },
        "required": ["id", "deduped"],
        "additionalProperties": false
      },
      "CancelMessageOutcome": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "enum": ["cancelled", "tooLate"]
          }
        },
        "required": ["outcome"],
        "additionalProperties": false
      },
      "SendNowOutcome": {
        "type": "object",
        "properties": {
          "outcome": {
            "type": "string",
            "enum": ["sent", "tooLate"]
          },
          "id": {
            "type": "string",
            "allOf": [
              {
                "minLength": 26
              },
              {
                "maxLength": 26
              }
            ]
          }
        },
        "required": ["outcome"],
        "additionalProperties": false
      },
      "ReviewSettings": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "billingOrgId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "heldByCaller": {
            "type": "boolean"
          },
          "autoReview": {
            "type": "string",
            "enum": ["off", "once", "always"]
          },
          "postingThreshold": {
            "type": "string",
            "enum": ["low", "medium", "high"]
          },
          "postInvestigate": {
            "type": "boolean"
          },
          "postNotes": {
            "type": "boolean"
          }
        },
        "required": [
          "repo",
          "billingOrgId",
          "heldByCaller",
          "autoReview",
          "postingThreshold",
          "postInvestigate",
          "postNotes"
        ],
        "additionalProperties": false
      },
      "capy_ReviewRefused": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": ["capy/ReviewRefused"]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": ["_tag", "reason"],
        "additionalProperties": false
      },
      "ConfigureReviewRequest": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "autoReview": {
            "type": "string",
            "enum": ["off", "once", "always"]
          },
          "postingThreshold": {
            "type": "string",
            "enum": ["low", "medium", "high"]
          },
          "postInvestigate": {
            "type": "boolean"
          },
          "postNotes": {
            "type": "boolean"
          }
        },
        "required": ["repo"],
        "additionalProperties": false
      },
      "ReviewBillingTransferOffer": {
        "type": "object",
        "properties": {
          "fromOrgId": {
            "type": "string"
          },
          "toOrgId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          }
        },
        "required": ["fromOrgId", "toOrgId", "createdAt"],
        "additionalProperties": false
      },
      "ReviewBillingTransferState": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "billingOrgId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "offer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ReviewBillingTransferOffer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["repo", "billingOrgId", "offer"],
        "additionalProperties": false
      },
      "OfferReviewBillingTransferRequest": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "targetOrgId": {
            "type": "string"
          }
        },
        "required": ["repo", "targetOrgId"],
        "additionalProperties": false
      },
      "ReviewBillingTransferRequest": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          }
        },
        "required": ["repo"],
        "additionalProperties": false
      },
      "StartReviewRequest": {
        "type": "object",
        "properties": {
          "repo": {
            "type": "string"
          },
          "prNumber": {
            "type": "integer"
          },
          "idempotencyKey": {
            "type": "string",
            "allOf": [
              {
                "minLength": 1
              },
              {
                "maxLength": 191
              }
            ]
          },
          "forceRefresh": {
            "type": "boolean"
          },
          "sourceThreadId": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "effort": {
            "type": "string",
            "enum": ["none", "minimal", "low", "medium", "high", "xhigh", "max"]
          }
        },
        "required": ["repo", "prNumber"],
        "additionalProperties": false
      },
      "ReviewStarted": {
        "type": "object",
        "properties": {
          "reviewId": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "threadId": {
            "type": "string"
          },
          "headSha": {
            "type": "string"
          },
          "adopted": {
            "type": "boolean"
          },
          "sourceRecorded": {
            "type": "boolean"
          }
        },
        "required": ["reviewId", "requestId", "threadId", "headSha", "adopted"],
        "additionalProperties": false
      },
      "UsageDollars": {
        "type": "object",
        "properties": {
          "llmDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "imageDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "vmDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "totalDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          }
        },
        "required": ["llmDollars", "imageDollars", "vmDollars", "totalDollars"],
        "additionalProperties": false
      },
      "UsageTokenTotals": {
        "type": "object",
        "properties": {
          "inputTokens": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "outputTokens": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "cacheReadTokens": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "cacheWriteTokens": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          }
        },
        "required": ["inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens"],
        "additionalProperties": false
      },
      "UsageMemberDollars": {
        "type": "object",
        "properties": {
          "principalUserId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "llmDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "imageDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "vmDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "totalDollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          }
        },
        "required": ["principalUserId", "llmDollars", "imageDollars", "vmDollars", "totalDollars"],
        "additionalProperties": false
      },
      "UsageModelDollars": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "dollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          },
          "unbilled": {
            "type": "boolean"
          },
          "tokens": {
            "$ref": "#/components/schemas/UsageTokenTotals"
          }
        },
        "required": ["model", "label", "dollars", "unbilled", "tokens"],
        "additionalProperties": false
      },
      "UsageImageDollars": {
        "type": "object",
        "properties": {
          "endpoint": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "dollars": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "string",
                    "enum": ["NaN"]
                  },
                  {
                    "type": "string",
                    "enum": ["Infinity"]
                  },
                  {
                    "type": "string",
                    "enum": ["-Infinity"]
                  }
                ]
              },
              {
                "type": "string",
                "enum": ["Infinity", "-Infinity", "NaN"]
              }
            ]
          }
        },
        "required": ["endpoint", "label", "dollars"],
        "additionalProperties": false
      },
      "UsageReport": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageDollars"
          },
          "tokens": {
            "$ref": "#/components/schemas/UsageTokenTotals"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageMemberDollars"
            }
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageModelDollars"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageImageDollars"
            }
          }
        },
        "required": ["from", "to", "totals", "tokens", "members", "models", "images"],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Capy API key",
        "description": "An API key created in Capy under Settings → API."
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "automations"
    },
    {
      "name": "threads"
    },
    {
      "name": "tasks"
    },
    {
      "name": "messages"
    },
    {
      "name": "reviews"
    },
    {
      "name": "usage"
    }
  ],
  "servers": [
    {
      "url": "https://api.capy.ai"
    }
  ]
}
