Skip to main content
Media in Nylon is a URL. POST /v1/posts takes media as a list of links, a social network fetches or receives those bytes, and that is the whole contract. Everything below is about how to get a URL when you do not already have one.

Three ways in

You already host it

Pass the URL straight to POST /v1/posts. Nothing is stored by Nylon and nothing is charged for.

Let Nylon copy it

POST /v1/media with { "url": "…" }. Nylon downloads it once and hands back a URL of its own.

Send the bytes

POST /v1/media with the file as the body, or POST /v1/media/uploads for anything large.
The URL must be reachable without credentials at the moment the post publishes — which for a scheduled post is later. That is the one trap, and the next section is how to avoid it.
Worth doing whenever the original is signed, expiring, behind a slow origin, or simply not guaranteed to still be there next Tuesday. A post scheduled for next week is fetched next week; a presigned S3 link that expires in an hour will not be.

Bytes

Post the file with its own content type, for anything up to 4 MB:
Larger files cannot go through the API at all — a serverless request body is capped in megabytes and a video is not — so they upload straight to storage. That exchange is handled by the @vercel/blob client against POST /v1/media/uploads.
A data: URI also works anywhere media takes a URL, and is stored the same way. It exists for agents: a model that has just generated an image has bytes, not a link.

What Nylon keeps, and for how long

Two tiers, and the second one is the point: A file you uploaded and never published deletes itself after a week, along with any compressed copies made from it. That is as much about not paying to store files nobody posted as it is about not holding your media longer than needed. Uploading the same file twice stores it once — assets are addressed by the hash of their contents.

Compression

Nylon fixes weight, never shape. An image over a network’s byte limit is recompressed before publishing: quality first, then dimensions, stopping the moment it fits. A transparent PNG stays a PNG; an opaque one may become a JPEG. For the networks that fetch media themselves — Instagram, Threads, TikTok, Google Business and DEV — the compressed copy is hosted by Nylon and that URL is what the platform is given. It is made once per file per limit, so a carousel to five profiles compresses once. What is never changed: aspect ratio, exact dimensions, video, and animated GIFs. Each of those would alter what you published rather than just its file size, so they are refused with the real numbers instead. POST /v1/validate reports all of it before anything goes out.