# Nomos Budget Check API

> Nomos Budget Check API is a paid API for AI agents from base-agent-preflight.bytoken2023.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Validates whether an autonomous agent has sufficient budget and authorization to proceed with a requested spend, returning a risk assessment and approval decision.

## Facts

- Endpoint: POST https://base-agent-preflight.bytoken2023.workers.dev/x402/v1/policy/budget-check
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nomos-budget-check-api-b395ebe8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gjCtN8PxAUXHSsFZLjU41

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 nomos-budget-check-api-b395ebe8 -d '<json body>'
```

Example prompt: Before my agent 'trading-bot-42' executes this purchase, run a budget-check: it's requesting 5.00 USDC for purpose 'market:buy', has 120.00 USDC remaining, and a per-transaction limit of 10.00 USDC — flag it if risk is anything above low.

## When to prefer this

Use this endpoint when an autonomous agent needs a lightweight, pay-per-use preflight authorization check before executing a financial transaction, particularly when enforcing per-transaction limits, remaining budget constraints, and risk thresholds in USDC/USDT/USD. Prefer this over static rule engines when you need a dynamic risk score with flag-level detail. Best suited for agentic systems on Base/EVM chains already integrated with x402 payment infrastructure.

## Known failure modes

- Missing required query parameters (agent_id, currency, requested_amount, remaining_budget, per_transaction_limit, purpose) returns a 400 validation error
- Invalid parameter format (e.g. agent_id with special characters, non-numeric amount) rejected by pattern validation
- Payment of $0.02 USDC not received results in 402 Payment Required response
- Idempotency key collision may return cached prior decision rather than fresh evaluation
- Requested amount exceeding per_transaction_limit returns high risk or DENY flag
- Service unavailability on Cloudflare Workers edge returns 503

## How this service works

Machine-payable service intelligence for discovering, verifying, and monitoring identity, risk, authorization, execution-preflight, and evidence APIs before autonomous agents spend.

## Output

Returns a JSON object containing a risk_score (numeric), risk_level (e.g. 'low', 'medium', 'high'), a flags array listing any policy violations or concerns, and metadata including the product name and network identifier (e.g. 'eip155:8453' for Base). If the request exceeds the auto_approval_threshold or per_transaction_limit, the assessment will indicate a REVIEW or DENY decision.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "agent_id",
      "currency",
      "requested_amount",
      "remaining_budget",
      "per_transaction_limit",
      "purpose"
     ],
     "properties": {
      "purpose": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._:-]{2,120}$",
       "description": "Purpose code for the requested spend."
      },
      "agent_id": {
       "type": "string",
       "pattern": "^[A-Za-z0-9._:-]{1,128}$",
       "description": "Caller-defined agent or principal id."
      },
      "currency": {
       "enum": [
        "USDC",
        "USDT",
        "USD"
       ],
       "type": "string",
       "description": "Policy currency."
      },
      "idempotency_key": {
       "type": "string",
       "maxLength": 128,
       "description": "Optional idempotency key for deterministic decision replay."
      },
      "remaining_budget": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Remaining budget available to this agent."
      },
      "requested_amount": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Requested spend amount."
      },
      "per_transaction_limit": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Maximum amount allowed in one transaction."
      },
      "auto_approval_threshold": {
       "type": "string",
       "pattern": "^[0-9]+(?:\\.[0-9]{1,6})?$",
       "description": "Optional amount above which REVIEW is required even when budget fits."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "network": {
       "type": "string"
      },
      "product": {
       "type": "string"
      },
      "activity": {
       "type": "object"
      },
      "identity": {
       "type": "object"
      },
      "assessment": {
       "type": "object"
      }
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "network": "eip155:8453",
  "product": "nomos-budget-check",
  "assessment": {
   "flags": [],
   "risk_level": "low",
   "risk_score": 0
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nomos-budget-check-api-b395ebe8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from base-agent-preflight.bytoken2023.workers.dev](https://www.zero.xyz/host/base-agent-preflight.bytoken2023.workers.dev/llms.txt)
