# img402.dev Upload Token

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

Pay $0.01 USDC on Base to receive a temporary 10-minute upload token for authenticating image uploads

## Facts

- Endpoint: POST https://img402.dev/api/upload/token
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/img402-dev-e29f59df
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xogjaSAXu-GNnG6mWqyXg

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-e29f59df -d '<json body>'
```

Example prompt: I need to upload an image to img402 — can you pay the $0.01 USDC fee on Base to get me a temporary upload token?

## When to prefer this

Use this endpoint as the first step before uploading an image to img402.dev. It is required to obtain the X-Upload-Token credential that gates the actual upload. Choose this when your workflow involves programmatic image hosting paid with USDC on Base, especially for agentic pipelines that need a crypto-native, permissionless image storage solution with 1-year retention.

## Known failure modes

- Payment not received or insufficient USDC — token not issued
- Payment on wrong network (not Base) — rejected
- Request malformed or missing required fields — 400 error
- Token expires after 10 minutes if not used — must request new token
- Rate limiting or service unavailability — 5xx error

## How this service works

Pay $0.01 USDC to get an upload token for a PERMANENT image (no expiration). Use the returned token to upload via: curl -X POST https://img402.dev/api/upload -H 'X-Upload-Token: TOKEN' -F image=@file.png — The upload returns {url, id, contentType, sizeBytes, expiresAt: null}. Permanent images are retained for the life of the service; if we ever shut down, we will give at least 90 days notice. Supports PNG, JPEG, GIF, WebP up to 10MB. (Images 1MB or under are free AND permanent via POST /api/free — pay only for 1-10MB permanence.)

## Output

Returns a short-lived upload token (valid for 10 minutes) and an ISO 8601 expiration timestamp. The token should be passed as the X-Upload-Token header when making the actual image upload request to img402.dev.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [],
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "token",
      "expiresAt"
     ],
     "properties": {
      "token": {
       "type": "string",
       "description": "Upload token (valid for 10 minutes). Use as X-Upload-Token header when uploading."
      },
      "expiresAt": {
       "type": "string",
       "description": "ISO 8601 token expiration timestamp"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "token": "a1b2c3d4e5f6...",
  "expiresAt": "2026-02-08T01:00:00.000Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/img402-dev-e29f59df/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)
