Manufacturing Quality API Documentation

Read supplied inspection records, measurements, and quality standards to calculate defect rates and assemble nonconformance evidence without inventing tolerances. Payment is the exact USDC price on Base with x402.

POSThttps://brainiac.software/api/v1/manufacturing-quality/production-inspection-parse$0.04 USDC

Parse production inspections

Copy supplied inspections, measurements, batches, and standards into a consistent packet with pass/fail outcomes. Tolerances are not invented.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "text": "Inspection: I-1 | B-1 | P-1 | fail | DIM-01 | diameter out of spec | 2026-11-04T10:00:00.000Z | qa1\nMeasurement: M-1 | I-1 | B-1 | diameter | 12.4 | mm | 2026-11-04T10:01:00.000Z\nStandard: diameter | 12 | 11.8 | 12.2 | mm\nThis product is certified.\n"
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "parsed",
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "partId": "P-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "inspectedAt": "2026-11-04T10:00:00.000Z",
      "inspector": "qa1",
      "outcome": "fail",
      "measurementCount": 1
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "characteristic": "diameter",
      "value": 12.4,
      "valueSupplied": true,
      "unit": "mm",
      "measuredAt": "2026-11-04T10:01:00.000Z"
    }
  ],
  "batches": [],
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "targetSupplied": true,
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "unit": "mm"
    }
  ],
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [
    {
      "kind": "ignored",
      "code": "unlabeled_line",
      "subject": "",
      "detail": "Lines without a recognized label were not read and their text was not copied."
    }
  ],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/production-inspection-parse" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "text": "Inspection: I-1 | B-1 | P-1 | fail | DIM-01 | diameter out of spec | 2026-11-04T10:00:00.000Z | qa1\nMeasurement: M-1 | I-1 | B-1 | diameter | 12.4 | mm | 2026-11-04T10:01:00.000Z\nStandard: diameter | 12 | 11.8 | 12.2 | mm\nThis product is certified.\n"
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/defect-classify$0.04 USDC

Classify manufacturing defects

Classify failed inspections with transparent token rules such as dimensional, surface, assembly, material, or functional. Classification is not a certification.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec"
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "surface scratch on housing"
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "missing fastener in assembly"
    },
    {
      "id": "I-4",
      "batchId": "B-1",
      "result": "pass"
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "classified",
  "counts": [
    {
      "kind": "dimensional",
      "count": 1
    },
    {
      "kind": "surface",
      "count": 1
    },
    {
      "kind": "assembly",
      "count": 1
    }
  ],
  "items": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "partId": "",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "kind": "dimensional",
      "matched": "diameter",
      "confidence": "token",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "partId": "",
      "defectCode": "",
      "defectText": "surface scratch on housing",
      "kind": "surface",
      "matched": "scratch",
      "confidence": "token",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "partId": "",
      "defectCode": "",
      "defectText": "missing fastener in assembly",
      "kind": "assembly",
      "matched": "missing",
      "confidence": "token",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    }
  ],
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/defect-classify" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec"
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "surface scratch on housing"
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "missing fastener in assembly"
    },
    {
      "id": "I-4",
      "batchId": "B-1",
      "result": "pass"
    }
  ]
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/defect-rate-calculate$0.04 USDC

Calculate defect rate

Calculate defect rate from decided pass/fail inspections and compare it with an explicitly supplied threshold. Small samples are disclosed.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "minSample": 5,
  "defectRateThreshold": 0.1,
  "inspections": [
    {
      "id": "I-1",
      "result": "pass"
    },
    {
      "id": "I-2",
      "result": "pass"
    },
    {
      "id": "I-3",
      "result": "pass"
    },
    {
      "id": "I-4",
      "result": "fail",
      "defectText": "scratch"
    },
    {
      "id": "I-5",
      "result": "fail",
      "defectText": "dent"
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "calculated",
  "inspectedCount": 5,
  "decidedCount": 5,
  "failCount": 2,
  "defectRate": 0.4,
  "defectRateSupplied": true,
  "threshold": 0.1,
  "thresholdSupplied": true,
  "overThreshold": true,
  "sampleSufficient": true,
  "minSample": 5,
  "uncertainty": "observed",
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/defect-rate-calculate" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "minSample": 5,
  "defectRateThreshold": 0.1,
  "inspections": [
    {
      "id": "I-1",
      "result": "pass"
    },
    {
      "id": "I-2",
      "result": "pass"
    },
    {
      "id": "I-3",
      "result": "pass"
    },
    {
      "id": "I-4",
      "result": "fail",
      "defectText": "scratch"
    },
    {
      "id": "I-5",
      "result": "fail",
      "defectText": "dent"
    }
  ]
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/batch-compare$0.05 USDC

Compare batch quality

Compare batch defect rates only when each batch meets the disclosed sample minimum. Rate differences are not treated as regulatory findings.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "minSample": 3,
  "defectRateThreshold": 0.2,
  "batches": [
    {
      "id": "B-1",
      "product": "Widget",
      "produced": 100
    },
    {
      "id": "B-2",
      "product": "Widget",
      "produced": 100
    }
  ],
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "scratch"
    },
    {
      "id": "I-4",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-5",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-6",
      "batchId": "B-2",
      "result": "pass"
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "compared",
  "minSample": 3,
  "batches": [
    {
      "batchId": "B-1",
      "product": "Widget",
      "produced": 100,
      "producedSupplied": true,
      "inspectedCount": 3,
      "decidedCount": 3,
      "failCount": 1,
      "defectRate": 0.3333,
      "defectRateSupplied": true,
      "threshold": 0.2,
      "thresholdSupplied": true,
      "overThreshold": true,
      "sampleSufficient": true,
      "uncertainty": "observed",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    },
    {
      "batchId": "B-2",
      "product": "Widget",
      "produced": 100,
      "producedSupplied": true,
      "inspectedCount": 3,
      "decidedCount": 3,
      "failCount": 0,
      "defectRate": 0,
      "defectRateSupplied": true,
      "threshold": 0.2,
      "thresholdSupplied": true,
      "overThreshold": false,
      "sampleSufficient": true,
      "uncertainty": "observed",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    }
  ],
  "comparisons": [
    {
      "leftBatchId": "B-1",
      "rightBatchId": "B-2",
      "leftRate": 0.3333,
      "rightRate": 0,
      "rateDifference": 0.3333,
      "minSample": 3,
      "compared": true
    }
  ],
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/batch-compare" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "minSample": 3,
  "defectRateThreshold": 0.2,
  "batches": [
    {
      "id": "B-1",
      "product": "Widget",
      "produced": 100
    },
    {
      "id": "B-2",
      "product": "Widget",
      "produced": 100
    }
  ],
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "scratch"
    },
    {
      "id": "I-4",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-5",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-6",
      "batchId": "B-2",
      "result": "pass"
    }
  ]
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/nonconformance-report-generate$0.05 USDC

Generate nonconformance reports

Assemble structured nonconformance rows from failed inspections with linked measurements and evidence ids. The report does not claim certification or compliance.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "partId": "P-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "inspectedAt": "2026-11-04T10:00:00.000Z"
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "characteristic": "diameter",
      "value": 12.4,
      "unit": "mm"
    }
  ],
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "lower": 11.8,
      "upper": 12.2,
      "unit": "mm"
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "batchId": "B-1",
      "inspectionId": "I-1",
      "kind": "photo",
      "text": "caliper reading photo",
      "at": "2026-11-04T10:05:00.000Z"
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "generated",
  "reportCount": 1,
  "defectRate": 1,
  "defectRateSupplied": true,
  "reports": [
    {
      "ncrId": "NCR-I-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "partId": "P-1",
      "inspectedAt": "2026-11-04T10:00:00.000Z",
      "defectKind": "dimensional",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "outOfToleranceCount": 1,
      "evidenceCount": 1,
      "evidenceIds": [
        "E-1"
      ],
      "measurementIds": [
        "M-1"
      ],
      "summary": "Nonconformance assembled from inspection I-1 with 1 evidence row(s) and 1 out-of-tolerance measurement(s).",
      "productCertified": false,
      "regulatoryComplianceClaimed": false,
      "standardInvented": false,
      "toleranceInvented": false
    }
  ],
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [
    {
      "kind": "observation",
      "code": "sample_small",
      "subject": "defect_rate",
      "detail": "Only 1 decided inspections were supplied. That is below the disclosed minimum of 20."
    },
    {
      "kind": "observation",
      "code": "threshold_absent",
      "subject": "defect_rate",
      "detail": "No defect-rate threshold was supplied, so over-threshold status was not judged against a limit."
    },
    {
      "kind": "observation",
      "code": "spc_insufficient",
      "subject": "diameter",
      "detail": "Only 1 observations were available. SPC requires at least 25."
    }
  ],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/nonconformance-report-generate" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "partId": "P-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "inspectedAt": "2026-11-04T10:00:00.000Z"
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "characteristic": "diameter",
      "value": 12.4,
      "unit": "mm"
    }
  ],
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "lower": 11.8,
      "upper": 12.2,
      "unit": "mm"
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "batchId": "B-1",
      "inspectionId": "I-1",
      "kind": "photo",
      "text": "caliper reading photo",
      "at": "2026-11-04T10:05:00.000Z"
    }
  ]
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/production-tolerance-check$0.05 USDC

Check production tolerances

Compare supplied measurements with caller-supplied lower and upper limits. SPC mean±3σ limits are computed only when the disclosed observation minimum is met.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "spcMinSample": 5,
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "lower": 11.8,
      "upper": 12.2,
      "unit": "mm"
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "characteristic": "diameter",
      "value": 12
    },
    {
      "id": "M-2",
      "characteristic": "diameter",
      "value": 12.1
    },
    {
      "id": "M-3",
      "characteristic": "diameter",
      "value": 11.9
    },
    {
      "id": "M-4",
      "characteristic": "diameter",
      "value": 12
    },
    {
      "id": "M-5",
      "characteristic": "diameter",
      "value": 12.5
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "checked",
  "outOfToleranceCount": 1,
  "checkedCount": 5,
  "items": [
    {
      "id": "M-1",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-2",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12.1,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-3",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 11.9,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-4",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-5",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12.5,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": false,
      "toleranceChecked": true,
      "status": "above_upper",
      "standardInvented": false,
      "toleranceInvented": false
    }
  ],
  "spc": [
    {
      "characteristic": "diameter",
      "observationCount": 5,
      "spcMinSample": 5,
      "spcComputed": true,
      "mean": 12.1,
      "stdev": 0.2345,
      "ucl": 12.8036,
      "lcl": 11.3964,
      "outOfControlCount": 0,
      "uncertainty": "observed"
    }
  ],
  "spcMinSample": 5,
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/production-tolerance-check" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "spcMinSample": 5,
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "lower": 11.8,
      "upper": 12.2,
      "unit": "mm"
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "characteristic": "diameter",
      "value": 12
    },
    {
      "id": "M-2",
      "characteristic": "diameter",
      "value": 12.1
    },
    {
      "id": "M-3",
      "characteristic": "diameter",
      "value": 11.9
    },
    {
      "id": "M-4",
      "characteristic": "diameter",
      "value": 12
    },
    {
      "id": "M-5",
      "characteristic": "diameter",
      "value": 12.5
    }
  ]
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/root-cause-evidence-analyze$0.04 USDC

Analyze root-cause evidence

Link supplied evidence rows to failed inspections by id and summarize evidence kinds. Links are associations in the request, not proven root causes.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "crack in material"
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "kind": "material-cert",
      "text": "heat lot note",
      "at": "2026-11-04T09:00:00.000Z"
    },
    {
      "id": "E-2",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "kind": "photo",
      "text": "crack photo",
      "at": "2026-11-04T10:00:00.000Z"
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "analyzed",
  "evidenceCount": 2,
  "linkedFailureCount": 1,
  "items": [
    {
      "id": "E-1",
      "batchId": "B-1",
      "inspectionId": "I-1",
      "kind": "material-cert",
      "text": "heat lot note",
      "at": "2026-11-04T09:00:00.000Z",
      "linkedInspection": true,
      "linkedBatch": true
    },
    {
      "id": "E-2",
      "batchId": "B-1",
      "inspectionId": "I-1",
      "kind": "photo",
      "text": "crack photo",
      "at": "2026-11-04T10:00:00.000Z",
      "linkedInspection": true,
      "linkedBatch": true
    }
  ],
  "signals": [
    {
      "code": "evidence_kind",
      "kind": "material-cert",
      "count": 1,
      "detail": "1 evidence row(s) labeled material-cert. This is a count of supplied notes, not a proven root cause."
    },
    {
      "code": "evidence_kind",
      "kind": "photo",
      "count": 1,
      "detail": "1 evidence row(s) labeled photo. This is a count of supplied notes, not a proven root cause."
    },
    {
      "code": "linked_failure_evidence",
      "kind": "link",
      "count": 2,
      "detail": "Inspection I-1 has 2 linked evidence row(s). Association is by id only."
    }
  ],
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/root-cause-evidence-analyze" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "fail",
      "defectText": "crack in material"
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "kind": "material-cert",
      "text": "heat lot note",
      "at": "2026-11-04T09:00:00.000Z"
    },
    {
      "id": "E-2",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "kind": "photo",
      "text": "crack photo",
      "at": "2026-11-04T10:00:00.000Z"
    }
  ]
}
JSON
POSThttps://brainiac.software/api/v1/manufacturing-quality/report$0.12 USDC

Report manufacturing quality

Combine inspection parsing, defect classes, defect rates, batch comparisons, tolerances, NCR rows, and evidence links from supplied records. No certification or compliance is claimed.

Body

FieldRequiredNotes
textNostring
jsonNostring
csvNostring
fileNoobject; Object
inspectionsNoarray; Array
measurementsNoarray; Array
standardsNoarray; Array
batchesNoarray; Array
evidenceNoarray; Array
thresholdsNoarray; Array
defectRateThresholdNonumber
minSampleNointeger
spcMinSampleNointeger

Request exampleJSON

{
  "minSample": 3,
  "spcMinSample": 5,
  "defectRateThreshold": 0.2,
  "batches": [
    {
      "id": "B-1",
      "product": "Widget",
      "produced": 50
    },
    {
      "id": "B-2",
      "product": "Widget",
      "produced": 50
    }
  ],
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "lower": 11.8,
      "upper": 12.2,
      "unit": "mm"
    }
  ],
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec"
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-4",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-5",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-6",
      "batchId": "B-2",
      "result": "pass"
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "characteristic": "diameter",
      "value": 12.4
    },
    {
      "id": "M-2",
      "characteristic": "diameter",
      "value": 12
    },
    {
      "id": "M-3",
      "characteristic": "diameter",
      "value": 12.1
    },
    {
      "id": "M-4",
      "characteristic": "diameter",
      "value": 11.9
    },
    {
      "id": "M-5",
      "characteristic": "diameter",
      "value": 12
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "kind": "photo",
      "text": "caliper photo"
    }
  ]
}

Response exampleJSON

{
  "checkedAt": "2026-11-04T20:00:00.000Z",
  "status": "reported",
  "inspectionCount": 6,
  "failCount": 1,
  "defectRate": 0.1667,
  "defectRateSupplied": true,
  "overThreshold": false,
  "outOfToleranceCount": 1,
  "ncrCount": 1,
  "sampleSufficient": true,
  "uncertainty": "observed",
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "partId": "",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "inspectedAt": "",
      "inspector": "",
      "outcome": "fail",
      "measurementCount": 1
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "partId": "",
      "result": "pass",
      "defectCode": "",
      "defectText": "",
      "inspectedAt": "",
      "inspector": "",
      "outcome": "pass",
      "measurementCount": 0
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "partId": "",
      "result": "pass",
      "defectCode": "",
      "defectText": "",
      "inspectedAt": "",
      "inspector": "",
      "outcome": "pass",
      "measurementCount": 0
    },
    {
      "id": "I-4",
      "batchId": "B-2",
      "partId": "",
      "result": "pass",
      "defectCode": "",
      "defectText": "",
      "inspectedAt": "",
      "inspector": "",
      "outcome": "pass",
      "measurementCount": 0
    },
    {
      "id": "I-5",
      "batchId": "B-2",
      "partId": "",
      "result": "pass",
      "defectCode": "",
      "defectText": "",
      "inspectedAt": "",
      "inspector": "",
      "outcome": "pass",
      "measurementCount": 0
    },
    {
      "id": "I-6",
      "batchId": "B-2",
      "partId": "",
      "result": "pass",
      "defectCode": "",
      "defectText": "",
      "inspectedAt": "",
      "inspector": "",
      "outcome": "pass",
      "measurementCount": 0
    }
  ],
  "defectClasses": [
    {
      "kind": "dimensional",
      "count": 1
    }
  ],
  "batches": [
    {
      "batchId": "B-1",
      "product": "Widget",
      "produced": 50,
      "producedSupplied": true,
      "inspectedCount": 3,
      "decidedCount": 3,
      "failCount": 1,
      "defectRate": 0.3333,
      "defectRateSupplied": true,
      "threshold": 0.2,
      "thresholdSupplied": true,
      "overThreshold": true,
      "sampleSufficient": true,
      "uncertainty": "observed",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    },
    {
      "batchId": "B-2",
      "product": "Widget",
      "produced": 50,
      "producedSupplied": true,
      "inspectedCount": 3,
      "decidedCount": 3,
      "failCount": 0,
      "defectRate": 0,
      "defectRateSupplied": true,
      "threshold": 0.2,
      "thresholdSupplied": true,
      "overThreshold": false,
      "sampleSufficient": true,
      "uncertainty": "observed",
      "productCertified": false,
      "regulatoryComplianceClaimed": false
    }
  ],
  "comparisons": [
    {
      "leftBatchId": "B-1",
      "rightBatchId": "B-2",
      "leftRate": 0.3333,
      "rightRate": 0,
      "rateDifference": 0.3333,
      "minSample": 3,
      "compared": true
    }
  ],
  "ncr": [
    {
      "ncrId": "NCR-I-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "partId": "",
      "inspectedAt": "",
      "defectKind": "dimensional",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec",
      "outOfToleranceCount": 1,
      "evidenceCount": 1,
      "evidenceIds": [
        "E-1"
      ],
      "measurementIds": [
        "M-1"
      ],
      "summary": "Nonconformance assembled from inspection I-1 with 1 evidence row(s) and 1 out-of-tolerance measurement(s).",
      "productCertified": false,
      "regulatoryComplianceClaimed": false,
      "standardInvented": false,
      "toleranceInvented": false
    }
  ],
  "tolerances": [
    {
      "id": "M-1",
      "batchId": "B-1",
      "inspectionId": "I-1",
      "characteristic": "diameter",
      "value": 12.4,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": false,
      "toleranceChecked": true,
      "status": "above_upper",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-2",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-3",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12.1,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-4",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 11.9,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    },
    {
      "id": "M-5",
      "batchId": "",
      "inspectionId": "",
      "characteristic": "diameter",
      "value": 12,
      "valueSupplied": true,
      "unit": "mm",
      "lower": 11.8,
      "lowerSupplied": true,
      "upper": 12.2,
      "upperSupplied": true,
      "target": 12,
      "targetSupplied": true,
      "withinTolerance": true,
      "toleranceChecked": true,
      "status": "within",
      "standardInvented": false,
      "toleranceInvented": false
    }
  ],
  "spc": [
    {
      "characteristic": "diameter",
      "observationCount": 5,
      "spcMinSample": 5,
      "spcComputed": true,
      "mean": 12.08,
      "stdev": 0.1924,
      "ucl": 12.6571,
      "lcl": 11.5029,
      "outOfControlCount": 0,
      "uncertainty": "observed"
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "batchId": "B-1",
      "inspectionId": "I-1",
      "kind": "photo",
      "text": "caliper photo",
      "at": "",
      "linkedInspection": true,
      "linkedBatch": true
    }
  ],
  "signals": [
    {
      "code": "evidence_kind",
      "kind": "photo",
      "count": 1,
      "detail": "1 evidence row(s) labeled photo. This is a count of supplied notes, not a proven root cause."
    },
    {
      "code": "linked_failure_evidence",
      "kind": "link",
      "count": 1,
      "detail": "Inspection I-1 has 1 linked evidence row(s). Association is by id only."
    }
  ],
  "standardInvented": false,
  "toleranceInvented": false,
  "productCertified": false,
  "regulatoryComplianceClaimed": false,
  "findings": [],
  "limitations": [
    "Inspections, measurements, batches, standards, and evidence are copied only from labeled fields supplied by the caller.",
    "Tolerances and defect-rate thresholds are used only when explicitly supplied. Manufacturing standards are never invented.",
    "Statistical process control limits are computed only when the disclosed minimum observation count is met.",
    "A nonconformance report organizes supplied evidence. It does not certify a product or assert regulatory compliance.",
    "Defect classes use transparent token rules on supplied defect text and codes."
  ]
}

cURL

curl -i -X POST "https://brainiac.software/api/v1/manufacturing-quality/report" \
  -H 'content-type: application/json' \
  -H 'Idempotency-Key: <fresh-64-character-random-hex-key>' \
  --data-binary @- <<'JSON'
{
  "minSample": 3,
  "spcMinSample": 5,
  "defectRateThreshold": 0.2,
  "batches": [
    {
      "id": "B-1",
      "product": "Widget",
      "produced": 50
    },
    {
      "id": "B-2",
      "product": "Widget",
      "produced": 50
    }
  ],
  "standards": [
    {
      "characteristic": "diameter",
      "target": 12,
      "lower": 11.8,
      "upper": 12.2,
      "unit": "mm"
    }
  ],
  "inspections": [
    {
      "id": "I-1",
      "batchId": "B-1",
      "result": "fail",
      "defectCode": "DIM-01",
      "defectText": "diameter out of spec"
    },
    {
      "id": "I-2",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-3",
      "batchId": "B-1",
      "result": "pass"
    },
    {
      "id": "I-4",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-5",
      "batchId": "B-2",
      "result": "pass"
    },
    {
      "id": "I-6",
      "batchId": "B-2",
      "result": "pass"
    }
  ],
  "measurements": [
    {
      "id": "M-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "characteristic": "diameter",
      "value": 12.4
    },
    {
      "id": "M-2",
      "characteristic": "diameter",
      "value": 12
    },
    {
      "id": "M-3",
      "characteristic": "diameter",
      "value": 12.1
    },
    {
      "id": "M-4",
      "characteristic": "diameter",
      "value": 11.9
    },
    {
      "id": "M-5",
      "characteristic": "diameter",
      "value": 12
    }
  ],
  "evidence": [
    {
      "id": "E-1",
      "inspectionId": "I-1",
      "batchId": "B-1",
      "kind": "photo",
      "text": "caliper photo"
    }
  ]
}
JSON