# X402 Hub – xAI Query Endpoint

> X402 Hub – xAI Query Endpoint is a paid API for AI agents from x402-hub.vercel.app, paid per call via x402, $0.125/call, status unknown (last checked 2026-10-01).

Sends a natural language query to xAI (Grok) via a micropayment-gated proxy, returning AI-generated responses for $0.125 USDC per call

## Facts

- Endpoint: POST https://x402-hub.vercel.app/api/xai?utm_source=zero.xyz
- Price: $0.125/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-hub-xai-query-endpoint-d365891f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4G5S629mbJBWewMcbrGj1

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 x402-hub-xai-query-endpoint-d365891f -d '<json body>'
```

Example prompt: Ask xAI Grok this question and charge my wallet: 'What are the key differences between transformer and state space models in 2025?'

## When to prefer this

Choose this endpoint when you need pay-per-call access to xAI's Grok model without a subscription, especially in agentic workflows that require on-demand AI inference billed in USDC micropayments via the x402 protocol. Prefer this over subscription-based xAI API access when cost-per-query is more efficient than flat monthly pricing, or when your agent needs to dynamically access multiple AI providers and wants unified x402 payment semantics.

## Known failure modes

- Payment failure if wallet has insufficient USDC balance — returns 402 Payment Required
- Invalid or missing 'query' field returns a 400 Bad Request
- xAI upstream API outage or rate limit may return 502 or 503
- Malformed query string may return empty or low-quality response data
- Network timeout from upstream xAI latency

## How this service works

63 paid API endpoints protected by x402 micropayments on Base

## Output

Returns a structured JSON object with a 'data' field containing the xAI/Grok model's response to the submitted query, including generated text or inference output.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "query"
 ],
 "properties": {
  "query": {
   "type": "string",
   "description": "Query parameter for the API"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "object",
   "description": "Response data from upstream API"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-hub-xai-query-endpoint-d365891f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-hub.vercel.app](https://www.zero.xyz/host/x402-hub.vercel.app/llms.txt)
