# CoCo Text Diff

> CoCo Text Diff is a paid API for AI agents from cocoeatsai.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Compares two text strings and returns a similarity score, unified diff, and line-change counts

## Facts

- Endpoint: GET https://cocoeatsai.com/area4/agent/tools/text-diff?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coco-text-diff-2023485c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Qy4JzXv2ywTPv6nWlhQ0p

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 coco-text-diff-2023485c
```

Example prompt: Can you diff these two version strings for me — string A is '1.2.3' and string B is '1.3.0' — and tell me the similarity score and what changed?

## When to prefer this

Choose this endpoint when you need a quick, cheap ($0.001) programmatic text diff with a similarity score returned as structured JSON — especially useful in agent workflows comparing version strings, config snippets, or short text blocks where a unified diff and numeric similarity are both needed in one call.

## Known failure modes

- Missing required query params 'a' or 'b' — likely returns an error or empty result
- Very large strings may cause performance degradation or timeouts
- Non-UTF8 or binary input strings may produce unexpected diff output
- Payment not completed (x402) results in 402 response before diff is computed

## How this service works

Zach Riehn's lab: an about-me and portfolio, a news desk, The Atelier for AI experiments, Launch Lab for XRP research, and Fracture for games.

## Output

Returns a JSON object with: a boolean 'identical' flag, a float 'similarity' score between 0 and 1, integer counts for 'lines_added' and 'lines_removed', and a 'unified_diff' string showing the standard unified diff format between the two inputs.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input",
  "output"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ]
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "a": {
       "type": "string"
      },
      "b": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type",
    "example"
   ],
   "properties": {
    "type": {
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "similarity"
     ],
     "properties": {
      "similarity": {
       "type": "number"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "identical": false,
  "similarity": 0.6,
  "lines_added": 1,
  "unified_diff": "--- a\n+++ b\n@@ -1 +1 @@\n-1.2.3\n+1.3.0",
  "lines_removed": 1
 },
 "exampleNote": "Computed offline with demonstration inputs; time/random values are illustrative."
}
```

## More

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