# Saylor Innovations Text Diff

> Saylor Innovations Text Diff is a paid API for AI agents from saylorinnovations.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Returns line-by-line differences between two texts, including added, removed, and unchanged line counts and a similarity score

## Facts

- Endpoint: GET https://saylorinnovations.com/api/tools/diff?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saylor-innovations-text-diff-b712c5d2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1FBqeE9oTOWwwHx6Ttft_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability saylor-innovations-text-diff-b712c5d2
```

Example prompt: Can you diff these two paragraphs for me and tell me how many lines were added, removed, and unchanged, plus a similarity score? Original: 'The quick brown fox jumps over the lazy dog. It was a sunny day.' Changed: 'The quick brown fox leaps over the lazy cat. It was a rainy day.'

## When to prefer this

Use this endpoint when you need a structured, machine-readable line-by-line diff with similarity scoring between two plain text inputs — ideal for agents that need to programmatically detect what changed between document versions, code snippets, or any two strings without spinning up a local diff library. Prefer this over general text comparison when you need explicit counts of added/removed/unchanged lines and a numeric similarity score returned as JSON.

## Known failure modes

- Missing required query parameters 'a' or 'b' returns an error
- Texts exceeding 300 lines each may be truncated (truncated: true in response)
- Empty string inputs may return identical:true with zero changes
- Very long lines may affect processing or response size
- Payment failure or insufficient USDC balance returns 402

## How this service works

Text diff - line-by-line differences between two texts with added, removed and unchanged counts and similarity

## Output

Returns a JSON object with an array of line-level changes (each with line number, type, and line references for both texts), boolean flags for whether the texts are identical and whether the result was truncated, a similarity score (0–1), and counts of lines added, removed, and unchanged. Also includes a checked_at timestamp.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Original text"
      },
      "b": {
       "type": "string",
       "description": "Changed text (each max 300 lines)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "identical",
      "lines_added",
      "lines_removed"
     ],
     "properties": {
      "changes": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "line": {
          "type": "string",
          "description": "Line number or text of the line"
         },
         "type": {
          "type": "string",
          "description": "Type or kind"
         },
         "a_line": {
          "type": "number",
          "description": "A line"
         },
         "b_line": {
          "type": "number",
          "description": "B line"
         }
        }
       }
      },
      "identical": {
       "type": "boolean"
      },
      "truncated": {
       "type": [
        "boolean",
        "null"
       ],
       "description": "True when the list was cut at the limit"
      },
      "checked_at": {
       "type": [
        "string",
        "null"
       ],
       "description": "Time the check was run (UTC)"
      },
      "similarity": {
       "type": "number"
      },
      "lines_added": {
       "type": "number",
       "description": "Lines added"
      },
      "lines_removed": {
       "type": "number",
       "description": "Lines removed"
      },
      "lines_unchanged": {
       "type": "number",
       "description": "Lines unchanged"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saylor-innovations-text-diff-b712c5d2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from saylorinnovations.com](https://www.zero.xyz/host/saylorinnovations.com/llms.txt)
