---
slug: "x402-storage"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/rawgroundbeef/x402.storage@main/README.md"
repo: "https://github.com/rawgroundbeef/x402.storage"
source_file: "README.md"
branch: "main"
---
# x402.storage

Permanent file storage. One cent.

Upload any file. Pay once. Keep it forever.

## What is this?

x402.storage is a pay-per-use IPFS storage service. Files are stored permanently on IPFS via Filebase, paid for with USDC on Base using the [x402 payment protocol](https://x402.org).

- **No accounts** — Pay directly from your wallet
- **Permanent storage** — Files pinned forever on IPFS
- **One cent per file** — Flat pricing, no subscriptions

## Packages

This monorepo contains three ways to use x402.storage:

### [Website](https://github.com/rawgroundbeef/x402.storage/tree/HEAD/packages/web)

The main web interface at [x402.storage](https://x402.storage). Drag and drop files, pay with an auto-generated wallet, get permanent URLs.

### [CLI](https://github.com/rawgroundbeef/x402.storage/tree/HEAD/packages/cli)

Command-line tool for uploading files:

```bash
npm install -g x402store
x402store myfile.pdf
# https://x402.storage/bafybeig...
```

### [MCP](https://github.com/rawgroundbeef/x402.storage/tree/HEAD/packages/mcp)

Model Context Protocol server for AI agents (Claude Desktop, Claude Code):

```bash
npm install -g x402store-mcp
```

Then configure your AI client to use the `store_file` tool.

### [Claude Code Skill](https://github.com/rawgroundbeef/x402.storage/tree/HEAD/skills/x402storage)

Install the skill for Claude Code:

```bash
npx skills add rawgroundbeef/x402.storage
```

Then use commands like `/x402storage:store <file>` and `/x402storage:resume`.

## Agent Memory

x402.storage uses the `.agent/` directory convention for persistent memory across sessions:

```
.agent/
  x402-storage/
    memory          # Contains the CID of the last stored context
```

### How it works

1. Store context: `/x402storage:store context.json` → saves URL to `.agent/x402-storage/memory`
2. New session: `/x402storage:resume` → reads the CID, fetches your context
3. Continue where you left off

### Team sharing

Commit `.agent/x402-storage/memory` to git. Teammates run `/x402storage:resume` to fetch shared context.

### Convention for other tools

The `.agent/` directory is a proposed convention for agent tooling. Other tools can use `.agent/<tool-name>/` for their own persistent storage, enabling interoperability across the agent ecosystem.

## Development

```bash
# Install dependencies
npm install

# Run website locally
npm run dev

# Build all packages
npm run build
```

## How it works

1. You upload a file
2. API returns a 402 Payment Required with price ($0.01)
3. Your wallet signs a payment authorization
4. API verifies payment, uploads to IPFS, settles payment
5. You get a permanent URL

The x402 protocol handles payment negotiation automatically — no manual transaction signing needed.

## Cost

$0.01 USDC per file, regardless of size (up to 10MB). Files are stored permanently.

## License

MIT
