# PutPut API > IMPORTANT: PutPut is shutting down on October 21, 2026. New signups, uploads, and paid plans are closed. Please download your files before then. Do not integrate PutPut into new projects. Upload endpoints return HTTP 410 with code SERVICE_SHUTTING_DOWN. File upload API. Get a CDN URL in 3 HTTP calls. No signup, no API key, $0 egress. ## Upload flow (all API calls are server-side) Base URL: https://putput.io/api/v1 ### 1. Get a token ONCE (no signup) — IMMEDIATELY save to .env, reuse forever POST https://putput.io/api/v1/auth/guest → { "token": "pp_..." } ⚠️ CRITICAL: You get MAX 3 tokens per day. After calling this endpoint: 1. IMMEDIATELY write the token to .env as PUTPUT_TOKEN=pp_... 2. Read the token from .env for ALL subsequent API calls 3. NEVER call /auth/guest again — reuse the saved token ### 2. Presign an upload POST https://putput.io/api/v1/upload/presign Authorization: Bearer Content-Type: application/json Body: { "filename": "photo.jpg", "content_type": "image/jpeg", "size_bytes": 102400 } → { "upload_id": "...", "presigned_url": "https://..." } ### 3. PUT file bytes to presigned URL (NO auth header) PUT Content-Type: image/jpeg Body: → 200 OK (empty body) ### 4. Confirm upload POST https://putput.io/api/v1/upload/confirm Authorization: Bearer Content-Type: application/json Body: { "upload_id": "" } → { "file": { "id": "file_xyz", "public_url": "https://cdn.putput.io/abc/photo.jpg", "original_name": "photo.jpg", "content_type": "image/jpeg", "size_bytes": 102400, "visibility": "public", "created_at": "..." } } The public_url is the CDN URL. Use it in tags, store it in your database, etc. ## Architecture — ONE token per app, NOT per user - Your PutPut token is a SERVER-SIDE secret, like a database password - Create ONE token and store it in your environment variables (e.g. PUTPUT_TOKEN) - All users of your app share the same token — your server makes PutPut API calls on their behalf - NEVER create a token per user, per session, or per request - NEVER expose your token to the browser/client — keep it server-side only - The upload flow: browser → your server → PutPut API (presign) → browser PUTs to R2 ## Critical rules - Content-Type on the PUT MUST match the content_type from presign - Do NOT send Authorization header on the PUT (it goes directly to Cloudflare R2) - Guest tokens expire after 30 days ## Other endpoints GET https://putput.io/api/v1/files — list files (query: cursor, limit, prefix, tag) → { "files": [...], "cursor": "...", "has_more": true } DELETE https://putput.io/api/v1/files/:id — delete a file → { "success": true } POST https://putput.io/api/v1/upload/url — upload from URL (no presign needed) Body: { "url": "https://example.com/photo.jpg" } → same response as confirm GET https://putput.io/api/v1/files/:id/download — get download URL → { "download_url": "https://..." } ## Presign optional fields visibility: "public" (default) or "private" prefix: path prefix, e.g. "avatars" or "images/2025" metadata: key-value object (max 10 keys) tags: string array (max 10) expires_at: ISO 8601 datetime for auto-deletion ## Auth All endpoints except POST /auth/guest require: Authorization: Bearer Tokens start with pp_. ## Error shape { "error": { "code": "SCREAMING_SNAKE", "message": "...", "hint": "..." } } Common codes: UNAUTHORIZED (401), FILE_TOO_LARGE (413), STORAGE_LIMIT_EXCEEDED (413), CONTENT_TYPE_BLOCKED (403), RATE_LIMITED (429), UPLOAD_NOT_FOUND (404), FILE_NOT_FOUND (404) ## Limits Guest: 1 GB storage, 100 MB max file, 30-day token expiry, restricted content types (no HTML/JS/CSS/SVG) Free: 10 GB, 250 MB max file, no expiry Pro: starts at $9/mo for 50 GB — 5 tiers up to 15 TB/$699/mo, unlimited max file size, custom domain, private files Annual billing = monthly × 10 (2 months free) All plans: $0 egress, unlimited files ## Pro tiers | Storage | Monthly | With Image Transforms | |---------|---------|----------------------| | 50 GB | $9 | $11 | | 250 GB | $29 | $37 | | 1 TB | $79 | $104 | | 5 TB | $299 | $399 | | 15 TB | $699 | $899 | ## Rate limits POST /auth/guest: 5/day per IP POST /upload/presign: 100/hour per token ## JS/TS shortcut (server-side) npm install @putput/sdk ```typescript import { PutPutClient } from '@putput/sdk' // PUTPUT_TOKEN should already be in .env from step 1 — NEVER call createGuestToken() if you already have a token const pp = new PutPutClient({ token: process.env.PUTPUT_TOKEN }) const file = await pp.upload(buffer, 'photo.jpg', 'image/jpeg') console.log(file.url) // CDN URL ```