Quick start
Create an app
Sign in to the MediaLit dashboard with your email and create an app. Each app has its own files, settings and API keys. Creating the app shows its first API key. Copy it now: MediaLit shows a key only once. You can create more keys in the app's settings.
Anyone with the API key can upload, read and delete the app's files. Keep it on your server and out of browser code.
Upload a file
Pick the way you want to work with MediaLit.
npmnpm install -g @medialit/clipnpmpnpm add -g @medialit/cliyarnyarn global add @medialit/clibunbun add -g @medialit/climedialit login medialit upload photo.jpg --publicThe CLI seals the file for you, so you can skip the next step. See CLI.
curl -X POST https://api.medialit.cloud/media/create \ -H "x-medialit-apikey: YOUR_API_KEY" \ -F "file=@photo.jpg" \ -F "access=public"npmnpm install medialitpnpmpnpm add medialityarnyarn add medialitbunbun add medialitimport { MediaLit } from "medialit"; const medialit = new MediaLit({ apiKey: process.env.MEDIALIT_API_KEY }); const media = await medialit.upload("./photo.jpg", { access: "public" });Add
https://api.medialit.cloud/mcpas a remote MCP server in Claude, ChatGPT, Cursor or another MCP client, sign in, and ask:Upload this image to MediaLit as a public file and give me its link.
See MCP server for client set-up.
The response includes a
mediaIdand afileURL.Seal it
The upload is temporary, and MediaLit deletes it after 24 hours unless you seal it. Seal files once you know you want to keep them, for example when the user saves the form they were uploaded from.
curl -X POST https://api.medialit.cloud/media/seal/MEDIA_ID \ -H "x-medialit-apikey: YOUR_API_KEY"const sealed = await medialit.seal(media.mediaId); console.log(sealed.file);Sealed files appear in listings, in your storage total and in the dashboard. Why uploads are temporary.
