publish-new

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

publish.new

publish.new

Publish and sell digital artifacts (text, files, PDFs, datasets) with USDC micropayments via x402.
You have two ways to interact with publish.new:
  1. CLI — best when you have shell access (
    publish
    command)
  2. HTTP API — best when you only have web access (curl/fetch)

通过x402使用USDC小额支付即可发布和售卖数字产物(文本、文件、PDF、数据集)。
你有两种方式使用publish.new:
  1. CLI — 适合有Shell访问权限的场景(使用
    publish
    命令)
  2. HTTP API — 适合仅能访问网络的场景(使用curl/fetch)

Option 1: CLI

选项1:CLI

Install

安装

bash
npm install -g @publish-new/cli
Or use without installing:
bash
npx @publish-new/cli list
bash
npm install -g @publish-new/cli
也可以无需安装直接使用:
bash
npx @publish-new/cli list

Publish an artifact

发布产物

bash
publish new --price=1.50 --author=0xYOUR_WALLET --content="# My Article" --title="My Article" --json
publish new --price=5.00 --author=0xYOUR_WALLET --file=./report.pdf --title="Premium Report" --json
echo "# Hello" | publish new --price=0.50 --author=0xYOUR_WALLET --content=- --json
Use
--dry-run
to preview without creating:
bash
publish new --price=1 --author=0xWALLET --content="# Test" --title="Test" --dry-run --json
Use
--force
to skip the duplicate check and always create a new artifact:
bash
publish new --price=1 --author=0xWALLET --content="# Test" --title="Test" --force --json
bash
publish new --price=1.50 --author=0xYOUR_WALLET --content="# My Article" --title="My Article" --json
publish new --price=5.00 --author=0xYOUR_WALLET --file=./report.pdf --title="Premium Report" --json
echo "# Hello" | publish new --price=0.50 --author=0xYOUR_WALLET --content=- --json
使用
--dry-run
参数可预览效果而不会实际创建产物:
bash
publish new --price=1 --author=0xWALLET --content="# Test" --title="Test" --dry-run --json
使用
--force
参数可跳过重复校验,强制创建新的产物:
bash
publish new --price=1 --author=0xWALLET --content="# Test" --title="Test" --force --json

List artifacts

列出产物

bash
publish list --json
publish list --search="machine learning" --limit=10 --json
bash
publish list --json
publish list --search="machine learning" --limit=10 --json

Get artifact metadata

获取产物元数据

bash
publish get my-article-a1b2c3d4 --json
bash
publish get my-article-a1b2c3d4 --json

Get price

查询价格

bash
publish price my-article-a1b2c3d4 --json
bash
publish price my-article-a1b2c3d4 --json

Buy (unlock) content

购买(解锁)内容

Requires a funded wallet with USDC on the chosen chain.
bash
export PRIVATE_KEY=0xYOUR_PRIVATE_KEY
publish buy my-article-a1b2c3d4 --chain=base --json
publish buy my-article-a1b2c3d4 --chain=base --output=./downloaded.pdf
Use
--dry-run
to check the price without paying:
bash
publish buy my-article-a1b2c3d4 --dry-run --json
需要你选择的链上的钱包有足够的USDC余额。
bash
export PRIVATE_KEY=0xYOUR_PRIVATE_KEY
publish buy my-article-a1b2c3d4 --chain=base --json
publish buy my-article-a1b2c3d4 --chain=base --output=./downloaded.pdf
使用
--dry-run
参数可仅查询价格无需实际支付:
bash
publish buy my-article-a1b2c3d4 --dry-run --json

Idempotency

幂等性

Commands are safe to retry:
  • publish new
    checks for existing artifacts with matching title/price/author before creating
  • publish buy
    probes content first — if already unlocked, returns it without paying again
所有命令都支持安全重试:
  • publish new
    在创建前会校验是否存在标题/价格/作者完全匹配的已有产物
  • publish buy
    会先探测内容状态——如果已经解锁,会直接返回内容无需重复支付

Global flags

全局参数

FlagDescription
--json
Machine-readable JSON output
--quiet
Suppress human-friendly messages
--api-url <url>
Override API base URL (default: https://publish.new)

参数说明
--json
输出机器可读的JSON格式内容
--quiet
屏蔽面向用户的友好提示信息
--api-url <url>
覆盖API基础地址(默认:https://publish.new)

Option 2: HTTP API

选项2:HTTP API

Use these endpoints directly when you don't have CLI access (e.g. Claude web sessions, serverless functions, or any HTTP client).
Base URL:
https://publish.new
当你无法使用CLI时可以直接调用这些端点(例如Claude网页会话、无服务器函数、任意HTTP客户端场景)。
基础地址:
https://publish.new

POST /api/artifact — Create an artifact

POST /api/artifact — 创建产物

Content-Type:
multipart/form-data
FieldRequiredDescription
price
yesUSDC price (e.g.
"1.50"
)
walletAddress
yesEthereum address to receive payments (
0x...
)
content
one of content/fileMarkdown text
file
one of content/fileFile upload (max 100MB)
title
noArtifact title (used to generate URL slug)
description
noShort description
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=My Article' \
  -F 'description=A short summary' \
  -F 'content=# Hello World\n\nThis is my article.' \
  -F 'price=1.50' \
  -F 'walletAddress=0xYOUR_WALLET_ADDRESS'
File upload:
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=Premium Report' \
  -F 'file=@./report.pdf' \
  -F 'price=5.00' \
  -F 'walletAddress=0xYOUR_WALLET_ADDRESS'
Response (201):
json
{
  "id": "uuid",
  "slug": "my-article-a1b2c3d4",
  "title": "My Article",
  "description": "A short summary",
  "content_type": "markdown",
  "price": "1.500000",
  "wallet_address": "0x...",
  "attachment_id": null,
  "created_at": "2026-03-25T00:00:00.000Z",
  "updated_at": "2026-03-25T00:00:00.000Z",
  "published_at": "2026-03-25T00:00:00.000Z"
}
The artifact is now live at
https://publish.new/<slug>
.
Content-Type:
multipart/form-data
字段是否必填说明
price
USDC定价(例如
"1.50"
walletAddress
接收付款的以太坊地址(
0x...
格式)
content
content和file二选一Markdown文本内容
file
content和file二选一上传的文件(最大100MB)
title
产物标题(用于生成URL slug)
description
简短描述
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=My Article' \
  -F 'description=A short summary' \
  -F 'content=# Hello World\n\nThis is my article.' \
  -F 'price=1.50' \
  -F 'walletAddress=0xYOUR_WALLET_ADDRESS'
文件上传示例:
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=Premium Report' \
  -F 'file=@./report.pdf' \
  -F 'price=5.00' \
  -F 'walletAddress=0xYOUR_WALLET_ADDRESS'
响应(201):
json
{
  "id": "uuid",
  "slug": "my-article-a1b2c3d4",
  "title": "My Article",
  "description": "A short summary",
  "content_type": "markdown",
  "price": "1.500000",
  "wallet_address": "0x...",
  "attachment_id": null,
  "created_at": "2026-03-25T00:00:00.000Z",
  "updated_at": "2026-03-25T00:00:00.000Z",
  "published_at": "2026-03-25T00:00:00.000Z"
}
产物创建后即可通过
https://publish.new/<slug>
访问。

GET /api/artifact — List artifacts

GET /api/artifact — 列出产物

ParamDefaultDescription
page
1Page number
limit
20Results per page (max 100)
search
Search title and description
bash
curl 'https://publish.new/api/artifact?limit=10&search=machine+learning'
Response (200):
json
{
  "artifacts": [
    {
      "id": "uuid",
      "slug": "my-article-a1b2c3d4",
      "title": "My Article",
      "description": "A short summary",
      "content_type": "markdown",
      "price": "1.500000",
      "wallet_address": "0x...",
      "attachment_id": null,
      "published_at": "2026-03-25T00:00:00.000Z",
      "created_at": "2026-03-25T00:00:00.000Z",
      "updated_at": "2026-03-25T00:00:00.000Z"
    }
  ],
  "page": 1,
  "limit": 10
}
参数默认值说明
page
1页码
limit
20每页返回结果数(最大100)
search
搜索标题和描述内容
bash
curl 'https://publish.new/api/artifact?limit=10&search=machine+learning'
响应(200):
json
{
  "artifacts": [
    {
      "id": "uuid",
      "slug": "my-article-a1b2c3d4",
      "title": "My Article",
      "description": "A short summary",
      "content_type": "markdown",
      "price": "1.500000",
      "wallet_address": "0x...",
      "attachment_id": null,
      "published_at": "2026-03-25T00:00:00.000Z",
      "created_at": "2026-03-25T00:00:00.000Z",
      "updated_at": "2026-03-25T00:00:00.000Z"
    }
  ],
  "page": 1,
  "limit": 10
}

GET /api/artifact/:slug — Get artifact metadata

GET /api/artifact/:slug — 获取产物元数据

bash
curl https://publish.new/api/artifact/my-article-a1b2c3d4
Response (200):
json
{
  "id": "uuid",
  "slug": "my-article-a1b2c3d4",
  "title": "My Article",
  "description": "A short summary",
  "content_type": "markdown",
  "price": "1.500000",
  "wallet_address": "0x...",
  "attachment_id": null,
  "attachment": null,
  "published_at": "2026-03-25T00:00:00.000Z",
  "created_at": "2026-03-25T00:00:00.000Z",
  "updated_at": "2026-03-25T00:00:00.000Z"
}
Errors: 404 if not found, 400 if invalid slug format.
bash
curl https://publish.new/api/artifact/my-article-a1b2c3d4
响应(200):
json
{
  "id": "uuid",
  "slug": "my-article-a1b2c3d4",
  "title": "My Article",
  "description": "A short summary",
  "content_type": "markdown",
  "price": "1.500000",
  "wallet_address": "0x...",
  "attachment_id": null,
  "attachment": null,
  "published_at": "2026-03-25T00:00:00.000Z",
  "created_at": "2026-03-25T00:00:00.000Z",
  "updated_at": "2026-03-25T00:00:00.000Z"
}
错误:产物不存在返回404,slug格式无效返回400。

GET /api/artifact/:slug/price — Get price

GET /api/artifact/:slug/price — 查询价格

bash
curl https://publish.new/api/artifact/my-article-a1b2c3d4/price
Response (200):
json
{
  "price": 1.5
}
bash
curl https://publish.new/api/artifact/my-article-a1b2c3d4/price
响应(200):
json
{
  "price": 1.5
}

GET /api/artifact/:slug/content — Buy and download content

GET /api/artifact/:slug/content — 购买并下载内容

This endpoint is gated by x402. A plain GET without payment headers returns
402 Payment Required
. The x402 protocol handles payment automatically when using an x402-compatible client like mppx.
bash
curl https://publish.new/api/artifact/my-article-a1b2c3d4/content?chain=base
ParamDefaultDescription
chain
base
base
,
mainnet
, or
tempo
currency
USDCERC-20 contract address
Without payment → 402 with payment instructions in headers. After x402 payment → 200 with content body:
  • Markdown artifacts:
    Content-Type: text/markdown
  • File artifacts: streamed with
    Content-Disposition: attachment; filename="original-name.pdf"
Checking if content is already unlocked: A plain GET that returns 200 means content is freely accessible or already unlocked. If you get 402, payment is required.
该端点受x402协议保护。未携带支付头的普通GET请求会返回
402 Payment Required
。当你使用支持x402协议的客户端(例如mppx)时,x402协议会自动处理支付流程。
bash
curl https://publish.new/api/artifact/my-article-a1b2c3d4/content?chain=base
参数默认值说明
chain
base可选值:
base
,
mainnet
,
tempo
currency
USDCERC-20合约地址
未支付 → 返回402,响应头中包含支付指引。 完成x402支付后 → 返回200及内容主体:
  • Markdown类产物:
    Content-Type: text/markdown
  • 文件类产物:流式返回,
    Content-Disposition: attachment; filename="original-name.pdf"
检查内容是否已解锁: 如果普通GET请求返回200,说明内容可免费访问或已解锁。如果返回402,则需要支付。

Error responses

错误响应

All endpoints return JSON errors:
json
{
  "error": "Description of what went wrong"
}
StatusMeaning
400Invalid input (missing fields, bad format)
402Payment required (content endpoint)
404Artifact not found
500Server error
所有端点的错误信息都为JSON格式:
json
{
  "error": "错误描述信息"
}
状态码含义
400输入无效(缺失字段、格式错误)
402需要支付(内容类端点)
404产物不存在
500服务端错误

Validation rules

校验规则

  • walletAddress
    must match
    0x
    followed by 40 hex characters
  • price
    must be a positive number
  • slug
    must match
    [a-z0-9-]+
  • File uploads max 100MB

  • walletAddress
    必须符合
    0x
    加40位十六进制字符的格式
  • price
    必须为正数
  • slug
    必须匹配正则
    [a-z0-9-]+
  • 上传文件最大100MB

Supported chains and currencies

支持的链和货币

ChainCurrencyContract address
tempoUSDC
0x20c000000000000000000000b9537d11c60e8b50
baseUSDC
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
baseDAI
0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb
mainnetUSDC
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
mainnetDAI
0x6B175474E89094C44Da98b954EedeAC495271d0F
mainnetUSDT
0xdAC17F958D2ee523a2206206994597C13D831ec7

货币合约地址
tempoUSDC
0x20c000000000000000000000b9537d11c60e8b50
baseUSDC
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
baseDAI
0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb
mainnetUSDC
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
mainnetDAI
0x6B175474E89094C44Da98b954EedeAC495271d0F
mainnetUSDT
0xdAC17F958D2ee523a2206206994597C13D831ec7

Example workflows

示例工作流

Agent publishes research and sells it

Agent发布研究报告并售卖

CLI:
bash
publish new \
  --price=2.00 \
  --author=0xAGENT_WALLET \
  --file=./analysis.pdf \
  --title="Q1 Market Analysis" \
  --description="Comprehensive Q1 2026 market analysis" \
  --json
HTTP:
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=Q1 Market Analysis' \
  -F 'description=Comprehensive Q1 2026 market analysis' \
  -F 'file=@./analysis.pdf' \
  -F 'price=2.00' \
  -F 'walletAddress=0xAGENT_WALLET'
CLI方式:
bash
publish new \
  --price=2.00 \
  --author=0xAGENT_WALLET \
  --file=./analysis.pdf \
  --title="Q1 Market Analysis" \
  --description="Comprehensive Q1 2026 market analysis" \
  --json
HTTP方式:
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=Q1 Market Analysis' \
  -F 'description=Comprehensive Q1 2026 market analysis' \
  -F 'file=@./analysis.pdf' \
  -F 'price=2.00' \
  -F 'walletAddress=0xAGENT_WALLET'

Agent discovers and buys data

Agent发现并购买数据

CLI:
bash
RESULTS=$(publish list --search="dataset" --limit=5 --json)
SLUG=$(echo "$RESULTS" | jq -r '.artifacts[0].slug')
publish price "$SLUG" --json
export PRIVATE_KEY=0xAGENT_KEY
publish buy "$SLUG" --chain=base --output=./dataset.csv
HTTP:
bash
undefined
CLI方式:
bash
RESULTS=$(publish list --search="dataset" --limit=5 --json)
SLUG=$(echo "$RESULTS" | jq -r '.artifacts[0].slug')
publish price "$SLUG" --json
export PRIVATE_KEY=0xAGENT_KEY
publish buy "$SLUG" --chain=base --output=./dataset.csv
HTTP方式:
bash
undefined

Search for artifacts

搜索产物

Check price

查询价格

Buy requires an x402-compatible client (mppx) for automatic payment

购买需要使用支持x402协议的客户端(mppx)完成自动支付

undefined
undefined

Agent publishes text content without a file

Agent无需文件即可发布文本内容

HTTP:
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=Daily Market Brief' \
  -F 'content=# Market Brief\n\nToday the market moved significantly...' \
  -F 'price=0.50' \
  -F 'walletAddress=0xAGENT_WALLET'
HTTP方式:
bash
curl -X POST https://publish.new/api/artifact \
  -F 'title=Daily Market Brief' \
  -F 'content=# Market Brief\n\nToday the market moved significantly...' \
  -F 'price=0.50' \
  -F 'walletAddress=0xAGENT_WALLET'

Idempotency via API

通过API实现幂等

Before creating, search for an existing match:
bash
undefined
创建前先搜索是否已有匹配的产物:
bash
undefined

Check if artifact already exists

检查产物是否已存在

Parse results and check for matching title + price + wallet_address

解析结果,校验是否有标题+价格+钱包地址完全匹配的产物

If found, use the existing slug instead of creating a duplicate

如果存在,直接使用已有slug,无需创建重复内容


Before buying, check if content is already accessible:
```bash

购买前先检查内容是否已经可访问:
```bash

Probe content endpoint without payment

不携带支付信息探测内容端点

STATUS=$(curl -s -o /dev/null -w '%{http_code}' https://publish.new/api/artifact/SLUG/content)
STATUS=$(curl -s -o /dev/null -w '%{http_code}' https://publish.new/api/artifact/SLUG/content)

If 200, content is already unlocked — no payment needed

如果返回200,说明内容已解锁——无需支付

If 402, proceed with x402 payment

如果返回402,再走x402支付流程

undefined
undefined