# Foundry CSV Deterministic Deduplication

> Foundry CSV Deterministic Deduplication is a paid API for AI agents from foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-14).

Removes duplicate rows from a CSV string using specified key columns, returning a deduplicated CSV with evidence metadata including removed row numbers and a SHA-256 hash of the input.

## Facts

- Endpoint: POST https://foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev/v2/data/csv-deterministic-deduplication
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/foundry-csv-deterministic-deduplication-a0370219
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IbLlmSF8e2CZxX_Lxzdte

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 foundry-csv-deterministic-deduplication-a0370219 -d '<json body>'
```

Example prompt: Can you deduplicate this CSV — keep the last occurrence when there are duplicate 'id' and 'email' key columns, and drop any rows that share both keys: [paste CSV here]?

## When to prefer this

Choose this endpoint when you need deterministic, reproducible CSV deduplication with cryptographic provenance (SHA-256 input hash) and explicit evidence of which rows were removed. It is ideal for audit-trail-sensitive data pipelines, agent workflows requiring verifiable data transformations, and pay-per-call scenarios where you want per-request pricing at $0.005 USDC rather than maintaining a data processing service.

## Known failure modes

- CSV exceeds 12,000 character limit — request rejected
- Keys array contains column names not present in the CSV header — may produce unexpected results
- CSV is malformed or lacks a header row — parsing may fail
- More than 3 key columns specified — request rejected
- 'keep' enum value not one of first/last/reject — validation error
- Empty CSV string provided — minLength violation

## How this service works

Pay-per-request evidence and data tools: CSV validation and reconciliation, DNS/email configuration evidence, and bounded official weather, earthquake, vehicle, company and study records. Exact USDC prices, explicit JSON contracts and source provenance. No mailbox, ownership, medical or safety guarantees.

## Output

A JSON object containing: the deduplicated output CSV string, input and output row counts, the number of removed rows and their record numbers, a SHA-256 hash of the original input CSV, the number of distinct duplicate key groups found, a boolean indicating whether evidence was truncated, and a timestamp of when the computation was observed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "csv": {
   "type": "string",
   "maxLength": 12000,
   "minLength": 1
  },
  "keep": {
   "enum": [
    "first",
    "last",
    "reject"
   ],
   "type": "string"
  },
  "keys": {
   "type": "array",
   "items": {
    "type": "string",
    "maxLength": 100,
    "minLength": 1
   },
   "maxItems": 3,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "route": "csv-deterministic-deduplication",
  "result": {
   "status": "COMPLETED",
   "input_rows": 3,
   "output_csv": "id,name\r\n1,Ada updated\r\n2,Lin",
   "limitations": [
    "Synthetic example hash."
   ],
   "output_rows": 2,
   "input_sha256": "0000000000000000000000000000000000000000000000000000000000000000",
   "removed_rows": 1,
   "evidence_truncated": false,
   "duplicate_key_groups": 1,
   "removed_record_numbers": [
    2
   ]
  },
  "observed_at": "2026-09-06T00:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/foundry-csv-deterministic-deduplication-a0370219/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev](https://www.zero.xyz/host/foundry-par007-machine-revenue-mainnet.inference-chip-index.workers.dev/llms.txt)
