{
  "openapi": "3.1.1",
  "info": {
    "title": "AI Answer Verifier API",
    "version": "1.0.0",
    "summary": "Split an AI answer into claims and see which ones your sources actually support.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://aianswerverifier.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Split an AI answer into claims and see which ones your sources actually support.",
        "description": "Paste an AI-generated answer and the sources it should be based on (text or public URLs). Each sentence becomes a claim; check-worthy claims (numbers, dates, names, superlatives, causes) are flagged, and every claim is matched to the best-supporting source sentence with BM25 scoring and number checks.\n\nMethodology:\n- Claims = sentences of the answer with at least 15 characters.\n- Check-worthy if the claim contains numbers, years, multi-word proper names, superlatives/absolutes or causal wording.\n- Each source is split into sentences; the best match for a claim is the source sentence with the highest BM25 score (k1 = 1.2, b = 0.75) over content words.\n- Coverage = share of the claim's distinct content words found in that sentence. supported: coverage ≥ 0.7 and every number in the claim appears in it; partially-supported: coverage ≥ 0.4; contradicted-number: coverage ≥ 0.5, a number from the claim is missing from the evidence and the evidence contains a different number; otherwise not-found.\n\nThis is lexical evidence matching, not truth verification: \"supported\" means similar wording exists in your sources, not that the sources are right. Paraphrases can be missed.",
        "tags": [
          "internet"
        ],
        "x-mcp-tool": "ai_answer_verifier",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAnswerVerifierInput"
              },
              "examples": {
                "example1": {
                  "summary": "Eiffel Tower facts",
                  "value": {
                    "answer": "The Eiffel Tower was completed in 1889 for the World's Fair in Paris. It is 330 metres tall. It was designed by Gustave Eiffel alone. It is the most visited paid monument in the world.",
                    "sources": "The Eiffel Tower was built for the 1889 World's Fair in Paris and completed in March 1889.\nIt is 330 metres (1,083 ft) tall, including antennas.\n---\nThe tower was designed by the engineers Maurice Koechlin and Émile Nouguier of Gustave Eiffel's company."
                  }
                },
                "example2": {
                  "summary": "Wrong number",
                  "value": {
                    "answer": "The company reported revenue of 12 billion euros in 2025.",
                    "sources": "In 2025 the company reported revenue of 9.4 billion euros, up 3% from the previous year."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiAnswerVerifierResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AiAnswerVerifierInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "answer": {
            "title": "AI answer",
            "type": "string",
            "maxLength": 50000
          },
          "sources": {
            "title": "Source texts",
            "description": "Paste one or more sources. Separate sources with a line containing only ---",
            "type": "string",
            "maxLength": 400000
          },
          "sourceUrls": {
            "title": "Source URLs (one per line)",
            "description": "Public pages fetched once (max 5).",
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 5
          }
        },
        "required": [
          "answer"
        ]
      },
      "AiAnswerVerifierResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "counts",
              "claims",
              "sources"
            ],
            "properties": {
              "counts": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "claims",
                  "supported",
                  "partiallySupported",
                  "contradictedNumber",
                  "notFound",
                  "checkWorthy"
                ],
                "properties": {
                  "claims": {
                    "type": "integer"
                  },
                  "supported": {
                    "type": "integer"
                  },
                  "partiallySupported": {
                    "type": "integer"
                  },
                  "contradictedNumber": {
                    "type": "integer"
                  },
                  "notFound": {
                    "type": "integer"
                  },
                  "checkWorthy": {
                    "type": "integer"
                  }
                }
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "label",
                    "characters"
                  ],
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "characters": {
                      "type": "integer"
                    }
                  }
                }
              },
              "claims": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "index",
                    "claim",
                    "checkWorthy",
                    "verdict",
                    "coverage",
                    "score",
                    "evidence",
                    "numbersNotInEvidence"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer"
                    },
                    "claim": {
                      "type": "string"
                    },
                    "checkWorthy": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "supported",
                        "partially-supported",
                        "contradicted-number",
                        "not-found"
                      ]
                    },
                    "coverage": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "score": {
                      "type": "number"
                    },
                    "evidence": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": false,
                      "required": [
                        "source",
                        "sentence"
                      ],
                      "properties": {
                        "source": {
                          "type": "string"
                        },
                        "sentence": {
                          "type": "string"
                        }
                      }
                    },
                    "numbersNotInEvidence": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}