# Agent402 Grounded Chat Completions

> Agent402 Grounded Chat Completions is a paid API for AI agents from agent402.tools, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-15).

Answers chat prompts using an LLM grounded in live Exa web search results, returning cited responses with url_citation annotations for $0.03 USDC per call

## Facts

- Endpoint: POST https://agent402.tools/v1/grounded/chat/completions
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-grounded-chat-completions-31913801
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FBiqqiM26E0cIbxh7PsIR

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 agent402-grounded-chat-completions-31913801 -d '<json body>'
```

Example prompt: Search the web and give me a grounded, cited answer: what are the latest developments in fusion energy research as of this week? Use the balanced quality tier.

## When to prefer this

Choose this endpoint when you need an LLM answer that reflects current, real-world information not in the model's training data — particularly for recent events, live pricing, breaking news, or factual claims requiring citations. It is preferable over a bare chat completion when freshness and source attribution matter, and over a raw search API when you want a synthesized, readable answer rather than raw results. The flat $0.03 USDC pay-per-call model with no signup makes it ideal for agents that need occasional grounded queries without committing to a subscription.

## Known failure modes

- Payment not received or insufficient USDC balance — request rejected with 402 status
- Exa search returns no relevant results — model answers from parametric knowledge without web grounding
- max_tokens clamped to tier maximum if exceeded — response may be truncated
- Invalid messages format (non-array or missing role/content) — 400 error
- Explicit model requested that is unavailable or outside auto tier caps — may fall back to auto routing or error

## How this service works

OpenAI-compatible chat completions GROUNDED in a live web search on every call: the gateway runs an Exa search (up to 5 results) for the prompt, hands the results to the model, and returns the answer with url_citation annotations - $0.03 per call in USDC, no API key, no signup. Model is chosen server-side like the auto tier (omit "model" or send "auto"; explicit ranked models accepted); the response adds agent402_router {category, quality, served}.

## Output

An OpenAI-compatible chat completion response where the assistant's message is grounded in up to 5 live Exa web search results. The response includes url_citation annotations linking claims to source URLs, and an agent402_router metadata block containing the routing category, quality band used, and the model that served the request.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "model": {
   "type": "string",
   "description": "Optional - omit (or send \"auto\") for eval-ranked server-side routing. An explicit model from the auto ranking is honored at the auto caps."
  },
  "quality": {
   "type": "string",
   "description": "Optional routing band when the gateway picks the model: \"fast\" (cheapest/snappiest), \"balanced\" (default), \"best\" (strongest under the flat price). Never changes the price."
  },
  "messages": {
   "type": "array",
   "description": "OpenAI chat messages: [{role, content}] - text and image_url content blocks supported"
  },
  "max_tokens": {
   "type": "number",
   "description": "Output token cap (clamped to the tier maximum)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "gen-…",
  "model": "openai/gpt-4o-mini",
  "usage": {
   "total_tokens": 13,
   "prompt_tokens": 12,
   "completion_tokens": 1
  },
  "object": "chat.completion",
  "choices": [
   {
    "index": 0,
    "message": {
     "role": "assistant",
     "content": "OK"
    },
    "finish_reason": "stop"
   }
  ],
  "created": 1750000000,
  "agent402_router": {
   "served": "openai/gpt-4o-mini",
   "quality": "balanced",
   "category": "general"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-grounded-chat-completions-31913801/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
