{
  "openapi": "3.1.0",
  "info": {
    "title": "Jesse client integration API",
    "version": "1.0.0",
    "description": "Public chat and agent API subset. Budgets are client defaults. This specification does not promise unrestricted coding, embeddings, audio, image generation or provider-hosted tools."
  },
  "servers": [
    {
      "url": "https://jesse.my/api"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "apiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/capabilities": {
      "get": {
        "operationId": "capabilities",
        "summary": "Read the versioned Jesse API capability contract.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      }
    },
    "/v1/models": {
      "get": {
        "operationId": "models",
        "summary": "List the public models available to this key.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      }
    },
    "/v1/chat/completions": {
      "post": {
        "operationId": "complete",
        "summary": "Ask Jesse, call tools or resume a graph phase; retain the Jesse receipt.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "jesse",
                      "jesse-prod",
                      "jesse-pristine"
                    ],
                    "default": "jesse"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "array"
                  },
                  "tool_choice": {},
                  "response_format": {},
                  "pack": {},
                  "phase": {},
                  "pipeline": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "messages"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/messages": {
      "post": {
        "operationId": "messages",
        "summary": "Anthropic Messages chat and agent turns, with full message history.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "jesse",
                      "jesse-prod",
                      "jesse-pristine"
                    ],
                    "default": "jesse"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "system": {},
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "array"
                  }
                },
                "required": [
                  "messages"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/responses": {
      "post": {
        "operationId": "responses",
        "summary": "Stateless Responses chat and agent turns; send full history.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "jesse",
                      "jesse-prod",
                      "jesse-pristine"
                    ],
                    "default": "jesse"
                  },
                  "input": {},
                  "instructions": {
                    "type": "string",
                    "minLength": 1
                  },
                  "stream": {
                    "type": "boolean"
                  },
                  "tools": {
                    "type": "array"
                  }
                },
                "required": [
                  "input"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/messages/count_tokens": {
      "post": {
        "operationId": "count_tokens",
        "summary": "Count a Messages request without generating an answer.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "jesse",
                      "jesse-prod",
                      "jesse-pristine"
                    ],
                    "default": "jesse"
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    },
                    "minItems": 1
                  },
                  "system": {},
                  "tools": {
                    "type": "array"
                  }
                },
                "required": [
                  "messages"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "usage",
        "summary": "Inspect usage and quota for the authenticated caller.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      }
    },
    "/v1/agent": {
      "get": {
        "operationId": "agent",
        "summary": "Inspect this key's learned layer and pristine baseline.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      }
    },
    "/v1/agent/reset": {
      "post": {
        "operationId": "agent_reset",
        "summary": "Erase the learned layer; documents are erased only when requested.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": true,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "documents": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/memory": {
      "get": {
        "operationId": "memory",
        "summary": "Inspect the caller's remembered facts.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "delete": {
        "operationId": "memory_reset",
        "summary": "Erase this key's remembered facts; optionally indexed searches.",
        "parameters": [
          {
            "name": "searches",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": true,
        "x-jesse-streaming": false
      }
    },
    "/v1/documents": {
      "get": {
        "operationId": "documents",
        "summary": "List this key's documents.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "post": {
        "operationId": "document_create",
        "summary": "Store text in the caller's document library.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1
                  },
                  "metadata": {
                    "type": "object"
                  }
                },
                "required": [
                  "name",
                  "text"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/documents/{id}": {
      "get": {
        "operationId": "document",
        "summary": "Read a document by id or stable name.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "raw",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "delete": {
        "operationId": "document_delete",
        "summary": "Delete the caller's document.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": true,
        "x-jesse-streaming": false
      }
    },
    "/v1/documents/{name}": {
      "put": {
        "operationId": "document_put",
        "summary": "Replace a named document using version for optimistic concurrency.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1
                  },
                  "json": {},
                  "version": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "metadata": {
                    "type": "object"
                  }
                },
                "required": [],
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "text"
                    ],
                    "not": {
                      "required": [
                        "json"
                      ]
                    }
                  },
                  {
                    "required": [
                      "json"
                    ],
                    "not": {
                      "required": [
                        "text"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/documents/query": {
      "post": {
        "operationId": "documents_query",
        "summary": "Query the caller's document retrieval index.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1
                  },
                  "k": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "query"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/packs": {
      "get": {
        "operationId": "packs",
        "summary": "List this key's tool packs.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "post": {
        "operationId": "pack_create",
        "summary": "Register a versioned pack of tools, schemas, invariants and pipelines.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "tools": {
                    "type": "array"
                  },
                  "schemas": {
                    "type": "object"
                  },
                  "invariants": {
                    "type": "object"
                  },
                  "pipelines": {
                    "type": "object"
                  }
                },
                "required": [
                  "name",
                  "tools"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/packs/{name}": {
      "get": {
        "operationId": "pack",
        "summary": "Read a current or hash-pinned tool pack.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "hash",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "put": {
        "operationId": "pack_put",
        "summary": "Publish the next version of a pack owned by this key.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": true
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "pack_delete",
        "summary": "Delete the caller's tool pack.",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": true,
        "x-jesse-streaming": false
      }
    },
    "/v1/hooks": {
      "get": {
        "operationId": "hooks",
        "summary": "List hook declarations; Jesse does not invoke their URLs.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "post": {
        "operationId": "hook_create",
        "summary": "Store a hook declaration without invoking it.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1
                  },
                  "pack": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "url"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/hooks/{id}": {
      "get": {
        "operationId": "hook",
        "summary": "Read the caller's hook declaration.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      },
      "delete": {
        "operationId": "hook_delete",
        "summary": "Delete a hook declaration.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": true,
        "x-jesse-streaming": false
      }
    },
    "/v1/tools/results/{id}": {
      "get": {
        "operationId": "tool_result",
        "summary": "Read a posted tool result owned by this key.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false
      }
    },
    "/v1/tools/results": {
      "post": {
        "operationId": "tool_result_post",
        "summary": "Post a result for an outstanding graph tool call.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "call_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "result": {},
                  "content": {}
                },
                "required": [
                  "call_id"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/checks": {
      "post": {
        "operationId": "checks",
        "summary": "Check a proposed world-state patch against invariants.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "state": {},
                  "patch": {},
                  "invariant": {},
                  "invariants": {
                    "type": "array"
                  },
                  "pack": {}
                },
                "required": [
                  "state"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/feedback": {
      "post": {
        "operationId": "feedback",
        "summary": "Record a correction or rating for a completion.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "completion_id": {
                    "type": "string",
                    "minLength": 1
                  },
                  "rating": {
                    "type": "string",
                    "enum": [
                      "positive",
                      "negative"
                    ]
                  },
                  "correction": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "completion_id",
                  "rating"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/v1/dispatch": {
      "post": {
        "operationId": "dispatch",
        "summary": "Dispatch bounded subrequests through the same authenticated API.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success. Preserve the full response and any Jesse receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Invalid input or unsupported API feature."
          },
          "401": {
            "description": "Missing, invalid or revoked Jesse credential."
          },
          "402": {
            "description": "Trial or billing admission refused."
          },
          "403": {
            "description": "Scope refused."
          },
          "404": {
            "description": "Owned resource or pinned pack absent."
          },
          "409": {
            "description": "Expected resource version differs; nothing was replaced."
          },
          "429": {
            "description": "Rate limited. Honor Retry-After; do not replay billable or mutating requests automatically."
          },
          "503": {
            "description": "Service or authorization unavailable."
          }
        },
        "x-jesse-destructive": false,
        "x-jesse-streaming": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "jesse",
                      "jesse-prod",
                      "jesse-pristine"
                    ],
                    "default": "jesse"
                  },
                  "tasks": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1
                        },
                        "prompt": {
                          "type": "string",
                          "minLength": 1
                        },
                        "messages": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "minItems": 1
                        },
                        "depends_on": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 1
                          }
                        }
                      },
                      "required": [
                        "id"
                      ],
                      "additionalProperties": true
                    }
                  },
                  "max_parallel": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "required": [
                  "tasks"
                ],
                "additionalProperties": true
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  }
}
