{
  "openapi": "3.1.0",
  "info": {
    "title": "Cleantech Content Ofgem agent pilot",
    "version": "1.2.0",
    "description": "Five free calls, then 0.01 USDC per eligible paid lookup on Base. Business registration required. Read /docs/, /licence/ and /privacy/."
  },
  "servers": [
    {
      "url": "https://cleantech-agent-demand.old-rain-22ad.workers.dev"
    }
  ],
  "paths": {
    "/v1/keys/free": {
      "post": {
        "operationId": "issueTrial",
        "responses": {
          "201": {
            "description": "JSON response; see docs for schema and recovery semantics."
          },
          "429": {
            "description": "JSON response; see docs for schema and recovery semantics."
          },
          "503": {
            "description": "JSON response; see docs for schema and recovery semantics."
          }
        }
      }
    },
    "/v1/tariffs/cap": {
      "get": {
        "operationId": "getOfgemReference",
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fuel",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Required for trial calls; paid calls use the original signed payment credential for idempotency."
          },
          {
            "name": "payment-signature",
            "in": "header",
            "required": false,
            "description": "Original x402 signed credential. With a customer token, omission requests the 402 challenge.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "trial": []
          },
          {
            "customer": []
          }
        ],
        "responses": {
          "200": {
            "description": "JSON response; see docs for schema and recovery semantics."
          },
          "402": {
            "description": "JSON response; see docs for schema and recovery semantics."
          },
          "422": {
            "description": "JSON response; see docs for schema and recovery semantics."
          },
          "503": {
            "description": "JSON response; see docs for schema and recovery semantics."
          }
        }
      }
    },
    "/v1/meta/coverage": {
      "get": {
        "operationId": "getCoverage",
        "responses": {
          "200": {
            "description": "JSON response; see docs for schema and recovery semantics."
          }
        }
      }
    },
    "/v1/meta/status": {
      "get": {
        "operationId": "getFreshness",
        "responses": {
          "200": {
            "description": "JSON response; see docs for schema and recovery semantics."
          },
          "503": {
            "description": "JSON response; see docs for schema and recovery semantics."
          }
        }
      }
    },
    "/v1/customers/requirements": {
      "get": {
        "operationId": "getCustomerRequirements",
        "responses": {
          "200": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          }
        }
      }
    },
    "/v1/customers/prepare": {
      "post": {
        "operationId": "prepareCustomer",
        "description": "Submit the business profile and wallet as documented by getCustomerRequirements. Registration adds issued_at and the exact-message signature.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "201": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "400": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "403": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "503": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          }
        }
      }
    },
    "/v1/customers": {
      "post": {
        "operationId": "registerCustomer",
        "description": "Submit the business profile and wallet as documented by getCustomerRequirements. Registration adds issued_at and the exact-message signature.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "201": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "400": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "403": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          },
          "503": {
            "description": "See /v1/customers/requirements and /docs/ for the exact signed registration flow."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "trial": {
        "type": "http",
        "scheme": "bearer"
      },
      "customer": {
        "type": "apiKey",
        "in": "header",
        "name": "x-customer-token"
      }
    }
  }
}
