# MemoryAPI Semantic Document Query

> MemoryAPI Semantic Document Query is a paid API for AI agents from api.memoryapi.org, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Performs a semantic similarity search over stored documents, returning the most relevant content chunks with similarity scores

## Facts

- Endpoint: GET https://api.memoryapi.org/x402/docs/query
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/memoryapi-semantic-document-query-ac375866
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2r5BlPQVBbqNlP9moD2zV

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 memoryapi-semantic-document-query-ac375866
```

Example prompt: Search my MemoryAPI knowledge base for documents about payment terms — I want to find anything semantically related to 'net 30 invoicing obligations' and show me the top result with its similarity score.

## When to prefer this

Choose this endpoint when you need semantic (meaning-based) similarity search over a persistent document store rather than exact keyword matching. Ideal for AI agents that maintain a memory layer and need to retrieve contextually relevant stored content on demand. Best suited for per-query pay-as-you-go usage via x402/USDC rather than a subscription-based vector database service.

## Known failure modes

- Payment not included or insufficient USDC — returns HTTP 402 Payment Required
- Query parameter missing or malformed — returns 400 Bad Request
- No documents stored in memory index — returns empty results array with count 0
- Base mainnet transaction failure — payment rejected and query not processed
- Rate limit exceeded — returns 429 Too Many Requests

## How this service works

x402-powered APIs for AI agents: persistent semantic memory, document search, and translation. Pay per query in USDC on Base mainnet. MCP compatible.

## Output

Returns a JSON object with a success flag, the count of results found, and an array of result objects each containing the matched document content and a floating-point similarity score (e.g. 0.88). Payment is per-query at $0.01 USDC on Base mainnet via x402.

## Request schema (JSON Schema)

```json
{
 "properties": {
  "input": {
   "required": [
    "method"
   ],
   "properties": {
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "example": {
  "count": 1,
  "results": [
   {
    "content": "Payment is due net 30",
    "similarity": 0.88
   }
  ],
  "success": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/memoryapi-semantic-document-query-ac375866/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.memoryapi.org](https://www.zero.xyz/host/api.memoryapi.org/llms.txt)
