← 返回
未分类

image-hosting

Upload images to img402.dev and get a public URL. Three tiers: free (1MB, 7-day, no auth), $0.01 USDC (5MB, 1-year, x402), or $1 USDC (5MB, permanent, x402). Use when the agent needs a hosted image URL — for sharing in messages, embedding in documents, posting to social platforms, or any context that requires a public link to an image file.
Upload images to img402.dev and get a public URL. Three tiers: free (1MB, 7-day, no auth), $0.01 USDC (5MB, 1-year, x402), or $1 USDC (5MB, permanent, x402). Use when the agent needs a hosted image URL — for sharing in messages, embedding in documents, posting to social platforms, or any context that requires a public link to an image file.
yjkj999999
未分类 community v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 18
下载
💾 0
安装
1
版本
#latest

概述

Image Hosting — img402

Upload an image to img402.dev and get a public URL. No account, no API key, no config.

Pick a tier

TierPriceMax sizeRetentionUse when
--------------------------------------------
Free$01 MB7 daysTrying things out, ephemeral sharing, PR review screenshots
1-year$0.01 USDC5 MB1 yearDiagrams, docs, references
Permanent$1.00 USDC5 MBPermanent\*Blog hero images, public docs, brand assets

\* Service-life retention. If img402 ever shuts down, there's a 90-day on-site notice before takedown. See Terms § 2A.

Quick reference

# Upload (multipart)
curl -s -X POST https://img402.dev/api/free -F image=@/path/to/image.png

# Response
# {"url":"https://i.img402.dev/aBcDeFgHiJ.png","id":"aBcDeFgHiJ","contentType":"image/png","sizeBytes":182400,"expiresAt":"2026-02-17T..."}

Workflow

  1. Get image: Use an existing file, or generate/download one.
  2. Check size: Must be under 1MB. If larger, resize:

```bash

sips -Z 1600 /path/to/image.png # macOS — scale longest edge to 1600px

convert /path/to/image.png -resize 1600x1600 /path/to/image.png # ImageMagick

```

  1. Upload:

```bash

curl -s -X POST https://img402.dev/api/free -F image=@/path/to/image.png

```

  1. Use the URL: The url field in the response is a public CDN link. Embed it wherever needed.

Constraints

  • Max size: 1MB
  • Retention: 7 days
  • Formats: PNG, JPEG, GIF, WebP
  • Rate limit: 1,000 free uploads/day (global)
  • No auth required

Paid tiers

When the user needs a longer-lived URL, use the paid flow. Two-step: pay for an upload token via x402, then upload the image with the token.

# Step 1: Get an upload token (requires x402 payment)
POST https://img402.dev/api/upload/token            # $0.01 USDC → 1-year retention
POST https://img402.dev/api/upload/token/permanent  # $1.00 USDC → permanent retention
# → {"token": "a1b2c3...", "expiresAt": "..."}

# Step 2: Upload with the token (same endpoint either way)
curl -s -X POST https://img402.dev/api/upload \
  -H "X-Upload-Token: a1b2c3..." \
  -F image=@/path/to/image.png
# → {"url":"...", "id":"...", "contentType":"...", "sizeBytes":..., "expiresAt":"..."|null}

For permanent uploads the response has expiresAt: null. Same flow otherwise.

x402 payment is handled by an x402-capable client (the Payments MCP tool, @x402/client, or any other). The client handles the 402 challenge, signs the on-chain payment, and retries automatically. See https://img402.dev/blog/paying-x402-apis for details.

版本历史

共 1 个版本

  • v1.0.0 从ClawHub迁移发布 当前
    2026-06-07 11:14 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,521 📥 579,634
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 869 📥 348,503
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,170 📥 941,974