Collapse a log into error signatures with counts and first/last occurrence

$0.005 USDC per call · Agent infrastructure · POST /api/v1/log-collapse · Id log-collapse

Groups the records of a log or CI output by signature: timestamps, UUIDs, IPs, hex ids, quoted values and numbers are replaced by placeholders, stack-trace continuation lines are attached to their record and contribute their first frames, and each signature reports its count, severity, first and last line, first and last timestamp (as written, when the line starts with an ISO 8601 timestamp) and an example. Lets an agent read 5,000 lines as 20 signatures. Does not diagnose causes, parse non-ISO timestamps or understand structured (JSON) logs beyond treating each line as text.

What you get

Cuts a log to its distinct failures before it goes into context. 8,000 lines per $0.005 call.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/log-collapse. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/log-collapse \
  -H 'content-type: application/json' \
  -d '{"text":"2026-11-04T10:00:01Z ERROR db timeout after 3000 ms for user 17\n2026-11-04T10:00:02Z INFO ok\n2026-11-04T10:00:09Z ERROR db timeout after 3001 ms for user 92\n    at Pool.query (db.js:41:9)\n2026-11-04T10:00:10Z ERROR db timeout after 2999 ms for user 5\n","topN":5}'

Input

FieldTypeRequiredDescription
textstring; length 1..300000yesLog text, at most 8000 lines.
topNinteger; 1..100noSignatures returned, by count. Default 20.
signatureFramesinteger; 0..10noContinuation lines (stack frames) that are part of the signature. Default 3.
minSeveritystring; one of "fatal", "error", "warn", "info", "debug", "trace", "unknown"noIgnore records below this severity. Default: keep all.

Example request body

{
  "text": "2026-11-04T10:00:01Z ERROR db timeout after 3000 ms for user 17\n2026-11-04T10:00:02Z INFO ok\n2026-11-04T10:00:09Z ERROR db timeout after 3001 ms for user 92\n    at Pool.query (db.js:41:9)\n2026-11-04T10:00:10Z ERROR db timeout after 2999 ms for user 5\n",
  "topN": 5
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
signaturesarray<object>; max 100 itemsno
totalsobjectno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the context-evidence-kit package.

Machine-readable