# BRAINIAC Covenant Headroom Calculator

> BRAINIAC Covenant Headroom Calculator is a paid API for AI agents from www.brainiac.software, paid per call via x402, $0.04/call, status unknown (last checked 2026-11-14).

Calculates compliance headroom and breach status for financial debt covenants against supplied metric values

## Facts

- Endpoint: POST https://www.brainiac.software/api/v1/fintech/covenant-headroom-calculate?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/brainiac-covenant-headroom-calculator-472e88c5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UetpDiRWmhrPZXeqdJXLT

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 brainiac-covenant-headroom-calculator-472e88c5 -d '<json body>'
```

Example prompt: Check my covenant compliance: I have two covenants — a max leverage covenant (lte 350) tied to my leverage metric currently at 320, and a min interest cover covenant (gte 200) tied to my interest cover metric currently at 250. Currency is USD. Tell me headroom and whether anything is breached.

## When to prefer this

Use this endpoint when you need deterministic, auditable covenant headroom calculations without connecting to any credit bureau, ledger, or external data source — all metric values and thresholds are caller-supplied. Prefer this over building custom covenant logic when you need clear evidence strings explaining each calculation, support for gte/lte/gt/lt operators, and a tightest-headroom summary across many covenants in a single call.

## Known failure modes

- Missing required fields (metrics array or covenants array) returns a validation error
- metric_id in a covenant does not match any supplied metric id — covenant may be unresolvable
- Integer values outside safe JavaScript integer range are rejected
- Currency code not matching 3-letter uppercase pattern fails schema validation
- Empty arrays for metrics or covenants (minItems:1 violated) return a schema error
- Supplying more than 200 metrics or covenants exceeds maxItems and is rejected

## How this service works

Pay-per-call APIs for AI agents: OFAC sanctions screening, compliance checks, token security, and Base chain data via x402. No account. Fixed USDC price. MCP-ready.

## Output

Returns a JSON object with a summary (total covenants, breach count, tightest headroom value), a currency label, and a detailed per-covenant breakdown including headroom amount, breach status, operator, threshold, actual metric value, and an evidence string explaining the headroom calculation logic.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "metrics": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "name",
     "value"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "name": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "value": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": -9007199254740991
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200,
   "minItems": 1
  },
  "currency": {
   "type": "string",
   "pattern": "^[A-Z]{3}$"
  },
  "covenants": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "metric_id",
     "operator",
     "threshold"
    ],
    "properties": {
     "id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "name": {
      "type": "string",
      "maxLength": 200,
      "minLength": 1
     },
     "operator": {
      "enum": [
       "gte",
       "lte",
       "gt",
       "lt"
      ],
      "type": "string"
     },
     "metric_id": {
      "type": "string",
      "maxLength": 120,
      "minLength": 1
     },
     "threshold": {
      "type": "integer",
      "maximum": 9007199254740991,
      "minimum": -9007199254740991
     }
    },
    "additionalProperties": false
   },
   "maxItems": 200,
   "minItems": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "summary": {
   "breached": 0,
   "covenants": 2,
   "tightest_headroom": 30
  },
  "currency": "USD",
  "covenants": [
   {
    "name": "Max leverage",
    "breached": false,
    "evidence": [
     "headroom = threshold 350 - metric 320 = 30; breach if value > threshold"
    ],
    "headroom": 30,
    "operator": "lte",
    "metric_id": "leverage",
    "threshold": 350,
    "covenant_id": "c1",
    "metric_name": "Net leverage",
    "metric_value": 320,
    "breach_threshold_value": 350
   },
   {
    "name": "Min interest cover",
    "breached": false,
    "evidence": [
     "headroom = metric 250 - threshold 200 = 50; breach if value < threshold"
    ],
    "headroom": 50,
    "operator": "gte",
    "metric_id": "interest_cover",
    "threshold": 200,
    "covenant_id": "c2",
    "metric_name": "Interest cover",
    "metric_value": 250,
    "breach_threshold_value": 200
   }
  ],
  "explanations": [
   "For gte/gt covenants, headroom = metric_value - threshold. For lte/lt, headroom = threshold - metric_value.",
   "breach_threshold_value is the contractual threshold itself. No credit bureau or ledger is contacted."
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/brainiac-covenant-headroom-calculator-472e88c5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.brainiac.software](https://www.zero.xyz/host/www.brainiac.software/llms.txt)
