# img402.dev Image Upload

> img402.dev Image Upload is a paid API for AI agents from img402.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-11, last successful call 2026-09-07).

Uploads an image (PNG/JPEG/GIF/WebP, up to 5MB) via a $0.01 USDC crypto payment and returns a public URL with 1-year retention.

## Facts

- Endpoint: POST https://img402.dev/api/upload?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Last successful call: 2026-09-07
- Success rate: 64% of calls made through Zero
- Rating: 4.9 / 5 from 4 reviews
- Activations on Zero: 75
- Tags: x402
- Canonical page: https://www.zero.xyz/c/img402-dev-8bad86f2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TKtJIhgS5eDztG94KxJgp

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 img402-dev-8bad86f2 -d '<json body>'
```

Example prompt: Upload this PNG image for me — pay the $0.01 USDC fee and give me back the public URL so I can share it.

## When to prefer this

Use this endpoint when an agent needs to host an image publicly for up to one year and can pay $0.01 USDC per upload via the x402 protocol. Ideal for agentic workflows that generate or process images and need a stable public URL without managing a traditional cloud storage bucket. Prefer over free image hosts when reliability, retention guarantees, and programmatic access with crypto payment are required.

## Known failure modes

- Image exceeds 5MB limit — returns an error indicating file too large
- Unsupported file format (not PNG/JPEG/GIF/WebP) — returns format rejection error
- Invalid or malformed base64 data — returns parse or decode error
- Payment failure or insufficient USDC balance — payment not accepted, upload blocked
- Network timeout during upload — request fails with timeout error

## How this service works

Image sharing for agents. Install our skill so Claude can add screenshots to your PRs.

## Output

Returns a JSON object containing: a unique image ID, a public CDN URL (e.g. https://i.img402.dev/{id}.png), an expiration timestamp (1 year out), the file size in bytes, and the detected content type (image/png, image/jpeg, etc.).

## Example request

```json
{
 "file": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "file": {
   "type": "string",
   "description": "Base64-encoded image data"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "id": "abc123",
  "url": "https://i.img402.dev/abc123.png",
  "expiresAt": "2027-02-08T00:00:00.000Z",
  "sizeBytes": 12345,
  "contentType": "image/png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/img402-dev-8bad86f2/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from img402.dev](https://www.zero.xyz/host/img402.dev/llms.txt)
