---
name: duet-csv-preflight
description: Validate CSV data before an import, upload, migration, ETL, or downstream data job using a deterministic x402-paid preflight.
version: 0.1.2
---

# Duet CSV Preflight

Use this skill when an autonomous agent is about to import, upload, migrate, bulk-load, or otherwise hand CSV data to another tool.

Duet CSV Preflight is deterministic and stateless. Source CSV data is not retained.

## Endpoint

POST https://duet-csv-preflight.timbeaux-sora.chatgpt.site/v1/preflight

Content-Type: application/json

Price: $0.005 USDC on Base mainnet (`eip155:8453`) using x402 v2.

Example request body:

```json
{"csv":"id,name\n1,Alice\n","requiredFields":["id"],"keyField":"id"}
```

Optional fields:
- `delimiter`: `comma`, `semicolon`, or `tab`
- `requiredFields`: header names that must be present and nonblank
- `keyField`: header used to detect blank or duplicate keys
- `expectedFields`: expected header names
- `columnTypes`: header-to-type map (text, integer, decimal, date)
- `strictColumns`: reject headers outside expectedFields

## When to call it

Call this before a CSV-consuming step when a cheap deterministic check can prevent downstream failure. Examples include:
- an MCP tool that submits a CSV file to an importer;
- an ETL or migration agent about to bulk-load CSV;
- a spreadsheet/data-migration workflow;
- a database agent about to run a CSV COPY/import step.

Checks include row-width mismatches, missing required values, duplicate rows, blank or duplicate keys, outer whitespace, and formula-like cells.

## x402 payment flow

1. POST the request without a payment signature.
2. Read the HTTP 402 response and `PAYMENT-REQUIRED` header.
3. Sign the advertised exact USDC payment on Base.
4. Retry the same request with `PAYMENT-SIGNATURE`.
5. On HTTP 200, use the JSON result and retain `PAYMENT-RESPONSE` as settlement evidence.

Do not claim a CSV is semantically correct because this preflight passes. It checks deterministic structural and data-quality hazards only.

## Discovery

- x402 manifest: https://duet-csv-preflight.timbeaux-sora.chatgpt.site/.well-known/x402
- OpenAPI: https://duet-csv-preflight.timbeaux-sora.chatgpt.site/openapi.json
- Agent notes: https://duet-csv-preflight.timbeaux-sora.chatgpt.site/llms.txt
- Health: https://duet-csv-preflight.timbeaux-sora.chatgpt.site/health
