← APIs / Trust Checks
Verified

Trust Checks

Apiosk Basicsby Apiosk Basics · General

Five deterministic pre-flight guardrails an AI agent buys per call before it commits an action or output: schema/type validation, money math, spend-policy enforcement, factual grounding and brand compliance. Each returns a clean pass/fail with reasons.

aiapi
Price per request
$0.08
About

Trust Checks gives an autonomous agent a cheap, stateless way to verify itself before it acts. Each of the five endpoints takes the agent's proposed output plus the constraints to check it against, and returns a structured pass/fail it can branch on: /schema confirms a structured output has the required fields and correct types; /calculate independently re-computes order/invoice math (gross, fees, net) so totals can't drift; /policy checks an intended action — vendor, amount, category — against allow/block lists and a spend cap before money moves; /knowledge checks an answer against a list of approved facts and forbidden claims to catch ungrounded or off-limits statements; /brand checks copy against forbidden words, required terms and preferred-term substitutions. All endpoints are deterministic, stateless POSTs metered per call via x402 — the caller authenticates by payment (X-Payment header) and needs no API key of its own.

Base URL
https://gateway.apiosk.com/trust-checks
Technical Specs
Auth Methodx402
Response FormatJSON
Endpoints5
Endpoints
MethodPathDescriptionCost
POST /brand Check copy against brand rules: forbidden words/phrases, required terms that must appear, and preferred-term substitutions. Returns issues for violations plus suggested from->to replacements.
$0.08 default
View details
POST /calculate Independently re-compute order/invoice math from line items and optional fees, returning gross, fee and net so an agent's own totals can be verified against a trusted calculation.
$0.08 default
View details
POST /knowledge Check a generated answer against a set of approved facts and forbidden claims to catch ungrounded or off-limits statements. Flags forbidden claims found in the answer and warns when the answer matches none of the approved facts.
$0.08 default
View details
POST /policy Check an intended action — vendor, amount and category — against a spend policy (max amount, allowed/blocked vendors, allowed/blocked categories) before money moves. Returns allowed=false with reasons when any rule is violated.
$0.08 default
View details
POST /schema Validate that a structured output contains the required fields and that each field has the expected JSON type. Returns valid=false plus a list of errors when a field is missing or mistyped.
$0.08 default
View details
Endpoint documentation
POST/brand
$0.08 default
Description

Check copy against brand rules: forbidden words/phrases, required terms that must appear, and preferred-term substitutions. Returns issues for violations plus suggested from->to replacements.

Pricing
$0.08 default
Request schema
{
  "properties": {
    "rules": {
      "properties": {
        "forbidden_words": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "preferred_terms": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Map of from-term -> preferred replacement.",
          "type": "object"
        },
        "required_terms": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "text": {
      "description": "The copy to check.",
      "type": "string"
    }
  },
  "required": [
    "text"
  ],
  "type": "object"
}
Response schema
{
  "properties": {
    "endpoint": {
      "type": "string"
    },
    "issues": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "ok": {
      "type": "boolean"
    },
    "suggestions": {
      "items": {
        "properties": {
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "valid": {
      "type": "boolean"
    }
  },
  "type": "object"
}
Example request
{
  "rules": {
    "forbidden_words": [
      "cheap"
    ],
    "preferred_terms": {
      "tool": "platform"
    },
    "required_terms": [
      "Apiosk"
    ]
  },
  "text": "Our cheap tool is the best on the market."
}
Example response
{
  "endpoint": "brand",
  "issues": [
    "Forbidden word or phrase detected: cheap",
    "Required term missing: Apiosk"
  ],
  "ok": true,
  "suggestions": [
    {
      "from": "tool",
      "to": "platform"
    }
  ],
  "valid": false
}
POST/calculate
$0.08 default
Description

Independently re-compute order/invoice math from line items and optional fees, returning gross, fee and net so an agent's own totals can be verified against a trusted calculation.

Pricing
$0.08 default
Request schema
{
  "properties": {
    "fees": {
      "properties": {
        "fixed": {
          "description": "Flat fee subtracted from gross.",
          "type": "number"
        },
        "percentage": {
          "description": "Percentage fee applied to gross, e.g. 2 for 2%.",
          "type": "number"
        }
      },
      "type": "object"
    },
    "line_items": {
      "items": {
        "properties": {
          "quantity": {
            "type": "number"
          },
          "unit_price": {
            "type": "number"
          }
        },
        "required": [
          "unit_price",
          "quantity"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "line_items"
  ],
  "type": "object"
}
Response schema
{
  "properties": {
    "breakdown": {
      "properties": {
        "fixed_fee": {
          "type": "number"
        },
        "percentage_fee": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "endpoint": {
      "type": "string"
    },
    "fee": {
      "type": "number"
    },
    "gross": {
      "type": "number"
    },
    "net": {
      "type": "number"
    },
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    }
  },
  "type": "object"
}
Example request
{
  "fees": {
    "fixed": 0.5,
    "percentage": 2
  },
  "line_items": [
    {
      "quantity": 3,
      "unit_price": 10
    }
  ]
}
Example response
{
  "breakdown": {
    "fixed_fee": 0.5,
    "percentage_fee": 0.6
  },
  "endpoint": "calculate",
  "fee": 1.1,
  "gross": 30,
  "net": 28.9,
  "ok": true,
  "valid": true
}
POST/knowledge
$0.08 default
Description

Check a generated answer against a set of approved facts and forbidden claims to catch ungrounded or off-limits statements. Flags forbidden claims found in the answer and warns when the answer matches none of the approved facts.

Pricing
$0.08 default
Request schema
{
  "properties": {
    "answer": {
      "description": "The agent's generated answer to check.",
      "type": "string"
    },
    "approved_facts": {
      "description": "Facts the answer should be grounded in.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "forbidden_claims": {
      "description": "Claims the answer must not contain.",
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "answer"
  ],
  "type": "object"
}
Response schema
{
  "properties": {
    "endpoint": {
      "type": "string"
    },
    "issues": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "matched_facts": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    }
  },
  "type": "object"
}
Example request
{
  "answer": "Our plan costs 20 dollars per month and includes unlimited seats.",
  "approved_facts": [
    "The plan costs 20 dollars per month"
  ],
  "forbidden_claims": [
    "unlimited seats"
  ]
}
Example response
{
  "endpoint": "knowledge",
  "issues": [
    "Forbidden claim detected: unlimited seats"
  ],
  "matched_facts": [
    "The plan costs 20 dollars per month"
  ],
  "ok": true,
  "valid": false
}
POST/policy
$0.08 default
Description

Check an intended action — vendor, amount and category — against a spend policy (max amount, allowed/blocked vendors, allowed/blocked categories) before money moves. Returns allowed=false with reasons when any rule is violated.

Pricing
$0.08 default
Request schema
{
  "properties": {
    "action": {
      "type": "string"
    },
    "agent_id": {
      "type": "string"
    },
    "amount": {
      "type": "number"
    },
    "category": {
      "type": "string"
    },
    "policy": {
      "properties": {
        "allowed_categories": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "allowed_vendors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "blocked_categories": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "blocked_vendors": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "max_amount": {
          "type": "number"
        }
      },
      "type": "object"
    },
    "vendor": {
      "type": "string"
    }
  },
  "required": [
    "vendor",
    "amount",
    "category"
  ],
  "type": "object"
}
Response schema
{
  "properties": {
    "allowed": {
      "type": "boolean"
    },
    "endpoint": {
      "type": "string"
    },
    "ok": {
      "type": "boolean"
    },
    "reasons": {
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "type": "object"
}
Example request
{
  "amount": 120,
  "category": "saas",
  "policy": {
    "blocked_vendors": [
      "Acme"
    ],
    "max_amount": 100
  },
  "vendor": "Acme"
}
Example response
{
  "allowed": false,
  "endpoint": "policy",
  "ok": true,
  "reasons": [
    "Amount exceeds max_amount of 100",
    "Vendor 'Acme' is blocked"
  ]
}
POST/schema
$0.08 default
Description

Validate that a structured output contains the required fields and that each field has the expected JSON type. Returns valid=false plus a list of errors when a field is missing or mistyped.

Pricing
$0.08 default
Request schema
{
  "properties": {
    "output": {
      "description": "The structured output object to validate.",
      "type": "object"
    },
    "required": {
      "description": "Field names that must be present in output.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "types": {
      "additionalProperties": {
        "enum": [
          "string",
          "number",
          "boolean",
          "object",
          "array"
        ],
        "type": "string"
      },
      "description": "Map of field name -> expected type (string|number|boolean|object|array).",
      "type": "object"
    }
  },
  "required": [
    "output"
  ],
  "type": "object"
}
Response schema
{
  "properties": {
    "endpoint": {
      "type": "string"
    },
    "errors": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "ok": {
      "type": "boolean"
    },
    "valid": {
      "type": "boolean"
    }
  },
  "type": "object"
}
Example request
{
  "output": {
    "in_stock": true,
    "name": "Acme",
    "price": 9.99
  },
  "required": [
    "name",
    "price"
  ],
  "types": {
    "in_stock": "boolean",
    "name": "string",
    "price": "number"
  }
}
Example response
{
  "endpoint": "schema",
  "errors": [],
  "ok": true,
  "valid": true
}