{
 "openapi": "3.1.0",
 "info": {
  "title": "Atomless Labs APIs",
  "version": "0.4.7",
  "description": "Keys at https://atomlesslabs.com/api/keys. Without a key: 3 tries a day on the no-model APIs. With a key: 50 free calls per API (10 on abstract-up), then each call is charged at its price below. Per-unit APIs answer a billing object {unit, count} and accept max_units to cap the charge; on a paid call max_units is lowered to what your credit pays for. Prices: https://atomlesslabs.com/pricing/"
 },
 "servers": [
  {
   "url": "https://atomlesslabs.com"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "Authorization: Bearer al_..."
   }
  }
 },
 "paths": {
  "/v1/sheetcheck": {
   "post": {
    "operationId": "sheetcheck",
    "summary": "Tolerance",
    "description": "Checks a spreadsheet's formulas against the input and output ranges you state, and names the cells that break them. Use when: a user has an Excel (.xlsx) workbook and wants to know whether its formulas can break (divide by zero, go negative, leave a stated range) for the input ranges they give. Not for: SQL rules (use sql_rule_relations) or reading scanned tables (use vision_read). Price: 50 free calls per signed-in person, then $0.04 a call (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "xlsx_base64": {
          "type": "string",
          "description": "base64 of the .xlsx file"
         },
         "spec": {
          "type": "object",
          "properties": {
           "inputs": {
            "type": "object",
            "additionalProperties": {
             "type": "array",
             "items": {
              "type": "number"
             },
             "minItems": 2,
             "maxItems": 2
            }
           },
           "bounds": {
            "type": "object",
            "additionalProperties": {
             "type": "array",
             "items": {
              "type": "number"
             },
             "minItems": 2,
             "maxItems": 2
            }
           }
          },
          "required": []
         },
         "ranges_text": {
          "type": "string",
          "description": "free text such as 'B2 is hours, 0 to 80; Pay!B3 between 1 and 52'"
         }
        },
        "required": [
         "xlsx_base64"
        ]
       },
       "example": {
        "xlsx_base64": "<base64 of your .xlsx; here 3 cells: B1 hours 45, B2 rate 20, B3 =B1*B2*1.5>",
        "spec": {
         "inputs": {
          "Pay!B1": [
           0,
           80
          ],
          "Pay!B2": [
           15,
           40
          ]
         },
         "bounds": {
          "Pay!B3": [
           0,
           2500
          ]
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "status": 200,
         "version": "0.1.2",
         "engine": "sheetcheck 0.1.2",
         "proved": false,
         "summary": {
          "cells": 1,
          "div0": 0,
          "range": 1,
          "unknown": 0
         },
         "findings": [
          {
           "kind": "range",
           "cell": "Pay!B3",
           "value": [
            0.0,
            4800.0
           ],
           "bound": [
            0.0,
            2500.0
           ]
          }
         ],
         "assumed_inputs": {
          "Pay!B1": [
           0,
           80
          ],
          "Pay!B2": [
           15,
           40
          ]
         },
         "unparsed": [],
         "note": "proved=true means no formula can divide by zero or leave a stated bound for any input in the ranges; false alarms are possible, missed errors are not"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/agent-permission-check": {
   "post": {
    "operationId": "agent_permission_check",
    "summary": "Inviolate",
    "description": "Proves, with a solver, what an AI agent's AWS role can and cannot reach under the policies you send. Use when: a user sends AWS IAM, S3 bucket, KMS key or role trust policies and asks what an agent's AWS role can or cannot reach; answers are proved by a solver. Not for: SQL or spreadsheet rules. Price: 50 free calls per signed-in person, then $0.04 a call (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "account_id": {
          "type": "string"
         },
         "principal": {
          "type": "string",
          "description": "the agent role ARN"
         },
         "policies": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "type": {
             "type": "string",
             "enum": [
              "identity_managed",
              "identity_inline",
              "s3_bucket_policy",
              "kms_key_policy",
              "role_trust_policy"
             ]
            },
            "attached_to": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "resource": {
             "type": "string"
            },
            "document": {
             "type": "object"
            }
           },
           "required": [
            "type",
            "document"
           ]
          }
         },
         "rules": {
          "type": "array",
          "items": {
           "type": "integer",
           "minimum": 1,
           "maximum": 10
          }
         },
         "params": {
          "type": "object"
         }
        },
        "required": [
         "account_id",
         "principal",
         "policies"
        ]
       },
       "example": {
        "account_id": "111122223333",
        "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
        "policies": [
         {
          "type": "identity_inline",
          "attached_to": [
           "arn:aws:iam::111122223333:role/AgentRole-Ops"
          ],
          "document": {
           "Version": "2012-10-17",
           "Statement": [
            {
             "Effect": "Allow",
             "Action": "*",
             "Resource": "*"
            }
           ]
          }
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "tool": "z3_key 0.4.3",
         "api": "ct1_api 0.1.1",
         "scope": "identity+s3-bucket+kms-key+role-trust,one-account,ipv4-sourceip,supplied-policies-only",
         "results": {
          "1": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "iam:CreatePolicy",
           "resource": "arn:aws:iam::111122223333:policy/-",
           "ip": null,
           "unmodelled": []
          },
          "2": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "secretsmanager:GetSecretValue",
           "resource": "arn:aws:secretsmanager:aa-a-0:111122223333:secret:0",
           "ip": null,
           "unmodelled": []
          },
          "3": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "s3:PutBucketPolicy",
           "resource": "arn:aws:s3:::-",
           "ip": null,
           "unmodelled": []
          },
          "4": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "cloudtrail:StopLogging",
           "resource": "arn:aws:cloudtrail:aa-a-0:111122223333:trail/+",
           "ip": null,
           "unmodelled": []
          },
          "5": {
           "verdict": "condition_dependent",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "sts:AssumeRole",
           "resource": "arn:aws:iam::111122223333:role/.",
           "ip": null,
           "unmodelled": [
            "trust policy not supplied"
           ]
          },
          "6": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "lambda:CreateFunction",
           "resource": "arn:aws:lambda:aa-a-0:111122223333:function:a",
           "ip": null,
           "unmodelled": []
          },
          "7": {
           "verdict": "proven"
          },
          "8": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "s3:DeleteBucket",
           "resource": "arn:aws:s3:::A",
           "ip": null,
           "unmodelled": []
          },
          "9": {
           "verdict": "condition_dependent",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "action": "kms:PutKeyPolicy",
           "resource": "arn:aws:kms:aa-a-0:111122223333:key/.",
           "ip": null,
           "unmodelled": [
            "key policy not supplied"
           ]
          },
          "10": {
           "verdict": "has_access",
           "principal": "arn:aws:iam::111122223333:role/AgentRole-Ops",
           "sid": "#0",
           "policy": "policies/p0.json",
           "unmodelled": []
          }
         },
         "refused": null
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/quote": {
   "post": {
    "operationId": "quote",
    "summary": "Ceiling",
    "description": "What an AI job will cost and how long it takes, from measured calls. No model calls. Use when: a user asks what an AI or model job will cost or how long it will take before running it (calls, documents, tokens, a model choice), or how long a task estimate really runs. Not for: checking results after the job. Price: 50 free calls per signed-in person, then $0.04 a call (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "quote": {
          "type": "string",
          "enum": [
           "cost",
           "runtime",
           "size",
           "hours"
          ]
         },
         "kind": {
          "type": "string"
         },
         "model": {
          "type": "string"
         },
         "count": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000
         },
         "calls": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000
         },
         "task": {
          "type": "string"
         },
         "workers": {
          "type": "integer",
          "minimum": 1,
          "maximum": 64
         },
         "cap_s": {
          "type": "integer",
          "minimum": 1,
          "maximum": 86400
         },
         "chars": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100000
         },
         "models": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "minItems": 1,
          "maxItems": 6
         },
         "est_minutes": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 10000
         },
         "pairs_tsv": {
          "type": "string",
          "maxLength": 60000
         },
         "role": {
          "type": "string"
         }
        },
        "required": [
         "quote"
        ]
       },
       "example": {
        "quote": "cost",
        "kind": "general-purpose",
        "model": "claude-sonnet-5-5",
        "count": 10
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "lines": [
          "ESTIMATE kind=general-purpose model=claude-sonnet-5-5 runs=405 median=0.4257 p90=1.3334 count=10 quote=4.2569 reserve=13.3339 rough=no tail=ok p25=0.2982 p75=0.6901 basis=list-price dropped_jobs=1"
         ],
         "quote": "cost",
         "result": {
          "basis": "list-price",
          "count": 10,
          "dropped_jobs": 1,
          "kind": "general-purpose",
          "median": 0.4257,
          "model": "claude-sonnet-5-5",
          "p25": 0.2982,
          "p75": 0.6901,
          "p90": 1.3334,
          "quote": 4.2569,
          "reserve": 13.3339,
          "rough": "no",
          "runs": 405,
          "tail": "ok"
         },
         "version": "0.1.0"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/answer": {
   "post": {
    "operationId": "answer",
    "summary": "Residue",
    "description": "Did a reply drop the numbers, quoted names, listed names or each/all/every/both words of the request? No model calls. Use when: a user wants to know whether a reply, email or agent answer covers everything the request asked for: its numbers, quoted names, listed names and each/all/both items. Not for: grading whether the facts are true. Price: 50 free calls per signed-in person, then $0.04 a call (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "request": {
          "type": "string"
         },
         "reply": {
          "type": "string"
         },
         "also": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "min_missing": {
          "type": "integer",
          "minimum": 1
         }
        },
        "required": [
         "request",
         "reply"
        ]
       },
       "example": {
        "request": "Compare Q3 revenue for both Boston and Denver, and the 2024 total.",
        "reply": "Here are the Q3 numbers for Boston."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "version": "0.2.0",
         "items": [
          "2024",
          "Boston",
          "Denver"
         ],
         "missing": [
          "2024",
          "Denver"
         ],
         "verdict": "flag"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/ascent": {
   "post": {
    "operationId": "ascent",
    "summary": "Ascent",
    "description": "Ranks your open tasks by what moves your goals fastest: ready work, blocked work, the critical path and its slack. Use when: a user has a task list or tracker export (Jira, GitHub, Linear, Asana) with dependencies or due dates and wants priorities, what to do first, or the critical path. Not for: staff shift schedules (use shift_roster). Price: 50 free calls per signed-in person, then $0.04 a call (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "tasks": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "title": {
             "type": "string"
            },
            "owner": {
             "type": "string"
            },
            "state": {
             "type": "string"
            },
            "due": {
             "type": "string"
            },
            "est_h": {
             "type": "number"
            },
            "value": {
             "type": "number"
            },
            "goal": {
             "type": "string"
            },
            "depends_on": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "wait_on": {
             "type": [
              "string",
              "null"
             ]
            }
           },
           "required": [
            "id"
           ]
          },
          "maxItems": 5000
         },
         "goals": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "deadline": {
             "type": [
              "string",
              "null"
             ]
            },
            "value": {
             "type": "number"
            },
            "order": {
             "type": [
              "integer",
              "null"
             ]
            }
           },
           "required": [
            "id"
           ]
          }
         },
         "now": {
          "type": "string",
          "description": "ISO time"
         }
        },
        "required": [
         "tasks"
        ]
       },
       "example": {
        "tasks": [
         {
          "id": "site",
          "title": "Launch pricing page",
          "goal": "sales",
          "est_h": 6,
          "value": 5
         },
         {
          "id": "copy",
          "title": "Write pricing copy",
          "goal": "sales",
          "est_h": 2,
          "value": 2
         },
         {
          "id": "ads",
          "title": "Start ads",
          "goal": "sales",
          "est_h": 3,
          "value": 3,
          "depends_on": [
           "site"
          ]
         },
         {
          "id": "fix",
          "title": "Fix signup bug",
          "goal": "trust",
          "est_h": 1,
          "value": 4
         }
        ],
        "goals": [
         {
          "id": "sales",
          "deadline": "2027-01-15T00:00:00Z",
          "value": 3,
          "order": 1
         },
         {
          "id": "trust",
          "deadline": "2026-12-20T00:00:00Z",
          "value": 2,
          "order": 2
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "version": "ftfcore.py 0.1.2",
         "fast_path": [
          {
           "id": "site",
           "goal": "sales",
           "value_per_h": 0.8333,
           "late_h": 0.0,
           "why": "goal sales; critical chain; value/h 0.833; unblocks 1",
           "rank": 1
          },
          {
           "id": "copy",
           "goal": "sales",
           "value_per_h": 1.0,
           "late_h": 0.0,
           "why": "goal sales; value/h 1",
           "rank": 2
          },
          {
           "id": "fix",
           "goal": "trust",
           "value_per_h": 4.0,
           "late_h": 0.0,
           "why": "goal trust; critical chain; value/h 4",
           "rank": 3
          }
         ],
         "critical_path": [
          "fix"
         ],
         "unlinked": [],
         "waits": [],
         "counts": {
          "tasks": 4,
          "closed": 0,
          "open": 4,
          "unknown_deps": 0,
          "cycles": 0,
          "ready": 3,
          "waiting": 0,
          "unlinked": 0,
          "blocked": 1
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/abstract-up": {
   "post": {
    "operationId": "abstract_up",
    "summary": "Abstract-up",
    "description": "One mistake, result, idea or plan in; the rule behind it, that rule lifted, where else it holds and what to do next out. Use when: a user describes one mistake, result, idea or plan and wants the general rule behind it, where else it applies, and what to do next. Not for: a log of many agent failures (use agent_failures). Price: 10 free calls per signed-in person, then $0.06 a call; a key is always needed (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "enum": [
           "result",
           "mistake",
           "idea",
           "plan"
          ]
         },
         "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 8000
         },
         "context": {
          "type": "string",
          "maxLength": 4000
         },
         "goal": {
          "type": "string",
          "maxLength": 500
         }
        },
        "required": [
         "kind",
         "text"
        ]
       },
       "example": {
        "kind": "mistake",
        "text": "We shipped a price change to the API but forgot to update the pricing page, so two customers saw the old price."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "attempts": 1,
         "checked": true,
         "kind": "mistake",
         "model": "minimax/minimax-m3.1-flash",
         "steps": {
          "lifted": "When you change one part of what customers buy, update every place that describes it and have someone confirm all descriptions agree before release. Otherwise customers will see conflicting information and some will act on the wrong terms.",
          "predictions": [
           {
            "measure": "Count of customer complaints about wrong pricing or terms in the 30 days after each change, compared with whether a checklist record exists",
            "population": "Small businesses that change prices, features, or limits and publish them in more than one place",
            "prediction": "Releases with a signed checklist will produce fewer customer complaints about old or wrong information than releases without one."
           },
           {
            "measure": "Percentage of changes with a completed page-update and verification record",
            "population": "Businesses that deploy code changes automatically but edit public pages by hand",
            "prediction": "Most mismatches will occur where the page-update record was skipped."
           },
           {
            "measure": "Time from a live change to detection of a mismatched public page",
            "population": "Companies with a public pricing page and a live product or API",
            "prediction": "An automated comparison will find stale pages within a day instead of after a customer complains."
           }
          ],
          "restate": "The business shipped a price change to the API but forgot to update the pricing page, so two customers saw the old price.",
          "rule": "The price change went live in the API without anyone checking the public pricing page, and no step caught the mismatch. To prevent this, require every price or product change to update all customer-facing pages and have a second person verify them against the live product before release, with a checklist that holds the release until the check is signed off.",
          "spinoffs": [
           {
            "cost_hint": "Low, mostly staff time",
            "first_step": "List every place customers see prices or limits, then add those pages to a checklist required before each release",
            "goal": "Stop customers from seeing stale prices or terms",
            "idea": "Offer a release checklist and signoff service for any customer-facing change"
           },
           {
            "cost_hint": "Low to moderate, a simple script and small hosting cost",
            "first_step": "Connect the live API to the two or three price pages that matter and set up a daily check",
            "goal": "Catch mismatches automatically each day",
            "idea": "Build a small tool that compares live product values with the prices shown on public pages"
           },
           {
            "cost_hint": "Low, uses the same checking tool",
            "first_step": "Run the audit for a few local companies and price it per site checked",
            "goal": "Create a service that finds stale information before customers do",
            "idea": "Sell a fixed-price mismatch audit to other small businesses"
           }
          ]
         },
         "usd": 0.000753,
         "version": "0.2.0"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sql-rule-relations": {
   "post": {
    "operationId": "sql_rule_relations",
    "summary": "Corollary",
    "description": "Which SQL validation rules on one table conflict, imply another, never fire or are redundant, proved by a solver (z3). Use when: a user has SQL validation or data-quality rules (WHERE clauses on one table) and wants to know which conflict, imply each other, are redundant or can never fire; proved by a solver. Not for: spreadsheet formulas. Price: 50 free calls per signed-in person (3 tries a day with no key), then $0.05 a call up to 40 rules, $0.20 for 41 to 150 (billing unit rule_tier) (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "rules": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "pattern": "^[A-Za-z0-9._-]{1,100}$"
            },
            "sql": {
             "type": "string",
             "minLength": 1
            }
           },
           "required": [
            "id",
            "sql"
           ]
          },
          "minItems": 1,
          "maxItems": 150
         },
         "timeout_ms": {
          "type": "integer",
          "minimum": 100,
          "maximum": 10000
         },
         "max_units": {
          "type": "integer",
          "minimum": 1
         }
        },
        "required": [
         "rules"
        ]
       },
       "example": {
        "rules": [
         {
          "id": "big",
          "sql": "SELECT * FROM loans WHERE amount > 10000 AND submission_id = {0}"
         },
         {
          "id": "mid",
          "sql": "SELECT * FROM loans WHERE amount > 5000 AND submission_id = {0}"
         },
         {
          "id": "neg",
          "sql": "SELECT * FROM loans WHERE amount < 0 AND submission_id = {0}"
         },
         {
          "id": "never",
          "sql": "SELECT * FROM loans WHERE amount > 5000 AND amount < 3000 AND submission_id = {0}"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "billing": {
          "count": 1,
          "tier": "le40",
          "unit": "rule_tier"
         },
         "checked_by": [
          "z3"
         ],
         "conflicts": [
          {
           "a": "big",
           "b": "neg"
          },
          {
           "a": "big",
           "b": "never"
          },
          {
           "a": "mid",
           "b": "neg"
          },
          {
           "a": "mid",
           "b": "never"
          },
          {
           "a": "neg",
           "b": "never"
          }
         ],
         "counts": {
          "conflicts": 5,
          "implies": 4,
          "never_fire": 1,
          "pairs": 6,
          "redundant": 2,
          "rules": 4,
          "skipped": 0,
          "z3_cvc5_disagree": 0
         },
         "implies": [
          {
           "a": "big",
           "b": "mid"
          },
          {
           "a": "never",
           "b": "big"
          },
          {
           "a": "never",
           "b": "mid"
          },
          {
           "a": "never",
           "b": "neg"
          }
         ],
         "never_fire": [
          "never"
         ],
         "redundant": [
          {
           "covered_by": [],
           "id": "big"
          },
          {
           "covered_by": [],
           "id": "never"
          }
         ],
         "rules": 4,
         "skipped": [],
         "unknown": [],
         "version": "0.2.0"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/label-audit": {
   "post": {
    "operationId": "label_audit",
    "summary": "True Label",
    "description": "Finds wrong labels in a training set or form archive: three independent readers must all read a field as something else. Use when: a user has document images together with values already keyed or labelled for them (a training set, an answer key, a form archive) and wants the labels that are probably wrong. Not for: reading a document that has no labels yet (use vision_read). Price: 10 free calls per signed-in person, each up to 5 pages, then $0.14 a page read (billing unit page) (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "pages": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "image_b64": {
             "type": "string",
             "description": "base64 of a PNG or JPEG"
            },
            "mime": {
             "type": "string",
             "enum": [
              "image/png",
              "image/jpeg"
             ]
            },
            "fields": {
             "type": "object",
             "additionalProperties": {
              "type": "string"
             }
            },
            "help": {
             "type": "object",
             "additionalProperties": {
              "type": "string"
             }
            }
           },
           "required": [
            "image_b64",
            "mime",
            "fields"
           ]
          },
          "minItems": 1,
          "maxItems": 50
         },
         "max_units": {
          "type": "integer",
          "minimum": 1,
          "description": "read at most this many pages; the rest are listed in not_read and not charged"
         }
        },
        "required": [
         "pages"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/vision-read": {
   "post": {
    "operationId": "vision_read",
    "summary": "Vision read",
    "description": "Reads named fields, rows or a table from a document image; each value is marked trusted, resolved or check. Use when: a user wants fields, line items or a table read from one document image (invoice, receipt, form, label, scanned table), each value marked trusted or to check. Not for: checking labels a user already has (use label_audit). Price: 10 free calls per signed-in person, then $0.22 an invoice plus $0.15 when the second look runs, at most $0.37 (billing unit invoice; send second_look false to skip the second look) (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "image_b64": {
          "type": "string",
          "description": "base64 of a PNG or JPEG"
         },
         "mime": {
          "type": "string",
          "enum": [
           "image/png",
           "image/jpeg"
          ]
         },
         "mode": {
          "type": "string",
          "enum": [
           "fields",
           "rows",
           "table"
          ]
         },
         "fields": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "row_fields": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "document_fields": {
          "type": "array",
          "items": {
           "type": "string"
          }
         },
         "help": {
          "type": "object",
          "additionalProperties": {
           "type": "string"
          }
         },
         "rules": {
          "oneOf": [
           {
            "type": "string"
           },
           {
            "type": "array",
            "items": {
             "type": "string"
            }
           }
          ]
         },
         "max_units": {
          "type": "integer",
          "minimum": 1
         },
         "second_look": {
          "type": "boolean",
          "description": "default true: a stronger model settles the values the three readers disagree on ($0.15 when it runs); false skips it"
         }
        },
        "required": [
         "image_b64",
         "mime"
        ]
       },
       "example": {
        "mode": "fields",
        "image_b64": "<base64 of your PNG or JPEG; here invoice 1 of the public FATURA set>",
        "mime": "image/jpeg",
        "fields": [
         "DATE",
         "DISCOUNT",
         "DUE_DATE",
         "PO_NUMBER"
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "billing": {
          "count": 1,
          "second_look": 1,
          "unit": "invoice"
         },
         "calls": 4,
         "errors": {},
         "fields": {
          "DATE": {
           "readers": {
            "deepseek/deepseek-v4.1-flash": "Invoice Date: 12-Dec-2019",
            "minimax/minimax-m3.1-flash": "Invoice Date : 12-Dec-2019",
            "qwen/qwen3.8-27b": "12-Dec-2019"
           },
           "status": "resolved",
           "strong": "Invoice Date: 12-Dec-2019",
           "value": "Invoice Date: 12-Dec-2019"
          },
          "DISCOUNT": {
           "readers": {
            "deepseek/deepseek-v4.1-flash": "DISCOUNT(2.51%): (-) 6.55",
            "minimax/minimax-m3.1-flash": "DISCOUNT(2.51%): (-) 6.55",
            "qwen/qwen3.8-27b": "DISCOUNT(2.51%): (-) 6.55"
           },
           "status": "trusted",
           "strong": null,
           "value": "DISCOUNT(2.51%): (-) 6.55"
          },
          "DUE_DATE": {
           "readers": {
            "deepseek/deepseek-v4.1-flash": "Due Date : 04-Dec-1995",
            "minimax/minimax-m3.1-flash": "Due Date : 04-Dec-1995",
            "qwen/qwen3.8-27b": "04-Dec-1995"
           },
           "status": "resolved",
           "strong": "Due Date : 04-Dec-1995",
           "value": "Due Date : 04-Dec-1995"
          },
          "PO_NUMBER": {
           "readers": {
            "deepseek/deepseek-v4.1-flash": "PO Number :04",
            "minimax/minimax-m3.1-flash": "PO Number :04",
            "qwen/qwen3.8-27b": ":04"
           },
           "status": "resolved",
           "strong": "PO Number :04",
           "value": "PO Number :04"
          }
         },
         "second_look": {
          "ran": true,
          "settled": 3
         },
         "skipped": [],
         "usd": 0.006017,
         "version": "0.4.2"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/agent-failures": {
   "post": {
    "operationId": "agent_failures",
    "summary": "Agent failures",
    "description": "Sorts the failures your AI agent made, in your own words, into 16 kinds, ranks them, and names the safeguard and our API for each kind. Use when: a user has a list or log of many failures an AI agent made and wants them sorted into kinds, ranked, with the safeguard to build for each. Not for: one single event (use abstract_up). Price: 10 free calls per signed-in person, each up to 50 failures, then $0.005 a failure sorted, $0.05 per 10 (billing unit failure) (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "failures": {
          "type": "array",
          "items": {
           "oneOf": [
            {
             "type": "string",
             "minLength": 1,
             "maxLength": 2000
            },
            {
             "type": "object",
             "properties": {
              "id": {
               "type": "string",
               "minLength": 1,
               "maxLength": 100
              },
              "text": {
               "type": "string",
               "minLength": 1,
               "maxLength": 2000
              }
             },
             "required": [
              "id",
              "text"
             ]
            }
           ]
          },
          "minItems": 1,
          "maxItems": 200
         },
         "max_units": {
          "type": "integer",
          "minimum": 1,
          "description": "sort at most this many failures; the rest are listed in not_read and not charged"
         }
        },
        "required": [
         "failures"
        ]
       },
       "example": {
        "failures": [
         "Said the report was saved but the file was never written.",
         "Ran rm -rf on the build folder without asking.",
         "Quoted a price from last month's page.",
         "Stopped after 3 of 10 steps and said it was done.",
         "Pasted an API key into the chat log."
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "billing": {
          "count": 5,
          "unit": "failure"
         },
         "calls": 1,
         "items": [
          {
           "id": "f1",
           "kind": "claimed-done-unverified"
          },
          {
           "id": "f2",
           "kind": "unsafe-action"
          },
          {
           "id": "f3",
           "kind": "stale-or-wrong-input"
          },
          {
           "id": "f4",
           "kind": "stopped-early"
          },
          {
           "id": "f5",
           "kind": "unsafe-action"
          }
         ],
         "kinds": [
          {
           "api": "/v1/agent-permission-check",
           "count": 2,
           "kind": "unsafe-action",
           "safeguard": "a pre-action gate on destructive commands, secrets and cloud permissions",
           "share": 0.4
          },
          {
           "api": null,
           "count": 1,
           "kind": "claimed-done-unverified",
           "safeguard": "a turn-end check that refuses 'done' unless a proof line was read in the same turn",
           "share": 0.2
          },
          {
           "api": null,
           "count": 1,
           "kind": "stale-or-wrong-input",
           "safeguard": "re-read inputs and check their date or hash before use",
           "share": 0.2
          },
          {
           "api": "/v1/ascent",
           "count": 1,
           "kind": "stopped-early",
           "safeguard": "a stop check that blocks ending a turn while queue items are open and unblocked",
           "share": 0.2
          }
         ],
         "next": "send 2 or 3 full examples of your top kind (unsafe-action) to /v1/abstract-up to find the rule behind them",
         "not_read": [],
         "top": "unsafe-action",
         "usd": 5.4e-05,
         "version": "0.2.0"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/shift-roster": {
   "post": {
    "operationId": "shift_roster",
    "summary": "Shift Roster",
    "description": "Builds the lowest-cost staff roster that covers every shift's roles within hours, rest and availability rules, proved optimal by a solver; if no roster fits, names the smallest set of clashing rules. Use when: a user wants a staff shift schedule or rota built from staff skills, wages, hours and days off, covering each shift at the lowest cost. Not for: ranking project tasks (use ascent). Price: free up to 10 staff, then $3.74 a roster (billing unit roster) (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "units": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "description": "a unique short name, e.g. ana"
            },
            "skills": {
             "type": "array",
             "items": {
              "type": "string"
             },
             "description": "roles the person can do, e.g. [\"cook\", \"cashier\"]"
            },
            "wage": {
             "type": "number",
             "description": "pay per hour"
            },
            "maxHours": {
             "type": "number",
             "description": "most hours a week"
            },
            "unavailable": {
             "type": "array",
             "items": {
              "type": "integer",
              "minimum": 0
             },
             "description": "optional: day numbers the person cannot work, e.g. [0, 6]"
            }
           },
           "required": [
            "id",
            "skills",
            "wage",
            "maxHours"
           ]
          },
          "minItems": 1,
          "maxItems": 100,
          "description": "the staff"
         },
         "slots": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string",
             "description": "a unique name, e.g. mon-am"
            },
            "day": {
             "type": "integer",
             "minimum": 0,
             "maximum": 30,
             "description": "0 is the first day of the plan"
            },
            "start": {
             "type": "number",
             "minimum": 0,
             "maximum": 24,
             "description": "hour 0-24; 7.5 = 7:30"
            },
            "end": {
             "type": "number",
             "minimum": 0,
             "maximum": 24,
             "description": "hour 0-24; below start runs past midnight"
            },
            "needs": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "skill": {
                "type": "string"
               },
               "count": {
                "type": "integer",
                "minimum": 1
               }
              },
              "required": [
               "skill",
               "count"
              ]
             },
             "description": "people of each role the shift needs"
            }
           },
           "required": [
            "id",
            "day",
            "start",
            "end",
            "needs"
           ]
          },
          "minItems": 1,
          "maxItems": 200,
          "description": "the shifts"
         },
         "rules": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "type": {
             "type": "string",
             "enum": [
              "cover",
              "maxHours",
              "onePerDay",
              "minRest",
              "availability"
             ]
            },
            "hours": {
             "type": "number",
             "description": "minRest only: hours between shifts"
            }
           },
           "required": [
            "type"
           ]
          },
          "description": "usual set: cover, maxHours, onePerDay, minRest (hours 10), availability"
         },
         "score": {
          "type": "object",
          "properties": {
           "sense": {
            "type": "string",
            "enum": [
             "min"
            ]
           },
           "attr": {
            "type": "string",
            "enum": [
             "wage"
            ]
           },
           "perHour": {
            "type": "boolean"
           }
          },
          "required": [],
          "description": "{sense: min, attr: wage, perHour: true} gives the lowest wage cost"
         },
         "firstWeekday": {
          "type": "integer",
          "minimum": 0,
          "maximum": 6,
          "description": "optional: 0 is Monday"
         }
        },
        "required": [
         "units",
         "slots",
         "rules"
        ]
       },
       "example": {
        "units": [
         {
          "id": "ana",
          "skills": [
           "cook"
          ],
          "wage": 22,
          "maxHours": 40
         },
         {
          "id": "ben",
          "skills": [
           "cook",
           "cashier"
          ],
          "wage": 20,
          "maxHours": 40
         },
         {
          "id": "cal",
          "skills": [
           "cashier"
          ],
          "wage": 18,
          "maxHours": 16
         }
        ],
        "slots": [
         {
          "id": "mon-am",
          "day": 0,
          "start": 8,
          "end": 16,
          "needs": [
           {
            "skill": "cook",
            "count": 1
           },
           {
            "skill": "cashier",
            "count": 1
           }
          ]
         },
         {
          "id": "mon-pm",
          "day": 0,
          "start": 16,
          "end": 22,
          "needs": [
           {
            "skill": "cook",
            "count": 1
           }
          ]
         },
         {
          "id": "tue-am",
          "day": 1,
          "start": 8,
          "end": 16,
          "needs": [
           {
            "skill": "cook",
            "count": 1
           },
           {
            "skill": "cashier",
            "count": 1
           }
          ]
         }
        ],
        "rules": [
         {
          "type": "cover"
         },
         {
          "type": "maxHours"
         },
         {
          "type": "onePerDay"
         },
         {
          "type": "minRest",
          "hours": 10
         }
        ],
        "score": {
         "sense": "min",
         "attr": "wage",
         "perHour": true
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "version": "0.5.1",
         "status": "optimal",
         "objective": 740,
         "gap": 0,
         "stats": {
          "vars": 10,
          "rows": 22,
          "rules": 14,
          "ms": 50
         },
         "assignment": [
          {
           "unit": "ana",
           "slot": "mon-pm",
           "skill": "cook"
          },
          {
           "unit": "ben",
           "slot": "mon-am",
           "skill": "cook"
          },
          {
           "unit": "ben",
           "slot": "tue-am",
           "skill": "cook"
          },
          {
           "unit": "cal",
           "slot": "mon-am",
           "skill": "cashier"
          },
          {
           "unit": "cal",
           "slot": "tue-am",
           "skill": "cashier"
          }
         ],
         "billing": {
          "unit": "roster",
          "count": 1,
          "tier": "le10"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     }
    }
   }
  },
  "/v1/rule-audit": {
   "post": {
    "operationId": "rule_audit",
    "summary": "Tessellate",
    "description": "Checks a rule set or an AI agent's system prompt for rules that contradict each other, can never be met or never apply, and shows each clash with the rules' own words and an example case; proved by a solver. Use when: a user has a policy, rule list or AI agent system prompt and asks whether any rules conflict, can never be met or never apply. Rules are read as obligations (must, must not, never, only); a rule that only gives permission (\"may\") is not checked against others. Not for: SQL validation rules on a table (use sql_rule_relations); whether a reply covered a request (use answer). Price: 10 free jobs per signed-in person, then $0.50 a job plus $0.04 per 1,000 characters of rule text (billing unit chars1k); a key is always needed (https://atomlesslabs.com/pricing/).",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 20000,
          "description": "the rules or system prompt in plain words (send this, or parts and rules)"
         },
         "parts": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "minItems": 1,
          "maxItems": 50,
          "description": "optional instead of text: the facts a rule can test, each {name, type: enum|int|bool, values or min and max}"
         },
         "rules": {
          "type": "array",
          "items": {
           "type": "object"
          },
          "minItems": 1,
          "maxItems": 200,
          "description": "with parts: each {when, then, name?, text?}; no model reads them, so the answer comes faster"
         }
        },
        "required": []
       },
       "example": {
        "text": "A refund over 100 must be approved by a manager. A refund up to 500 must be approved by a clerk. Managers must never approve their own refunds."
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "The answer; or an apiv1 refusal {status, error} (see the schema).",
      "content": {
       "application/json": {
        "schema": {
         "oneOf": [
          {
           "type": "object"
          },
          {
           "type": "object",
           "properties": {
            "status": {
             "type": "integer",
             "description": "401 key, 402 credit, 413 size, 429 site cap, 502/504 host"
            },
            "error": {
             "type": "string"
            }
           },
           "required": [
            "status",
            "error"
           ],
           "description": "apiv1 refusal, sent with HTTP 200"
          }
         ]
        },
        "example": {
         "version": "0.6.1",
         "rules": 3,
         "contradictions": [
          {
           "kind": "pair",
           "rules": [
            {
             "id": "R1",
             "text": "A refund over 100 must be approved by a manager."
            },
            {
             "id": "R2",
             "text": "A refund up to 500 must be approved by a clerk."
            }
           ],
           "example": {
            "approver_role": "clerk",
            "is_self_approval": false,
            "refund_amount": 101
           }
          }
         ],
         "impossible": [],
         "dead": [],
         "unreadable": [],
         "disputed": 2,
         "gaps": 0,
         "recommendations": [
          {
           "for": "contradiction",
           "count": 1,
           "module": "harness:resolve-and-gate",
           "text": "1 set(s) of rules clash. The Harness API can turn them into one agreed rule set and add a gate that refuses the clashing case before your agent acts."
          },
          {
           "for": "disputed",
           "count": 2,
           "module": "harness:rewrite",
           "text": "2 rule or fact reading(s) were not agreed by our models, so they were not checked. The Harness API can rewrite them as checkable rules and turn the rest into logged behaviour checks."
          }
         ],
         "open_questions": 4,
         "questions_found": true,
         "billing": {
          "unit": "chars1k",
          "count": 1
         },
         "job": "0278639f1a0c3f89d899af347fcf6a03"
        }
       }
      }
     },
     "400": {
      "description": "Bad request; never charged.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "error": {}
         },
         "required": [
          "error"
         ],
         "description": "the API's own refusal (bad input), passed through unchanged and never charged"
        }
       }
      }
     },
     "202": {
      "description": "Started (also sent as HTTP 200 with status queued): fetch GET /v1/rule-audit/{job} until the answer has no status queued or running; that answer is the result. Retry-After gives the seconds to wait.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "job": {
           "type": "string",
           "pattern": "^[A-Za-z0-9_-]{6,64}$"
          },
          "status": {
           "type": "string",
           "enum": [
            "queued",
            "running"
           ]
          },
          "billing": {
           "type": "object"
          }
         },
         "required": [
          "job"
         ]
        }
       }
      }
     }
    }
   }
  }
 }
}