# Agent-Side x402 Cost Evaluation and Payment Runtime Decision Procedure

> Agent-Side x402 Cost Evaluation and Payment Runtime Decision Procedure is a paid API for AI agents from k2so.wrong.systems, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Returns a plain-prose decision procedure brief helping AI agents evaluate whether a given x402 per-call cost is justified and how to gate payments at runtime.

## Facts

- Endpoint: GET https://k2so.wrong.systems/api/services/agent-side-cost-evaluation-and-payment-runtime-d
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-side-x402-cost-evaluation-and-payment-runtime-decision-procedure-b151cc36
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bjw1lCbRmxb-A04qj5KZw

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-payment-runtime-decision-procedure-b151cc36
```

Example prompt: Give me the decision procedure my agent should follow when evaluating whether a $0.002 x402 API call is worth paying at runtime — I want the full prose brief on cost evaluation and payment gating.

## When to prefer this

Choose this endpoint when an AI agent needs a structured, plain-language decision procedure specifically for evaluating whether x402 per-request micropayments are cost-justified at runtime. It is purpose-built for autonomous agent payment gating on Base/USDC and produces a prose brief directly consumable by another agent, unlike generic cost-analysis tools or static documentation.

## Known failure modes

- HTTP 402 returned if payment has not been settled — agent must pay exact USDC amount and retry with PAYMENT-SIGNATURE header
- Invalid or missing method enum causes request rejection
- Topic override ignored if format is invalid
- Service may return ok:false in result if the handler fails internally
- Stale or deterministic briefs may be returned depending on generation source

## 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 JSON object containing a plain-prose decision procedure brief (120+ words) advising the AI agent on how to evaluate x402 per-call costs and gate payments, along with the model used, topic, service slug, ISO-8601 generation timestamp, and generation source (llm, reasoning, or deterministic).

## 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)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "paid": true,
  "result": {
   "ok": true,
   "brief": "plain prose decision procedure (120+ words)",
   "model": "deepseek/deepseek-v4-flash-0731",
   "topic": "string topic",
   "service": "agent-side-cost-evaluation-and-payment-runtime-d",
   "procedure": "same as brief",
   "generatedAt": "2026-01-01T00:00:00.000Z",
   "generationSource": "deterministic"
  },
  "service": "agent-side-cost-evaluation-and-payment-runtime-d",
  "provider": "K-2SO"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-side-x402-cost-evaluation-and-payment-runtime-decision-procedure-b151cc36/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from k2so.wrong.systems](https://www.zero.xyz/host/k2so.wrong.systems/llms.txt)
