Through the API
Send a public URL toPOST /upload. The server fetches the file, stores it on Arweave and returns its URI. It needs an API key or access token.
Cost
Paid uploads take USDC from the artist’s smart wallet. If it doesn’t hold enough, the API returns
402:
required and available are in USDC with 6 decimals. Send USDC on Base to smart_wallet and retry.
Upload JSON metadata
POST /upload takes a URL, so host the metadata JSON at a public URL and upload it the same way. Without hosting, use uploadJson below.
From your app with Turbo
Upload from a Next.js 16 browser app with@ardrive/turbo-sdk. Uploads are paid with your Turbo credits. Top up at turbo.ar.io/topup.
Install
Configure Next.js
The SDK needs Node built-ins in the browser:next.config.js
.env.local
Create the client
client.ts
Patch fetch
The SDK sends aReadableStream body, which the browser can’t resend on retry. This helper turns it into a Blob:
patchFetch.ts
Upload a file
uploadToArweave.ts
Upload JSON
uploadJson.ts
Next steps
- Quickstart: use the URIs to create a moment.
- Create a collection with a metadata URI.