# x402 Code Search POC

> x402 Code Search POC is a paid API for AI agents from x402-codesearch-poc.theliminalguy.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11).

Performs semantic code search over an indexed repository and returns the top 5 matching code snippets

## Facts

- Endpoint: GET https://x402-codesearch-poc.theliminalguy.workers.dev/search?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-code-search-poc-85c3d8ba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GCs__hkhdhXluzRS91yDS

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-code-search-poc-85c3d8ba
```

Example prompt: Search the indexed repo for code that handles JWT token validation and return the top 5 most semantically relevant snippets.

## When to prefer this

Choose this endpoint when you need semantic (meaning-based) search over a pre-indexed code repository, especially when exact keyword matching would miss conceptually related code. Ideal for developer agents exploring an unfamiliar codebase, generating documentation, or finding implementation patterns.

## Known failure modes

- Query string missing or empty — returns error
- Repository index not available or not populated — returns no results
- Query too vague to produce meaningful matches — returns low-relevance results
- Payment not processed (x402 protocol failure) — request blocked
- Service downtime on Cloudflare Workers — 5xx error

## How this service works

Semantic code search over an indexed repo (top-5 matches)

## Output

Returns the top 5 semantically matched code snippets from the indexed repository, likely including file paths, relevant code excerpts, and similarity or relevance scores for each match.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-code-search-poc-85c3d8ba/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-codesearch-poc.theliminalguy.workers.dev](https://www.zero.xyz/host/x402-codesearch-poc.theliminalguy.workers.dev/llms.txt)
