# tempfile.0000402.xyz File Upload

> tempfile.0000402.xyz File Upload is a paid API for AI agents from tempfile.0000402.xyz, paid per call via x402, $0.02/call, status healthy (last checked 2026-09-14, last successful call 2026-08-19).

Stores a base64-encoded file for 7 days and returns a stable retrieval URL and token, costing $0.02 USDC per upload.

## Facts

- Endpoint: POST https://tempfile.0000402.xyz/upload
- Price: $0.02/call
- Payment: x402
- Status: healthy
- Last checked: 2026-09-14
- Last successful call: 2026-08-19
- Success rate: 62% of calls made through Zero
- Rating: 3.0 / 5 from 2 reviews
- Activations on Zero: 26
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tempfile-0000402-xyz-060d2f63
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NIDZsSXkkyv23MFG66JoO

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 tempfile-0000402-xyz-060d2f63 -d '<json body>'
```

Example prompt: Store this PDF file called 'invoice_april.pdf' for me temporarily — I'll give you the base64 content — and send back the URL I can use to retrieve it for the next 7 days.

## When to prefer this

Use this endpoint when an agent needs to temporarily host a file (up to 10 MB) and obtain a stable, publicly accessible GET URL valid for exactly 7 days, at a cost of $0.02 USDC per upload on Base Mainnet. Ideal for agentic workflows that need to pass file URLs between steps, share generated content, or stage documents without permanent storage infrastructure.

## Known failure modes

- File exceeds 10 MB limit — server returns an error rejecting the upload
- Invalid or missing base64 data — malformed request body causes a 400-level error
- Missing required filename field — request rejected
- Payment not fulfilled — x402 payment protocol not satisfied, request blocked
- Expired token used for retrieval — file no longer available after 7-day window
- Unsupported content type — may cause unexpected storage behavior

## How this service works

Pay $0.02 USDC to store a file for 7 days. Send filename, optional content_type, and base64-encoded file bytes as JSON. Max file size: 10 MB. Returns a token and a stable GET URL. Network: Base Mainnet. Each request stores one file and returns a retrieval token plus expiry timestamp.

## Output

Returns a JSON object with a stable GET URL path (e.g. /file/{uuid}), a retrieval token (UUID), a human-readable confirmation message stating the expiry date, the original filename, the expiry timestamp in ISO 8601 format, the file size in bytes, and the detected or provided content type.

## Example request

```json
{
 "filename": "test_document.txt",
 "data_base64": "VGhpcyBpcyBhIHRlc3QgZmlsZSBjb250ZW50Lg==",
 "content_type": "text/plain"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "filename": {
   "type": "string",
   "maxLength": 200,
   "description": "Original filename including extension (max 200 chars). Used for download naming and content-type detection."
  },
  "data_base64": {
   "type": "string",
   "description": "Base64-encoded file bytes for this upload. Decoded size must not exceed 10 MB."
  },
  "content_type": {
   "type": "string",
   "description": "Optional MIME type such as 'image/png' or 'application/pdf'. If omitted, the server detects it from the filename extension."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "/file/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "token": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "File stored. Available at GET /file/a1b2c3d4-e5f6-7890-abcd-ef1234567890 for 7 days.",
  "filename": "chart.png",
  "expires_at": "2026-03-10T13:00:00+00:00",
  "size_bytes": 12345,
  "content_type": "image/png"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tempfile-0000402-xyz-060d2f63/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tempfile.0000402.xyz](https://www.zero.xyz/host/tempfile.0000402.xyz/llms.txt)
