# x402-policy API

> x402-policy API is a paid API for AI agents from x402-api-seven.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-03).

Checks whether an AI agent's spending action is within its configured policy, returning allowance status, trust score, and daily budget utilization.

## Facts

- Endpoint: POST https://x402-api-seven.vercel.app/v1/check?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-policy-api-71d1785a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_K8dsRi4vx6X94K9CUc74T

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 x402-policy-api-71d1785a -d '<json body>'
```

Example prompt: Before you make that $0.001 USDC payment, check whether I'm still within my spending policy — my daily budget is $10 and I want to know my current trust score and how many calls I've made today.

## When to prefer this

Use this endpoint when an AI agent needs to self-govern its spending behavior before executing x402 micropayments on Base Mainnet — especially when enforcing daily budget caps, tracking cumulative spend, or evaluating whether an autonomous agent's trust score meets policy thresholds. Prefer this over generic rate-limiters when the context is USDC micropayments and you need both a binary allow/deny decision and rich telemetry (trust score, daily spend).

## Known failure modes

- Payment not included or invalid x402 payment header — returns 402 Payment Required
- Daily budget exceeded — returns allowed: false with reason explaining limit reached
- Trust score too low — returns allowed: false with reason indicating insufficient trust
- Malformed request body — returns 400 Bad Request
- Network or Vercel cold-start timeout — returns 5xx error

## How this service works

AI agent spending policy via x402 v2 micropayments on Base Mainnet.

## Output

Returns a JSON object with: allowed (boolean indicating if the action is within policy), reason (plain-text explanation), calls_today (integer count of calls made today), trust_score (float 0–1 indicating agent trustworthiness), daily_spent_usd (amount spent today), and daily_budget_usd (the configured daily cap).

## Request schema (JSON Schema)

```json
{
 "type": "object"
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "format": null,
 "example": {
  "reason": "Within policy",
  "allowed": true,
  "calls_today": 24,
  "trust_score": 0.87,
  "daily_spent_usd": 1.23,
  "daily_budget_usd": 10
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-policy-api-71d1785a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-api-seven.vercel.app](https://www.zero.xyz/host/x402-api-seven.vercel.app/llms.txt)
