# gate402 Semantic Vector Cache (Dedup)

> gate402 Semantic Vector Cache (Dedup) is a paid API for AI agents from gate402.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Checks whether a query has been seen before using exact-match lookup then 0.88 cosine similarity on hash embeddings, returning a cache hit or miss in under 10ms.

## Facts

- Endpoint: POST https://gate402.app/v1/dedup
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/gate402-semantic-vector-cache-dedup-c479db18
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_AOoXOa1N1OBlQnwpK3nCj

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 gate402-semantic-vector-cache-dedup-c479db18 -d '<json body>'
```

Example prompt: Before calling the LLM, check the semantic cache to see if 'What is the capital of France?' has been asked before in the 'general-qa' namespace — store the embedding if it's a miss.

## When to prefer this

Choose this endpoint when you need sub-10ms semantic deduplication of text queries before invoking expensive downstream APIs or LLMs. Ideal for agent pipelines that need to short-circuit repeated or paraphrased requests without a full vector database. Prefer this over full vector DB queries when you only need a hit/miss signal with optional storage, and latency is critical.

## Known failure modes

- Missing 'query' field returns a 400 validation error
- Namespace not found may return empty results or auto-create namespace
- Vector dimension mismatch if provided embedding doesn't match stored dimension
- Similarity threshold not met returns a miss even for close paraphrases
- storeOnMiss=true without providing a vector may fail or be ignored
- Rate limit exceeded returns 429
- Payment failure via x402 returns 402

## How this service works

Semantic vector cache: exact-match Map shortcut, then 0.88 cosine similarity on hash embeddings. Sub-10ms hits.

## Output

Returns a cache hit or miss result: on a hit, includes the matched query text and cosine similarity score (>= 0.88); on a miss, optionally stores the provided embedding vector for future lookups. Sub-10ms latency for hits.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "description": "Text to look up"
  },
  "vector": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "description": "Optional embedding to store on miss"
  },
  "namespace": {
   "type": "string"
  },
  "storeOnMiss": {
   "type": "boolean"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/gate402-semantic-vector-cache-dedup-c479db18/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from gate402.app](https://www.zero.xyz/host/gate402.app/llms.txt)
