{
  "openapi": "3.1.0",
  "info": {
    "title": "UK Electricity Price Slots MCP",
    "description": "Cheapest half-hour Agile electricity prices by UK postcode.\n\nThis specification documents the HTTP x402 pay-per-call routes only (not the MCP /mcp transport). Unpaid calls return HTTP 402. Retry with a PAYMENT-SIGNATURE header (x402 v2, scheme exact, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). A payout address is included only in the live 402 challenge served by the Worker, not in this file. MCP endpoint: https://uk-energy-prices-mcp.donniertf.workers.dev/mcp. Manifest: https://uk-energy-prices-mcp.donniertf.workers.dev/.well-known/x402. Paper/free discovery routes are not billed.",
    "version": "1.0.0",
    "contact": {
      "name": "Donnie Morrison",
      "email": "dmorrisonwebdesign@gmail.com",
      "url": "https://uk-energy-prices-mcp.donniertf.workers.dev/"
    },
    "license": {
      "name": "See product landing page and source licences"
    },
    "x-guidance": "Use the paid HTTP routes documented in paths (POST JSON, or GET with query args). Unpaid calls return HTTP 402; retry with a PAYMENT-SIGNATURE header (x402 v2, USDC on Base; legacy X-PAYMENT v1 also accepted). The MCP transport is at /mcp. Cheapest half-hour Agile electricity prices by UK postcode."
  },
  "servers": [
    {
      "url": "https://uk-energy-prices-mcp.donniertf.workers.dev",
      "description": "UK Electricity Price Slots MCP origin"
    }
  ],
  "tags": [
    {
      "name": "x402",
      "description": "USDC on Base pay-per-call routes"
    }
  ],
  "paths": {
    "/x402/cheapest_slots": {
      "post": {
        "summary": "PAID (x402). $0.02 USDC per call. Also free via /mcp (5 free calls/day per IP). Cheapest 3 upcoming half-hour electricity slots (Agile Octopus, p/kWh inc VAT) for a UK postcode's region.",
        "description": "PAID (x402). $0.02 USDC per call. Also free via /mcp (5 free calls/day per IP). Cheapest 3 upcoming half-hour electricity slots (Agile Octopus, p/kWh inc VAT) for a UK postcode's region.",
        "operationId": "post_x402_cheapest_slots",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "description": "UK postcode (sets the electricity region)"
                  }
                },
                "required": [
                  "postcode"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "PAID (x402). $0.02 USDC per call. Also free via /mcp (5 free calls/day per IP). Cheapest 3 upcoming half-hour electricity slots (Agile Octopus, p/kWh inc VAT) for a UK postcode's region. (query or 402 probe)",
        "description": "PAID (x402). $0.02 USDC per call. Also free via /mcp (5 free calls/day per IP). Cheapest 3 upcoming half-hour electricity slots (Agile Octopus, p/kWh inc VAT) for a UK postcode's region. Accepts query args; unpaid calls return 402.",
        "operationId": "get_x402_cheapest_slots",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UK postcode (sets the electricity region)"
            }
          }
        ]
      }
    },
    "/x402/best_window": {
      "post": {
        "summary": "PRO. Cheapest continuous window of N hours in the upcoming prices (EV charging, heat pumps, batteries, industrial jobs) with average price and cost for a kWh amount.",
        "description": "PRO. Cheapest continuous window of N hours in the upcoming prices (EV charging, heat pumps, batteries, industrial jobs) with average price and cost for a kWh amount.",
        "operationId": "post_x402_best_window",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "description": "UK postcode (sets the electricity region)"
                  },
                  "hours": {
                    "type": "number"
                  },
                  "kwh": {
                    "type": "number"
                  },
                  "access_token": {
                    "type": "string",
                    "description": "Subscriber token from /success (or Authorization: Bearer)"
                  }
                },
                "required": [
                  "postcode",
                  "hours"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "PRO. Cheapest continuous window of N hours in the upcoming prices (EV charging, heat pumps, batteries, industrial jobs) with average price and cost for a kWh amount. (query or 402 probe)",
        "description": "PRO. Cheapest continuous window of N hours in the upcoming prices (EV charging, heat pumps, batteries, industrial jobs) with average price and cost for a kWh amount. Accepts query args; unpaid calls return 402.",
        "operationId": "get_x402_best_window",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UK postcode (sets the electricity region)"
            }
          },
          {
            "name": "hours",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "kwh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Subscriber token from /success (or Authorization: Bearer)"
            }
          }
        ]
      }
    },
    "/x402/all_slots": {
      "post": {
        "summary": "PRO. All published half-hourly import prices for today/tomorrow for a postcode region.",
        "description": "PRO. All published half-hourly import prices for today/tomorrow for a postcode region.",
        "operationId": "post_x402_all_slots",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "description": "UK postcode (sets the electricity region)"
                  },
                  "access_token": {
                    "type": "string",
                    "description": "Subscriber token from /success (or Authorization: Bearer)"
                  }
                },
                "required": [
                  "postcode"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "PRO. All published half-hourly import prices for today/tomorrow for a postcode region. (query or 402 probe)",
        "description": "PRO. All published half-hourly import prices for today/tomorrow for a postcode region. Accepts query args; unpaid calls return 402.",
        "operationId": "get_x402_all_slots",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UK postcode (sets the electricity region)"
            }
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Subscriber token from /success (or Authorization: Bearer)"
            }
          }
        ]
      }
    },
    "/x402/export_rates": {
      "post": {
        "summary": "PRO. Agile Outgoing export prices — best upcoming slots to sell solar/battery power.",
        "description": "PRO. Agile Outgoing export prices — best upcoming slots to sell solar/battery power.",
        "operationId": "post_x402_export_rates",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "description": "UK postcode (sets the electricity region)"
                  },
                  "access_token": {
                    "type": "string",
                    "description": "Subscriber token from /success (or Authorization: Bearer)"
                  }
                },
                "required": [
                  "postcode"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "PRO. Agile Outgoing export prices — best upcoming slots to sell solar/battery power. (query or 402 probe)",
        "description": "PRO. Agile Outgoing export prices — best upcoming slots to sell solar/battery power. Accepts query args; unpaid calls return 402.",
        "operationId": "get_x402_export_rates",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UK postcode (sets the electricity region)"
            }
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Subscriber token from /success (or Authorization: Bearer)"
            }
          }
        ]
      }
    },
    "/x402/daily_average": {
      "post": {
        "summary": "PRO. Daily average/min/max Agile import price for the last N days (max 30) — for budgeting and tariff comparison.",
        "description": "PRO. Daily average/min/max Agile import price for the last N days (max 30) — for budgeting and tariff comparison.",
        "operationId": "post_x402_daily_average",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postcode": {
                    "type": "string",
                    "description": "UK postcode (sets the electricity region)"
                  },
                  "days": {
                    "type": "number"
                  },
                  "access_token": {
                    "type": "string",
                    "description": "Subscriber token from /success (or Authorization: Bearer)"
                  }
                },
                "required": [
                  "postcode"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "PRO. Daily average/min/max Agile import price for the last N days (max 30) — for budgeting and tariff comparison. (query or 402 probe)",
        "description": "PRO. Daily average/min/max Agile import price for the last N days (max 30) — for budgeting and tariff comparison. Accepts query args; unpaid calls return 402.",
        "operationId": "get_x402_daily_average",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.020000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Paid request succeeded; JSON result of the tool or pack.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required. Retry with a PAYMENT-SIGNATURE header (x402 v2, exact scheme, USDC on Base eip155:8453; legacy X-PAYMENT v1 also accepted). The 402 body/header lists price and terms; payout address is only in the live 402 challenge, not in this spec."
          }
        },
        "parameters": [
          {
            "name": "postcode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UK postcode (sets the electricity region)"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "access_token",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Subscriber token from /success (or Authorization: Bearer)"
            }
          }
        ]
      }
    }
  }
}