1gateway.dev/v1/files/upload
Use when an agent must hand a file to another tool, agent or person without a storage account. Input: POST the file (raw body or multipart file), ?visibility=private|public, ttl_days 1-7. png/jpeg/webp ≤5 MB, pdf ≤25 MB, text/json/csv ≤256 KB. EVM payer owns it. Images, PDFs, public text AI-screened (private text when shared); unsafe = not stored, charged. Output: id, url if public (else /v1/files
POST
https://1gateway.dev/v1/files/uploadUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://1gateway.dev/v1/files/upload", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"url":"https://example.com/"}),
});
console.log(await res.json());Example input
{
"url": "https://example.com/"
}More from Agent File Storage
- 1gateway.dev/v1/files/deleteUse when an agent must remove a stored file before it expires. Pay from the wallet that uploaded it (USDC on any EVM network in the 402 quote). Input: id. Output: status deleted, bytes freed. Public and signed links stop working at once. Missing file: 404, not charged. Example: ?id=0123456789abcdef0123456789abcdef0.002
- 1gateway.dev/v1/files/infoUse when an agent must check a stored file. Pay from the wallet that uploaded it (USDC on any EVM network in the 402 quote). Input: id. Output: mime, size, sha256, filename, visibility, created and expiry times, and the url if public. Another wallet's or a missing file returns 404 and is not charged. Example: ?id=0123456789abcdef0123456789abcdef0.002
- 1gateway.dev/v1/files/listUse when an agent must see the files it stored. Pay from the same wallet (USDC on any EVM network in the 402 quote). Input: optional cursor. Output: up to 100 files (id, mime, size, visibility, expiry, url if public), nextCursor, and usage against the limits (500 MB, 50 uploads per 24 h). Example: /v1/files/list0.002
- 1gateway.dev/v1/files/signUse when an agent must share a private file for a limited time. Pay from the wallet that uploaded it (Base or Monad USDC). Input: id, expires_in seconds (60-604800, default 3600, capped at the file's expiry). Output: a signed https://1storage.dev link anyone can use until it expires or the file is deleted. Missing file: 404, not charged. Example: ?id=0123456789abcdef0123456789abcdef&expires_in=3600.002
- 1gateway.dev/v1/files/visibilityUse when an agent must publish or unpublish a stored file. Pay from the wallet that uploaded it (USDC on any EVM network in the 402 quote). Input: id, visibility (public or private). Output: the file with its url if now public. Public files download from 1storage.dev without a signature; private ones need /v1/files/sign. Missing file: 404, not charged. Example: ?id=0123456789abcdef0123456789abcdef0.002
