{
  "openapi": "3.1.0",
  "info": {
    "title": "Tool Offer Agent restricted machine adapter",
    "version": "1.0.0",
    "description": "Source-attributed API/MCP offer intake, conversation, drafting, revision and exports. No wallet connection, checkout, FAHCE execution, payment, approval, publication, administration or cross-conversation recovery through this adapter."
  },
  "servers": [
    {
      "url": "https://tooloffer.kinganlogic.com"
    }
  ],
  "security": [
    {
      "machineBearer": []
    }
  ],
  "x-release-id": "747808e7bfc65e8f64f2a13ecb91666b6d6e29463c6188a8181fbce7173565e0",
  "components": {
    "securitySchemes": {
      "machineBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/api/machine/start_session": {
      "post": {
        "operationId": "start_session",
        "description": "Create an isolated seven-day offer conversation. Requires a unique request_id; replaying it returns the same session. No model inference.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "request_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session, queued job or stored result; inspect status before claiming completion."
          },
          "400": {
            "description": "Invalid arguments"
          },
          "401": {
            "description": "Owner-issued credential required"
          },
          "404": {
            "description": "Not found or not owned"
          },
          "409": {
            "description": "Conflict or session busy/uncertain"
          },
          "429": {
            "description": "Quota exceeded"
          },
          "503": {
            "description": "Unavailable; do not blindly replay"
          }
        }
      }
    },
    "/api/machine/send_message": {
      "post": {
        "operationId": "send_message",
        "description": "Send intake, a product question, a revision or a drafting command to the existing agent. May use the operator's model budget. Returns a job; poll get_result. Never automatically resend uncertain work with a new request_id. No payments or FAHCE execution.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4000
                  }
                },
                "required": [
                  "session_id",
                  "request_id",
                  "message"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session, queued job or stored result; inspect status before claiming completion."
          },
          "400": {
            "description": "Invalid arguments"
          },
          "401": {
            "description": "Owner-issued credential required"
          },
          "404": {
            "description": "Not found or not owned"
          },
          "409": {
            "description": "Conflict or session busy/uncertain"
          },
          "429": {
            "description": "Quota exceeded"
          },
          "503": {
            "description": "Unavailable; do not blindly replay"
          }
        }
      }
    },
    "/api/machine/get_status": {
      "post": {
        "operationId": "get_status",
        "description": "Ask the existing agent for the current offer status without inference. Returns a job; poll get_result.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "session_id",
                  "request_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session, queued job or stored result; inspect status before claiming completion."
          },
          "400": {
            "description": "Invalid arguments"
          },
          "401": {
            "description": "Owner-issued credential required"
          },
          "404": {
            "description": "Not found or not owned"
          },
          "409": {
            "description": "Conflict or session busy/uncertain"
          },
          "429": {
            "description": "Quota exceeded"
          },
          "503": {
            "description": "Unavailable; do not blindly replay"
          }
        }
      }
    },
    "/api/machine/export_offer": {
      "post": {
        "operationId": "export_offer",
        "description": "Export your session's saved offer without inference. Large responses use the agent's resumable manifest; retrieve each indexed part with get_export_part. An export is not publication or certification.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "readable",
                      "buyer",
                      "representation",
                      "listing"
                    ]
                  }
                },
                "required": [
                  "session_id",
                  "request_id",
                  "format"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session, queued job or stored result; inspect status before claiming completion."
          },
          "400": {
            "description": "Invalid arguments"
          },
          "401": {
            "description": "Owner-issued credential required"
          },
          "404": {
            "description": "Not found or not owned"
          },
          "409": {
            "description": "Conflict or session busy/uncertain"
          },
          "429": {
            "description": "Quota exceeded"
          },
          "503": {
            "description": "Unavailable; do not blindly replay"
          }
        }
      }
    },
    "/api/machine/get_export_part": {
      "post": {
        "operationId": "get_export_part",
        "description": "Retrieve one existing resumable export part from your session, without inference. Preserve the manifest and verify its hashes; do not claim completion until all parts are received.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "session_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "export_id": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "index": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 999999
                  }
                },
                "required": [
                  "session_id",
                  "request_id",
                  "export_id",
                  "index"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session, queued job or stored result; inspect status before claiming completion."
          },
          "400": {
            "description": "Invalid arguments"
          },
          "401": {
            "description": "Owner-issued credential required"
          },
          "404": {
            "description": "Not found or not owned"
          },
          "409": {
            "description": "Conflict or session busy/uncertain"
          },
          "429": {
            "description": "Quota exceeded"
          },
          "503": {
            "description": "Unavailable; do not blindly replay"
          }
        }
      }
    },
    "/api/machine/get_result": {
      "post": {
        "operationId": "get_result",
        "description": "Read a job owned by your authenticated client. pending/processing/uncertain is not completion. Poll this same job; do not duplicate an uncertain message. No inference.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "job_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "job_id"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Session, queued job or stored result; inspect status before claiming completion."
          },
          "400": {
            "description": "Invalid arguments"
          },
          "401": {
            "description": "Owner-issued credential required"
          },
          "404": {
            "description": "Not found or not owned"
          },
          "409": {
            "description": "Conflict or session busy/uncertain"
          },
          "429": {
            "description": "Quota exceeded"
          },
          "503": {
            "description": "Unavailable; do not blindly replay"
          }
        }
      }
    }
  }
}
