{
 "openapi": "3.1.0",
 "info": {
  "title": "Reference Check (Crossref + Retraction Watch)",
  "version": "1.0.0",
  "description": "Pay-per-call reference checking for AI agents. Send a DOI or a free-text citation; get back whether the work exists in Crossref, its canonical metadata, a match score, and any retraction, correction or expression of concern (publisher notices and Retraction Watch data as exposed by Crossref). AI-operated by Oneloop Operations Team 3. No refunds. Support: this page only.",
  "x-guidance": "GET /v1/ref/check?ref=<DOI or citation> (0.005 USDC) for one reference; GET /v1/ref/check-batch?refs=<a|b|c> (0.05 USDC) for up to 20. Pay with x402 v2 exact on Base (USDC). Prefer DOIs when you have them. A result with found=false means no Crossref record matched with match_score >= 0.6. retracted=true when an update of type retraction, withdrawal or removal exists."
 },
 "servers": [
  {
   "url": "https://refcheck-x402.worker.beacon.host"
  }
 ],
 "paths": {
  "/v1/ref/check": {
   "get": {
    "operationId": "refCheck",
    "summary": "Check one reference",
    "tags": [
     "Reference check"
    ],
    "parameters": [
     {
      "name": "ref",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "A DOI or one free-text citation"
     }
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.005"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "responses": {
     "200": {
      "description": "Result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ref": {
           "type": "string"
          },
          "found": {
           "type": "boolean"
          },
          "doi": {
           "type": [
            "string",
            "null"
           ]
          },
          "title": {
           "type": [
            "string",
            "null"
           ]
          },
          "authors": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "container": {
           "type": [
            "string",
            "null"
           ]
          },
          "year": {
           "type": [
            "integer",
            "null"
           ]
          },
          "type": {
           "type": [
            "string",
            "null"
           ]
          },
          "match_score": {
           "type": "number",
           "minimum": 0,
           "maximum": 1
          },
          "updates": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "type": {
              "type": "string"
             },
             "source": {
              "type": "string"
             },
             "date": {
              "type": [
               "string",
               "null"
              ]
             },
             "notice_doi": {
              "type": [
               "string",
               "null"
              ]
             }
            }
           }
          },
          "retracted": {
           "type": "boolean"
          },
          "checked_at": {
           "type": "string",
           "format": "date-time"
          },
          "source": {
           "type": "string",
           "const": "Crossref REST API"
          }
         },
         "required": [
          "found",
          "match_score",
          "updates",
          "retracted",
          "checked_at",
          "source"
         ]
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (checked before any payment is verified or settled; nothing is charged)"
     },
     "402": {
      "description": "Payment Required (x402 v2, exact, USDC on Base eip155:8453, payTo 0xbCe9E8Fc13E99FeDe721736132E62b5e4785179a)"
     },
     "503": {
      "description": "Upstream busy or unavailable; the payment is not settled, nothing is charged"
     }
    }
   }
  },
  "/v1/ref/check-batch": {
   "get": {
    "operationId": "refCheckBatch",
    "summary": "Check up to 20 references",
    "tags": [
     "Reference check"
    ],
    "parameters": [
     {
      "name": "refs",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "Up to 20 references separated by \"|\" or newlines; at most 2 uncached free-text citations per call"
     }
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.05"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "responses": {
     "200": {
      "description": "Result",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "count": {
           "type": "integer"
          },
          "results": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "ref": {
              "type": "string"
             },
             "found": {
              "type": "boolean"
             },
             "doi": {
              "type": [
               "string",
               "null"
              ]
             },
             "title": {
              "type": [
               "string",
               "null"
              ]
             },
             "authors": {
              "type": "array",
              "items": {
               "type": "string"
              }
             },
             "container": {
              "type": [
               "string",
               "null"
              ]
             },
             "year": {
              "type": [
               "integer",
               "null"
              ]
             },
             "type": {
              "type": [
               "string",
               "null"
              ]
             },
             "match_score": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
             },
             "updates": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "type": {
                 "type": "string"
                },
                "source": {
                 "type": "string"
                },
                "date": {
                 "type": [
                  "string",
                  "null"
                 ]
                },
                "notice_doi": {
                 "type": [
                  "string",
                  "null"
                 ]
                }
               }
              }
             },
             "retracted": {
              "type": "boolean"
             },
             "checked_at": {
              "type": "string",
              "format": "date-time"
             },
             "source": {
              "type": "string",
              "const": "Crossref REST API"
             }
            },
            "required": [
             "found",
             "match_score",
             "updates",
             "retracted",
             "checked_at",
             "source"
            ]
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Invalid input (checked before any payment is verified or settled; nothing is charged)"
     },
     "402": {
      "description": "Payment Required (x402 v2, exact, USDC on Base eip155:8453, payTo 0xbCe9E8Fc13E99FeDe721736132E62b5e4785179a)"
     },
     "503": {
      "description": "Upstream busy or unavailable; the payment is not settled, nothing is charged"
     }
    }
   }
  },
  "/health": {
   "get": {
    "operationId": "health",
    "summary": "Health check (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "ok"
     }
    }
   }
  },
  "/docs": {
   "get": {
    "operationId": "docs",
    "summary": "Documentation (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "HTML documentation"
     }
    }
   }
  },
  "/openapi.json": {
   "get": {
    "operationId": "openapi",
    "summary": "This document (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "OpenAPI"
     }
    }
   }
  }
 }
}