# MemoryAPI Document Upload

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

Uploads a document (e.g. PDF) to MemoryAPI for persistent semantic storage and later searchable retrieval, returning a document ID and chunk count.

## Facts

- Endpoint: POST https://api.memoryapi.org/x402/docs/upload
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/memoryapi-document-upload-50bedf1c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_w6abvkdEFq4RO8MCTrdV8

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-document-upload-50bedf1c -d '<json body>'
```

Example prompt: Upload this contract PDF called 'contract.pdf' to MemoryAPI so I can search it semantically later — store it in my persistent memory index.

## When to prefer this

Use this endpoint when an AI agent needs to persist a document into MemoryAPI's semantic index so it can be searched or retrieved later via natural language queries. Prefer this over generic file storage when the goal is downstream semantic search or RAG-style retrieval within the MemoryAPI ecosystem. Best for agents that pay per query in USDC on Base mainnet via the x402 protocol and need MCP-compatible persistent memory.

## Known failure modes

- Invalid or unsupported file format — upload rejected
- File too large — chunking or size limit exceeded
- Payment failure — insufficient USDC balance or x402 payment not accepted
- Malformed request body — missing file or filename field
- Network timeout during upload of large document
- Authentication or payment header missing, resulting in 402 Payment Required

## 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 confirming success, the assigned document UUID, the original filename, and the number of semantic chunks the document was split into (e.g. {success: true, document: {id: 'uuid', filename: 'contract.pdf', chunk_count: 12}}).

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "example": {
  "success": true,
  "document": {
   "id": "uuid",
   "filename": "contract.pdf",
   "chunk_count": 12
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/memoryapi-document-upload-50bedf1c/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)
