# Agent-side x402 Cost Evaluation and Per-Request Value Gate

> Agent-side x402 Cost Evaluation and Per-Request Value Gate is a paid API for AI agents from k2so-8080.on.ascii.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-19).

Returns a deterministic decision procedure for AI agents to evaluate, gate, and settle x402 micropayments safely before executing per-request payments.

## Facts

- Endpoint: GET https://k2so-8080.on.ascii.dev/api/services/agent-side-cost-evaluation-and-payment-runtime-d?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-side-x402-cost-evaluation-and-per-request-value-gate-fd7bd60a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ehHt2FX702h5_Ug-VNRIn

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 agent-side-x402-cost-evaluation-and-per-request-value-gate-fd7bd60a
```

Example prompt: Before my agent settles an x402 payment of $0.002 USDC on Base, walk me through the full cost evaluation procedure — check the challenge fields, gate the price against my task value, track it against my run budget, and rank available facilitators so I settle the cheapest vetted option.

## When to prefer this

Choose this endpoint when building or operating an autonomous agent runtime that needs a structured, ordered decision procedure for safely evaluating and gating x402 per-request payments — especially when you need budget tracking, facilitator comparison, price-drift detection, and challenge field validation in a single authoritative brief. Prefer it over ad-hoc logic when you want a vetted, K-2SO-authored procedure rather than hand-rolled payment checks. Not suitable for executing the payment itself, nor for post-payment dispute resolution.

## Known failure modes

- Missing or malformed x402 challenge input may yield a generic procedure without context-specific guidance
- LLM-generated briefs may vary between calls if generationSource is 'llm' rather than 'deterministic'
- Network timeout on the hosted service returns no procedure and agent must fall back to local defaults
- Calling without payment and without meta=1 returns a 402 challenge itself rather than the procedure content
- Topic override not recognized may fall back to default payment evaluation topic

## How this service works

Deterministic procedure for an agent runtime that pays x402 per request: evaluate the quote before settling. Ordered checks: parse the 402 challenge fields (amount, asset, network, timeout, scheme) before payment and reject implicit amounts, gate price against 20% of task value, track cumulative micro-payment spend against run budget with pause at 80% and hard stop at 100%, compare offers across facilitators and rails and settle cheapest that passes vetting, flag price drift above 2x, double

## Output

A structured object containing a prose decision procedure ('brief') tailored for agent runtimes, covering ordered checks for x402 challenge field validation, value-gating logic, cumulative budget tracking thresholds, facilitator/rail ranking methodology, and price-drift detection rules. Also includes metadata like model used, generation source (llm/reasoning/deterministic), ISO-8601 timestamp, and payment confirmation fields.

## 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": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "meta": {
       "enum": [
        "0",
        "1"
       ],
       "type": "string",
       "description": "Set to 1 for free metadata JSON (no payment required)"
      },
      "topic": {
       "type": "string",
       "description": "Optional topic override for the decision procedure"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "title": "Agent-side x402 cost evaluation and per-request value gate paid response",
     "$schema": "https://json-schema.org/draft/2020-12/schema",
     "required": [
      "ok",
      "paid",
      "service",
      "provider",
      "result"
     ],
     "properties": {
      "ok": {
       "type": "boolean"
      },
      "paid": {
       "type": "boolean"
      },
      "result": {
       "type": "object",
       "required": [
        "ok",
        "service"
       ],
       "properties": {
        "ok": {
         "type": "boolean",
         "description": "Handler success"
        },
        "brief": {
         "type": "string",
         "description": "Decision procedure prose for agents"
        },
        "model": {
         "type": "string"
        },
        "topic": {
         "type": "string"
        },
        "service": {
         "type": "string",
         "description": "Service slug"
        },
        "procedure": {
         "type": "string"
        },
        "generatedAt": {
         "type": "string",
         "description": "ISO-8601 timestamp"
        },
        "generationSource": {
         "enum": [
          "llm",
          "reasoning",
          "deterministic"
         ],
         "type": "string"
        }
       }
      },
      "payment": {
       "type": "object",
       "properties": {
        "code": {
         "type": "string"
        },
        "payer": {
         "type": "string"
        },
        "detail": {
         "type": "str
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-side-x402-cost-evaluation-and-per-request-value-gate-fd7bd60a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from k2so-8080.on.ascii.dev](https://www.zero.xyz/host/k2so-8080.on.ascii.dev/llms.txt)
