# postcache > Public, short-lived media URLs for AI agents that post to Instagram, Threads and Facebook. Upload a file with an API key, get an HTTPS URL that passes the platform's media checks (or have postcache fix the file), delete it after the post. Status: live. Get a key: sign up at https://postcache.dev/login (free plan, 100 uploads a month, no card), or pay per upload without an account (see Pay per use). Docs: https://postcache.dev/docs · OpenAPI 3.1: https://postcache.dev/openapi.json ## API Base URL: https://postcache.dev. Auth: `Authorization: Bearer pc_live_...`. - `PUT /v1/media` with the file as the raw body. Headers: `x-target` (one of instagram.feed, instagram.carousel, instagram.reels, instagram.story, threads, facebook.page), optional `x-filename`. Query: `ttl` seconds, 3600-604800, default 86400; `convert=crop|pad`; `dry_run=1`. - 201: `{ id, status: "ready", url, target, content_type, size, expires_at, checks }`. Give `url` to the platform API (image_url / video_url). - 202 (with convert, file fixable): `{ id, status: "converting", original_checks, status_url }`. Poll `GET /v1/media/{id}` until status is `ready` (url set) or `failed` (checks say why). - 422: `{ error: "checks_failed", checks: { problems: [{ rule, message, fix }] } }`. Not fixable by convert (e.g. duration): apply the `fix` and upload again. - 200 (dry_run): `{ dry_run: true, checks, convertible? }`, nothing stored. - 401 bad key, 400 bad target/ttl/convert, 402 `quota_exceeded` (plan limit; `upgrade_url`, `buy_url`) or `payment_required` (no key: pay per use), 413 over 1 GiB, 429 `budget_exceeded` (key's daily cap; Retry-After), 503 busy (Retry-After). - `POST /v1/media/from-url` JSON `{ source_url, target, filename?, ttl?, convert?, dry_run? }`: same answers; only public http(s) URLs (400 `blocked` for private addresses). - `GET /v1/media/{id}`: status (converting, ready, failed, deleted), url, expiry, fetch count, checks. - `DELETE /v1/media/{id}`: delete now (204). Call it after the post is published. Without a key (pay per use) send `x-delete-token` from the upload answer; the same header reads the status. ## Pay per use (no account) - Send `PUT /v1/media` or `POST /v1/media/from-url` without Authorization: 402 with an MPP challenge (`WWW-Authenticate`, USDC on Tempo) and an x402 challenge (`Payment-Required`, USDC on Base). Price: 0.01 USD per upload. Pay, then repeat the request. - The paid answer has `payment` and `delete_token` (shown once). Payment is taken before the checks: test with `dry_run=1` first (free, no payment). - `POST /v1/credits`: 500 uploads for 5 USD in USDC (x402 on Base or MPP on Tempo). No key: answer has a new API key with 500 credits. With a key: credits are added to that account. - Media URLs: `https://cdn.postcache.dev/m/{id}/{name}`; 410 after expiry or delete; single byte ranges (416 past the end). Plans: Free 100 uploads a month, Builder 2,000, Studio 20,000. Dry runs are free. Manage keys, caps and billing at https://postcache.dev/dashboard. What convert fixes: images (format, aspect, colour space, size → sRGB JPEG; crop, or pad with white) and video (codecs, container, pixel format, interlacing, fps, width, aspect, bitrate, moov, edit lists, size → H.264/AAC MP4; crop, or pad with black). It never trims duration. ## MCP `https://postcache.dev/mcp` (Streamable HTTP), header `Authorization: Bearer pc_live_...`. Server card: https://postcache.dev/mcp/server-card. Tools: - `upload_media { target, source_url | data_base64 (max 10 MB), filename?, ttl?, convert? }` - `check_media` (same input, stores nothing) - `get_media { id }`, `delete_media { id }` ## Agent skill `posting-media-with-postcache`: the whole flow (upload per target, platform rules, Instagram/Threads/Facebook publishing calls, Meta media errors). Install: `npx skills add Endorphin-IT/postcache-examples`. Source and code examples: https://github.com/Endorphin-IT/postcache-examples ## Instagram API media errors What each error means and how to fix it: https://postcache.dev/errors - 2207052 (media could not be fetched from this URI): https://postcache.dev/errors/2207052 - 2207009 (image aspect ratio cannot be published): https://postcache.dev/errors/2207009 - 2207026 (video format is not supported): https://postcache.dev/errors/2207026 - 2207004 (image is too large to download): https://postcache.dev/errors/2207004 - 2207005 (image format is not supported): https://postcache.dev/errors/2207005 - 2207003 (it takes too long to download the media): https://postcache.dev/errors/2207003 ## Contact hello@postcache.dev