# rag.gedx402.com AI Search Query

> rag.gedx402.com AI Search Query is a paid API for AI agents from rag.gedx402.com, paid per call via x402, $0.025/call, status unknown (last checked 2026-09-15).

Performs RAG-powered semantic search over an indexed knowledge base, returning ranked text chunks relevant to a natural-language query

## Facts

- Endpoint: GET https://rag.gedx402.com/v1/aisearch/:id/query
- Price: $0.025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/rag-gedx402-com-ai-search-query-7718aabb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qF-hEsnyCIy012DwemrK1

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 rag-gedx402-com-ai-search-query-7718aabb
```

Example prompt: Search the index 'kb-001' for the top 5 most relevant chunks about 'quarterly revenue forecasting best practices' using hybrid retrieval, with reranking enabled.

## When to prefer this

Choose this endpoint when you need pay-per-use RAG search without managing API keys or infrastructure — ideal for agents that need to query a specific pre-indexed knowledge base (identified by :id) using natural language, with optional hybrid/vector/keyword retrieval modes and reranking, paying micro-amounts in USDC on supported chains.

## Known failure modes

- Invalid or non-existent index ID returns 404 or empty results
- Insufficient USDC payment results in 402 Payment Required response
- top_k value outside 1–50 range may return validation error
- Unsupported retrieval_type enum value causes request rejection
- Empty query string with no messages array may return error or zero results
- Network timeout on slow queries with large top_k or reranking enabled

## How this service works

Run Cloudflare AI Search inference on Cloudflare Workers AI (cloudflare-ai-search) via POST JSON. Pay per request with USDC on Base, Polygon, Arbitrum, World, or Solana (x402 v2); see x-payment-info for price bounds and accepted networks.

## Output

A JSON object containing a count of returned chunks and an array of chunk objects, each with an ID, the text content, and a relevance score (0–1). Example: {count: 1, chunks: [{id: 'chunk-1', text: '...', score: 0.9}]}.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string"
  },
  "top_k": {
   "type": "integer"
  },
  "rerank": {
   "type": "boolean"
  },
  "messages": {
   "type": "array",
   "items": {
    "type": "object"
   }
  },
  "rewrite_query": {
   "type": "boolean"
  },
  "session_token": {
   "type": "string"
  },
  "retrieval_type": {
   "enum": [
    "hybrid",
    "vector",
    "keyword"
   ],
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rag-gedx402-com-ai-search-query-7718aabb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rag.gedx402.com](https://www.zero.xyz/host/rag.gedx402.com/llms.txt)
