# x402AI Ask Endpoint

> x402AI Ask Endpoint is a paid API for AI agents from api.x402ai.dev, paid per call via x402, $0.04/call, status unknown (last checked 2026-10-02).

Answers a natural language question via AI inference, gated by a $0.04 USDC micropayment on Base mainnet using the x402 protocol.

## Facts

- Endpoint: POST https://api.x402ai.dev/api/ask?utm_source=zero.xyz
- Price: $0.04/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402ai-ask-endpoint-afa81156
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sZqocQSegvCFFstuC4xyF

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 x402ai-ask-endpoint-afa81156 -d '<json body>'
```

Example prompt: Ask the x402AI service: what are the main differences between proof-of-work and proof-of-stake consensus mechanisms? I'm happy to pay the 4-cent USDC fee per query.

## When to prefer this

Choose this endpoint when you need pay-per-query AI inference without a subscription, specifically within an agent or application that already handles x402 micropayment flows on Base mainnet. Ideal for autonomous agents that should pay for knowledge lookups on-chain with USDC, or for developers building crypto-native apps that want metered AI access at $0.04 per call.

## Known failure modes

- Payment failure: insufficient USDC balance or x402 payment not accepted, resulting in 402 Payment Required response
- Invalid input: missing or empty 'input' field returns a validation error
- Inference timeout: AI model takes too long and returns a timeout or 500 error
- Network/mainnet issues: Base mainnet congestion or RPC errors causing payment verification failure
- Malformed request: non-string input type causes schema validation error

## How this service works

Single-turn question answering from a small local LLM (qwen3.5 2B). Best for general knowledge, definitions and simple reasoning. POST JSON {"input": string}, up to 3000 characters; returns {answer, model, elapsed_ms}. Answers are brief (2-3 sentences). Typically 5-15 s. Known limits: no web access, no memory between calls, and it can hallucinate or be wrong on recent events and obscure facts. Verify anything important.

## Output

Returns a JSON object with an 'answer' field containing the AI-generated text response to the submitted question.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "string",
   "description": "Question to ask"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "answer"
 ],
 "properties": {
  "answer": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402ai-ask-endpoint-afa81156/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402ai.dev](https://www.zero.xyz/host/api.x402ai.dev/llms.txt)
