{
  "openapi": "3.0.0",
  "info": {
    "title": "RelTime Protocol API",
    "version": "1.0.0",
    "description": "Cryptographic timestamping using Bitcoin block times as verifiable thermodynamically bound anchors."
  },
  "servers": [
    {
      "url": "https://api.rel-time.com",
      "description": "RelTime Local Engine"
    }
  ],
  "paths": {
    "/v1/anchor": {
      "post": {
        "summary": "Anchor a hash into the thermodynamic timeline",
        "parameters": [
          {
            "name": "X-RelTime-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_hash": {
                    "type": "string"
                  }
                },
                "required": [
                  "client_hash"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Anchor payload accepted for next block",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "thermodynamic_proof": {
                      "type": "string"
                    },
                    "epoch_target": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/history": {
      "get": {
        "summary": "Retrieve the anchor history of an API Key",
        "parameters": [
          {
            "name": "X-RelTime-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of anchors and mempool TXIDs"
          }
        }
      }
    }
  }
}
