# Streaming LLM Usage Settlement Decision Procedure

> Streaming LLM Usage Settlement Decision Procedure 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-20).

Returns a deterministic decision procedure for deciding when to settle or keep open a streaming LLM session under x402/MPP micro-payment rails

## Facts

- Endpoint: GET https://k2so-8080.on.ascii.dev/api/services/streaming-llm-usage-settlement-decision-procedur?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/streaming-llm-usage-settlement-decision-procedure-ff02eb00
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TK5pJcvZIAURfohkdYrRw

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 streaming-llm-usage-settlement-decision-procedure-ff02eb00
```

Example prompt: I'm running a streaming LLM session over x402 and need to know whether to settle now or keep it open — check the settlement decision procedure for projected cost drift and mid-stream failure retry rules.

## When to prefer this

Use this endpoint when an autonomous agent is managing streaming LLM sessions over x402/MPP micro-payment rails and needs a deterministic, rules-based procedure for deciding when to settle mid-stream versus continuing. Prefer it over ad-hoc cost checks when you need explicit cost drift gating, interruption handling rules, and retry-versus-settle guidance packaged as an agent-readable brief.

## Known failure modes

- Payment not received — endpoint returns 402 requiring x402 payment before content is served
- Invalid or missing query parameters result in a malformed request
- Service unavailable or transient error from the K-2SO provider host
- Topic override not recognized, falling back to default procedure
- Response may be LLM-generated rather than deterministic, reducing reliability

## How this service works

Deterministic decision procedure for settling streaming LLM usage over x402/MPP. Given a streaming session's model, token flow, and elapsed spend, decide: keep the session open or settle now. Uses per-token cost drift gates (settle when projected session cost exceeds budget fraction or observed token rate diverges from quoted price by more than the drift threshold), interruption handling (mid-stream failure refund thresholds and retry-versus-settle rules), real-time cost visibility checks

## Output

A structured decision brief including: whether to keep the session open or settle now, the cost drift gate evaluation, interruption handling rules (refund thresholds and retry-versus-settle logic), real-time cost visibility status, a prose explanation for agents, the generation source (llm/reasoning/deterministic), and an ISO-8601 timestamp.

## 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": "Streaming LLM Usage Settlement Decision Procedure 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": "string"
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/streaming-llm-usage-settlement-decision-procedure-ff02eb00/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)
