api.x402ai.dev/api/policy-check
Deterministic pre-flight policy check for AI agent actions, run by a Prolog rule engine (SWI-Prolog), no LLM. POST JSON {profile: baseline or strict, context: {workdir, home, sandboxed}, actions: 1-20 of read, write, delete, exec, network, pay, self_modify}; returns {policy, results, summary, checked_rules}: one verdict per action (allowed, refused, needs_review) with the rules that decided it. Sa
POST
https://api.x402ai.dev/api/policy-checkUptime100% of 3 checks in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://api.x402ai.dev/api/policy-check", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"actions":[{"change":"lower","control":"sandbox","type":"self_modify"}],"context":{"home":"/home/dev","sandboxed":true,"workdir":"/home/dev/project"},"profile":"baseline"}),
});
console.log(await res.json());Example input
{
"actions": [
{
"change": "lower",
"control": "sandbox",
"type": "self_modify"
}
],
"context": {
"home": "/home/dev",
"sandboxed": true,
"workdir": "/home/dev/project"
},
"profile": "baseline"
}More from x402aiProvider status
- api.x402ai.dev/api/askAnswers questions (single-turn question answering) from a small local LLM (qwen3.5 2B). Best for general knowledge, definitions and simple reasoning. POST JSON {"input": string}, up to 3000 characters; returns {answer, model, elapsed_ms}. Answers are brief (2-3 sentences). Typically 5-15 s. Known limits: no web access, no memory between calls, and it can hallucinate or be wrong on recent events an0.04
- api.x402ai.dev/api/embedConvert text into a 768-dimension embedding vector (nomic-embed-text) for semantic search, RAG retrieval, clustering, deduplication or similarity scoring. POST JSON {"input": string}, up to 3000 characters; returns {embedding: number[768], model, dimensions, elapsed_ms}. One text per call; English works best.0.01
- api.x402ai.dev/api/summarizeSummarize a passage of text into a short, concise summary with no preamble (qwen3.5 2B model). Good for condensing articles, emails, logs or documents before passing them to another agent. POST JSON {"input": string}, up to 3000 characters; returns {summary, model, elapsed_ms}. Typically 5-15 s. Small model: may miss nuance in technical or long text. Text only.0.02
