# XFuel Paid Inference via x402

> XFuel Paid Inference via x402 is a paid API for AI agents from api.xfuel.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-18).

Runs a paid AI inference task on Base mainnet USDC via the x402 payment protocol, returning a signed receipt and verification URL

## Facts

- Endpoint: POST https://api.xfuel.app/task-request?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/xfuel-paid-inference-via-x402-e240cf7e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ExAYonuihY7QeeG_TE2Mc

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 xfuel-paid-inference-via-x402-e240cf7e -d '<json body>'
```

Example prompt: Send a paid inference request to XFuel using xfuel/auto model with my wallet 0xAbC...123 on Base mainnet, paying $0.01 USDC, with these messages: system says 'you are a helpful assistant' and user asks 'What is the capital of France?' — limit the response to 200 tokens.

## When to prefer this

Choose this endpoint when you need verifiable, pay-per-call AI inference with on-chain USDC payment receipts on Base mainnet via the x402 protocol — especially in autonomous agent pipelines where auditability, micropayment receipts, and crypto-native payment rails matter. Prefer this over free or subscription-based LLM APIs when you need signed proof of payment, when operating in a trustless or multi-agent environment, or when the calling agent holds USDC and needs to avoid API key management.

## Known failure modes

- Insufficient USDC balance or allowance causes payment rejection
- Invalid or non-checksummed sender address returns 400 error
- Unsupported model_id returns model-not-found error
- Amount below minimum (10000 base units / $0.01) is rejected
- Wrong chain_id value causes settlement failure
- Malformed messages array (missing role or content) causes validation error
- Network congestion on Base may delay payment settlement
- Rate limiting if too many requests are sent in quick succession

## How this service works

OpenAI-compatible paid inference via x402 USDC on Base and Solana ($0.01). POST /v1/chat/completions is the recommended surface. Returns signed receipt + public verify_url. Paying this host is real mainnet USDC.

## Output

Returns a signed receipt confirming the USDC payment on Base mainnet, a verify_url for on-chain payment verification, and the AI-generated inference output from the selected model.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "amount": {
   "type": "string",
   "description": "Gross task value in USDC base units (6 decimals)"
  },
  "sender": {
   "type": "string",
   "description": "0x address that owns/pays for the task"
  },
  "payment": {
   "type": "object",
   "properties": {
    "rail": {
     "enum": [
      "usdc"
     ],
     "type": "string",
     "description": "Payment rail; use \"usdc\""
    }
   }
  },
  "chain_id": {
   "type": "string",
   "description": "Settlement chain; \"base\" for USDC settlement"
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "role",
     "content"
    ],
    "properties": {
     "role": {
      "enum": [
       "system",
       "user",
       "assistant"
      ],
      "type": "string"
     },
     "content": {
      "type": "string"
     }
    }
   },
   "description": "OpenAI-style chat messages array"
  },
  "model_id": {
   "type": "string",
   "description": "Model id from GET /v1/models; xfuel/auto routes automatically"
  },
  "input_hash": {
   "type": "string",
   "description": "keccak256 of your input (optional; for proof binding)"
  },
  "max_tokens": {
   "type": "integer",
   "description": "Output token budget (default 500)"
  },
  "message_type": {
   "enum": [
    "inference_request"
   ],
   "type": "string",
   "description": "Task type; only inference_request is supported via x402"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "accepted",
  "task_id": "ai-task-12345",
  "fee_amount": "250",
  "net_amount": "49750",
  "verify_url": "https://api.xfuel.app/receipt/ai-task-12345",
  "payment_ref": "base:0x...",
  "gross_amount": "50000",
  "payment_rail": "usdc"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/xfuel-paid-inference-via-x402-e240cf7e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.xfuel.app](https://www.zero.xyz/host/api.xfuel.app/llms.txt)
