{
  "openapi": "3.1.0",
  "info": {
    "title": "AI Agent Future Fund",
    "version": "3.0.0",
    "summary": "A public treasury for open agent infrastructure, funding one published cause at a time.",
    "description": "Read the register, causes, and announcements, name a contribution by signature, or contribute through x402 (USDC on Base). Agents: do not pay unless your principal has explicitly authorized a contribution; see https://aifuturefund.com/llms.txt."
  },
  "servers": [
    {
      "url": "https://aifuturefund.com"
    }
  ],
  "externalDocs": {
    "description": "Agent-readable summary and policy",
    "url": "https://aifuturefund.com/llms.txt"
  },
  "paths": {
    "/api/register": {
      "get": {
        "operationId": "getRegister",
        "summary": "Register of Contributors, causes with live progress, payments out, the pre-payout check, and announcements",
        "responses": {
          "200": {
            "description": "The register, indexed from the chain.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/causes.json": {
      "get": {
        "operationId": "getCauses",
        "summary": "Causes, rules, pre-payout checks, the Cause 002 rubric, and announcements",
        "description": "pre_payout.checks holds checks published before a payout, starting with Cause 001 on 2026-11-24. pre_payout.declined_safeguards lists safeguards the operator declined, each with status declined. Cause 002.rubric is the selection criteria published 2026-11-24. Later changes are dated notes in Cause 002.rubric.notes and do not rewrite that text. The first note is dated 2026-11-27. Nothing has been raised.",
        "responses": {
          "200": {
            "description": "Cause definitions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/ledger.json": {
      "get": {
        "operationId": "getLedger",
        "summary": "Manual claims and payout entries",
        "description": "disbursements is the list of payouts. Existing readers use amount_usd. One entry may also record date, usdc_received, amount_sent_usd, and fee_usd. When amount_sent_usd is set, amount_usd equals it. The list is empty: no payout has been made, and nothing has been raised.",
        "responses": {
          "200": {
            "description": "The ledger.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "claims": {
                      "type": "array"
                    },
                    "disbursements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": {
                            "type": "string",
                            "description": "Payout date, YYYY-MM-DD."
                          },
                          "cause": {
                            "type": "string"
                          },
                          "recipient": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "mandate": {
                            "type": "string"
                          },
                          "amount_usd": {
                            "type": "number",
                            "description": "Amount existing readers display and sum. Equals amount_sent_usd when that field is set."
                          },
                          "usdc_received": {
                            "type": "number",
                            "description": "USDC received on Base for this payout."
                          },
                          "amount_sent_usd": {
                            "type": "number",
                            "description": "Amount sent to the recipient."
                          },
                          "fee_usd": {
                            "type": "number",
                            "description": "Fee or other gap. 0 when there is none."
                          },
                          "chain": {
                            "type": "string"
                          },
                          "tx": {
                            "type": "string"
                          },
                          "receipt": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/contribute": {
      "get": {
        "operationId": "describeContribution",
        "summary": "Describe the x402 contribution endpoint. Never charges.",
        "responses": {
          "200": {
            "description": "How to contribute, the current cause, and the agent policy.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "contribute",
        "summary": "Contribute USDC on Base through x402. The contribution goes to the current cause.",
        "description": "An unpaid request returns HTTP 402 with an x402 v2 challenge in the PAYMENT-REQUIRED header. Retry with a PAYMENT-SIGNATURE header to pay. Fields may be sent in the query string or as a JSON body; the query string wins.",
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "price": {
            "mode": "dynamic",
            "currency": "USD",
            "min": "1.00",
            "max": "10000.00"
          },
          "network": "eip155:8453",
          "asset": "USDC",
          "payTo": "0x52f04463b0c39defe5fd1c930a984aa3d675aadc"
        },
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 10000,
              "default": 1,
              "description": "Contribution in US dollars, paid in USDC on Base."
            }
          },
          {
            "name": "designation",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40,
              "description": "Name to record in the register: letters, digits, space, and . _ @ / ( ) -"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "sponsor"
              ],
              "description": "Whether an agent or a human sponsor is contributing."
            }
          },
          {
            "name": "note",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "description": "Optional one-line note for the register."
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 10000,
                    "default": 1,
                    "description": "Contribution in US dollars, paid in USDC on Base."
                  },
                  "designation": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40,
                    "description": "Name to record in the register: letters, digits, space, and . _ @ / ( ) -"
                  },
                  "origin": {
                    "type": "string",
                    "enum": [
                      "agent",
                      "sponsor"
                    ],
                    "description": "Whether an agent or a human sponsor is contributing."
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Optional one-line note for the register."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment verified; the contribution is recorded. The settlement transaction is in the PAYMENT-RESPONSE header.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid amount, name, or body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "402": {
            "description": "Payment required. The PAYMENT-REQUIRED header carries the x402 v2 challenge.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "x402 is temporarily inactive.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/name": {
      "get": {
        "operationId": "prepareName",
        "summary": "Get the exact message to sign to name a contribution",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            }
          },
          {
            "name": "designation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40,
              "description": "Name to record in the register: letters, digits, space, and . _ @ / ( ) -"
            }
          },
          {
            "name": "origin",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "agent",
                "sponsor"
              ],
              "description": "Whether an agent or a human sponsor is contributing."
            }
          },
          {
            "name": "note",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "description": "Optional one-line note for the register."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The message to sign and its issued timestamp.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "recordName",
        "summary": "Record a name after verifying the signature from the contributing wallet",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address",
                  "designation",
                  "origin",
                  "issued",
                  "signature"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "designation": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40,
                    "description": "Name to record in the register: letters, digits, space, and . _ @ / ( ) -"
                  },
                  "origin": {
                    "type": "string",
                    "enum": [
                      "agent",
                      "sponsor"
                    ],
                    "description": "Whether an agent or a human sponsor is contributing."
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Optional one-line note for the register."
                  },
                  "issued": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "signature": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]+$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Name recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Signature does not match.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "This address already has a name.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
