{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint Citation Verify JSON",
    "version": "0.1.0",
    "description": "Check that a citation is real and correct before an agent uses it. Crossref + arXiv metadata. Pay per call with USDC on Base via x402. Not endorsed by Crossref or arXiv.",
    "x-guidance": "GET /verify with doi=, arxiv=, title= (+authors= ';'-separated, year=, venue=) or ref= (whole reference string). verdict: verified | mismatch (major field differences, listed in mismatches[]) | not_found (billed). Check retracted/updates[] before citing. POST /verify/batch {items:[...]} for up to 10. Unpaid calls receive HTTP 402 with x402 payment requirements (USDC on Base). 4xx/5xx are not charged.",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/verify": {
      "get": {
        "operationId": "citation_verify",
        "summary": "Verify one citation",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "5000"
        },
        "parameters": [
          {
            "name": "doi",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "DOI (10.xxxx/..., doi.org URL ok)"
            }
          },
          {
            "name": "arxiv",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "arXiv id, e.g. 1706.03762"
            }
          },
          {
            "name": "title",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Title as the agent cited it (max 500)"
            }
          },
          {
            "name": "authors",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Authors, ';'-separated (or a JSON array in batch)"
            }
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "venue",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Journal / conference as cited"
            }
          },
          {
            "name": "ref",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Whole free-text reference string (max 1500); DOIs/arXiv ids inside are used"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verdict (verified | mismatch | not_found), canonical record, mismatches, retraction flags, sources"
          },
          "400": {
            "description": "Bad input (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "422": {
            "description": "DOI registered outside Crossref (e.g. DataCite) \u2014 not verified, not charged"
          },
          "502": {
            "description": "Upstream error (not charged)"
          },
          "503": {
            "description": "Source busy / rate limited (not charged)"
          }
        }
      }
    },
    "/verify/batch": {
      "post": {
        "operationId": "citation_verify_batch",
        "summary": "Verify up to 10 citations",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.030000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "30000"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "items": {
                      "type": "object",
                      "properties": {
                        "doi": {
                          "type": "string",
                          "description": "DOI (10.xxxx/..., doi.org URL ok)"
                        },
                        "arxiv": {
                          "type": "string",
                          "description": "arXiv id, e.g. 1706.03762"
                        },
                        "title": {
                          "type": "string",
                          "description": "Title as the agent cited it (max 500)"
                        },
                        "authors": {
                          "type": "string",
                          "description": "Authors, ';'-separated (or a JSON array in batch)"
                        },
                        "year": {
                          "type": "integer"
                        },
                        "venue": {
                          "type": "string",
                          "description": "Journal / conference as cited"
                        },
                        "ref": {
                          "type": "string",
                          "description": "Whole free-text reference string (max 1500); DOIs/arXiv ids inside are used"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict (verified | mismatch | not_found), canonical record, mismatches, retraction flags, sources"
          },
          "400": {
            "description": "Bad input (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "422": {
            "description": "DOI registered outside Crossref (e.g. DataCite) \u2014 not verified, not charged"
          },
          "502": {
            "description": "Upstream error (not charged)"
          },
          "503": {
            "description": "Source busy / rate limited (not charged)"
          }
        }
      }
    }
  }
}