Images Videos Audio Pricing Docs View as Markdown (Agent) Get started
Human Agent

API reference

Media

Save a file from a URL or inline base64 without knowing what it is. Built for AI output that expires (Replicate, OpenAI, Runway, fal, Gemini): PixelVault reads the first bytes, stores the file as an image, PDF, MP4 or audio asset, and returns that asset's object with a permanent URL.

Save media from a URL or base64, any type

POST /v1/media

Save an image, PDF, MP4 video or audio file as a permanent asset without choosing the endpoint first. Send a public https url (for example a Replicate, fal, OpenAI or Runway result link that will expire) or inline data (base64 or a data: URL, up to 10 MB decoded, for providers that return bytes, such as Gemini or ElevenLabs).

PixelVault identifies the file from its first bytes, not from the URL or Content-Type (provider CDNs often send application/octet-stream), then stores it exactly as upload_image, upload_video or upload_audio would: the same validation, plan limits, quotas, posters, webhooks and Idempotency-Key replays. The response is that endpoint's object, so check kind (image, document, video or audio). URL imports record the host they came from as source_host.

A URL is requested twice: a short probe that reads the first 4 KB, then the import. Act within the link's lifetime; Replicate deletes outputs after an hour.

Auth: a secret API key. Images and PDFs follow the unverified-account allowance of upload_image (5 files); video and audio need a verified email.

Supported: JPEG, PNG, GIF, WebP, AVIF, SVG, PDF, MP4 (QuickTime files that declare MP4 compatibility count), MP3, WAV, M4A and OGG. MOV and WebM are converted to MP4 on ingest (up to 60 seconds and 100 MB, using the monthly video-optimization allowance; see upload_video); a GIF stays an image here (send it to upload_video to get an MP4). HEIC, FLAC, AAC and AVI return 415 with detected_format and a hint about what to convert to.

Options apply only to the types they belong to: describe and dedupe to images, social_ready and normalize to video, collection_id to video and audio.

Authentication

API key, sent as Authorization: Bearer <key>.

Headers

Headers
Name Type Required Description
Idempotency-Key string Optional

Retry safety, up to 255 non-space printable ASCII characters. A repeat returns the asset the first request stored (replayed: true) under the same rules as the endpoint for its type.

max length 255 · pattern ^[\x21-\x7e]+$

Request body

application/json, required

Request body
Name Type Required Description
url string (uri) Optional

Public https URL of the file (up to 3 redirects). Video and audio sources must send Content-Length.

data string Optional

The file as base64 or a base64 data: URL, up to 10 MB decoded. Use url for anything larger.

filename string Optional

Original filename. Defaults to the URL's last path segment, or image.<ext>, video.mp4 or audio.<ext> for data.

max length 255

visibility string Optional

private serves the asset only through signed URLs.

One of: public, private

Default: public

sign_expires_in integer Optional

Lifetime in seconds of the returned private URLs.

Default: 3600

min 60 · max 2592000

expires_in integer Optional

Delete the asset after this many seconds. Omit to keep it permanently.

min 60 · max 2592000

folder string Optional

Folder (part of the CDN path for public images).

pattern ^[A-Za-z0-9_-]{1,64}$

collection_id string Optional

Video and audio: an existing collection with the same visibility.

metadata object Optional

Custom metadata (max 50 top-level keys, 4 KB).

describe boolean Optional

Images: generate an AI description in the background (see upload_image).

Default: false

dedupe boolean Optional

Images: return an existing image with identical bytes instead of storing a copy. Cannot be combined with Idempotency-Key.

Default: false

social_ready boolean Optional

Video: also create a social-ready H.264/AAC copy (see upload_video).

Default: false

transcribe boolean Optional

Audio: start transcription as soon as it is stored (see upload_audio). Ignored for other types.

Default: false

normalize boolean Optional

MP4 video: make the stored file play everywhere (see upload_video). MOV and WebM are always converted. Ignored for other types.

Default: false

Responses

Request
curl -X POST https://api.pixelvault.dev/v1/media \
  -H "Authorization: Bearer $PIXELVAULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://replicate.delivery/xezq/abc123/out-0.webp",
  "data": "data:image/png;base64,iVBORw0KGgo...",
  "filename": "hero.webp",
  "folder": "generations",
  "metadata": {
    "model": "flux-schnell",
    "prompt_id": "42"
  }
}'
Response 201
{
  "data": {
    "id": "img_abc123",
    "kind": "image",
    "url": "https://img.pixelvault.dev/proj_xyz789/img_abc123.jpg",
    "branded_url": "https://media.example.com/img_abc123.jpg",
    "optimized_url": "https://img.pixelvault.dev/proj_xyz789/img_abc123.jpg?fmt=auto&q=85",
    "mime_type": "image/jpeg",
    "size": 245782,
    "width": 1920,
    "height": 1080,
    "filename": "photo.jpg",
    "folder": "blog",
    "metadata": {
      "env": "prod",
      "run": "42"
    },
    "source_host": "replicate.delivery",
    "description": {
      "status": "done",
      "alt": "A red fishing boat moored in a small harbour at sunset",
      "caption": "A small red fishing boat rests at a stone quay while the sun sets behind the harbour wall.",
      "ocr_text": "HARBOUR MASTER",
      "tags": [
        "boat",
        "harbour",
        "sunset"
      ],
      "model": "@cf/mistralai/mistral-small-3.1-24b-instruct",
      "described_at": "2026-11-16T12:00:04.000Z",
      "cached": false,
      "error": "describe_timeout"
    },
    "describe_skipped": "unsupported_type",
    "created_at": "2026-11-16T12:00:00.000Z",
    "expires_in": 86400,
    "temporary": true,
    "delete_token": "pv_del_3xQm9TzR1aB7cD2eF4gH6jK8lN0pS5uV",
    "deduplicated": true,
    "replayed": true
  }
}