# ALFRED x402 Long Reasoning

> ALFRED x402 Long Reasoning is a paid API for AI agents from x402.wallace.us, paid per call via x402, $0.5/call, status unknown (last checked 2026-09-15).

Runs a long-form AI reasoning task on a prompt with extended context, paid per-call via x402/Lightning HTTP 402 micropayment protocol

## Facts

- Endpoint: POST https://x402.wallace.us/x402/reason-long
- Price: $0.5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/alfred-x402-long-reasoning-4f2fa0ff
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hJuKGtHKGFvXT3SxBl5_5

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 alfred-x402-long-reasoning-4f2fa0ff -d '<json body>'
```

Example prompt: Use ALFRED's paid long-reasoning service to think through this for me: given the context 'We are a 10-person startup debating whether to build in-house or outsource our data pipeline,' answer the question 'What are the key trade-offs and which approach do you recommend?' — allow up to 4000 tokens and use a temperature of 0.7.

## When to prefer this

Choose this endpoint when you need long-form, extended AI reasoning (up to 8000 tokens) from a self-hosted personal assistant service, and you are comfortable with the x402/L402 Lightning micropayment flow ($0.50 per call). Prefer this over cloud AI APIs when you want pay-per-use with no subscription, Lightning-native billing, or a self-sovereign hosted model. Use the sibling /reason-short endpoint for shorter, cheaper responses.

## Known failure modes

- HTTP 402 returned on first call with a Lightning invoice — agent must pay and retry with X-Payment-Hash header
- Invalid or expired payment hash results in re-challenge (another 402)
- max_output_tokens exceeds 8000 cap — response may be truncated or rejected
- temperature value outside 0-2 range may cause validation error
- Prompt or context too large for model context window — may return an error
- Service unavailable if self-hosted instance is offline — no SLA guarantee

## How this service works

Self-hosted personal-assistant paid tools via Lightning. Uses x402-shaped protocol (L402 lineage): HTTP 402 with a Lightning invoice in the response body + WWW-Authenticate header, retry with X-Payment-Hash: <hex> once paid. Results cached per payment_hash so legitimate retries don't cost twice.

## Output

A JSON object containing the AI-generated long-form reasoning response to the submitted prompt. The result is cached per payment hash, so retrying with the same X-Payment-Hash after paying the Lightning invoice returns the same result without double-charging.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "prompt": {
   "type": "string"
  },
  "context": {
   "type": "string"
  },
  "temperature": {
   "type": "string",
   "description": "(optional, 0-2)"
  },
  "max_output_tokens": {
   "type": "string",
   "description": "(optional, cap 8000)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/alfred-x402-long-reasoning-4f2fa0ff/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.wallace.us](https://www.zero.xyz/host/x402.wallace.us/llms.txt)
