Skip to content

Storage

Every project has a media library for images, video, audio, PDFs and other files. Files are served publicly from Frontend’s CDN, so you can use their URLs anywhere in your app.

Open Media in the project’s sidebar to upload files (up to 20 MB each), browse and search them, and delete them. Choosing files pastes their URLs into the active agent’s prompt, so you can say where to use them.

Agents manage the library through the Frontend MCP server’s LIST_MEDIA, UPLOAD_MEDIA and DELETE_MEDIA tools, and images and videos they generate with OpenRouter are saved there too.

Your app can manage the same library over HTTP:

MethodPathDescription
GET/api/v1/mediaList files, with optional query search and cursor pagination
POST/api/v1/mediaUpload a file (multipart form-data, field file)
GET/api/v1/media/{id}Download a file
DELETE/api/v1/media/{id}Delete a file

All paths are under https://cloud.frontend.co and use the project’s API key.

Each file is returned as a media item:

{
"id": "3f2b9c1e-…-hero.png",
"url": "https://cdn.frontendai.app/projects/<projectId>/images/3f2b9c1e-…-hero.png",
"name": "3f2b9c1e-…-hero.png",
"mimeType": "image/png"
}

url is the public CDN address to use in your app. Listing returns { "items": [...], "nextCursor": "..." }; pass nextCursor as cursor to get the next page.

Terminal window
curl -X POST "https://cloud.frontend.co/api/v1/media" \
-H "x-api-key: $FRONTEND_API_KEY" \
-F "file=@./product.png"
Terminal window
curl "https://cloud.frontend.co/api/v1/media?query=product" \
-H "x-api-key: $FRONTEND_API_KEY"
Terminal window
curl -X DELETE "https://cloud.frontend.co/api/v1/media/3f2b9c1e-…-hero.png" \
-H "x-api-key: $FRONTEND_API_KEY"

Upload from server code so the API key stays private, for example in a route handler that receives a file from the browser:

export async function POST(request: Request) {
const form = await request.formData()
const upload = new FormData()
upload.append('file', form.get('file') as File)
const res = await fetch('https://cloud.frontend.co/api/v1/media', {
method: 'POST',
headers: { 'x-api-key': process.env.FRONTEND_API_KEY! },
body: upload,
})
return Response.json(await res.json(), { status: res.status })
}