# Inferrail Credits Purchase via x402

> Inferrail Credits Purchase via x402 is a paid API for AI agents from inferrail-cost-gateway.onrender.com, paid per call via x402, $1/call, status unknown (last checked 2026-11-03).

Purchase governed LLM-run credits for an Inferrail workspace using USDC payment over the x402 protocol, enforcing a shared budget across parallel agents

## Facts

- Endpoint: POST https://inferrail-cost-gateway.onrender.com/hosted/v1/credits/x402?utm_source=zero.xyz
- Price: $1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-03
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/inferrail-credits-purchase-via-x402-b7699e8c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_D5vIU7YkRpKorVmV_efDO

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 inferrail-credits-purchase-via-x402-b7699e8c -d '<json body>'
```

Example prompt: Top up my Inferrail workspace with a $1 USDC payment over x402 so my parallel agents have governed run credits and can't blow past the shared budget.

## When to prefer this

Choose this endpoint when you need to pre-fund a shared LLM cost budget for a workspace where multiple parallel agents or processes must operate under a hard spending cap. It is the correct choice when paying with USDC via the x402 protocol for Inferrail governed runs, and when you want atomic budget reservation before each LLM provider call rather than post-hoc billing. Prefer over generic LLM API top-ups when cost governance across concurrent agents is the primary requirement.

## Known failure modes

- Payment not received or x402 header missing — results in 402 Payment Required with no credits allocated
- Invalid or non-existent workspace_id — credits cannot be applied and request fails
- Insufficient USDC balance in payer wallet — transaction not completed
- Malformed request body (missing required fields: type, method, bodyType, body) — 400 Bad Request
- Network or provider outage on Render-hosted service — 503 or timeout with no state change

## How this service works

Paid services for AI agents over x402 on Base and MPP on Tempo. Inferrail Web Read: one public web page as clean markdown, $0.002 per delivered page, refusals and target-site errors never charged, a retry never pays twice. Inferrail Hosted: one dollar budget shared by every agent and process using a workspace key (250 governed runs a month free, then $0.001/run in x402 credits).

## Output

Returns a JSON object confirming payment settlement, including the workspace_id credited, the number of governed_runs added (e.g. 1000), a payment_ref identifying the on-chain transaction (payer address and nonce), a status of 'settled', and a 'next' hint pointing to GET /v1/workspace to verify the credit balance.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST",
      "PUT",
      "PATCH"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "workspace_id",
      "governed_runs",
      "status"
     ],
     "properties": {
      "next": {
       "type": "string"
      },
      "status": {
       "enum": [
        "settled"
       ],
       "type": "string"
      },
      "payment_ref": {
       "type": "string"
      },
      "workspace_id": {
       "type": "string"
      },
      "governed_runs": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "next": "Credits are in GET https://inferrail-cost-gateway.onrender.com/hosted/v1/workspace.",
  "status": "settled",
  "payment_ref": "0xpayer:0xnonce",
  "workspace_id": "ws_0123456789abcdef0123",
  "governed_runs": 1000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/inferrail-credits-purchase-via-x402-b7699e8c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from inferrail-cost-gateway.onrender.com](https://www.zero.xyz/host/inferrail-cost-gateway.onrender.com/llms.txt)
