MeowLoad Docs
On this page

File upload API

Use POST https://api.meowload.net/openapi/v1/uploads to upload audio, images or video for tasks such as transcription. It returns an uploadId and, if the file needs to be uploaded, an upload URL. For agent-assisted uploads, see MCP setup.

Your API credit balance must be greater than zero, but uploads do not consume credits. Transcription and other tasks check your balance and charge according to their own rules. See Billing rules in the developer dashboard for prices.

How it works

  1. Get the file size and calculate its SHA-256 checksum, then send these details to POST /uploads.
  2. If the response contains an upload object, use its URL and headers to upload the whole file with PUT. Wait for a successful response (2xx). Do not include your MeowLoad API key in this upload.
  3. If upload is null, your account already has a matching file available. Skip PUT and use the returned uploadId.
  4. Use uploadId to create a task. For example, transcription needs audio uploaded with mediaType: "audio". Send the uploadId to POST /transcriptions, with language and speakerLabels if needed.

After you create a task, the service checks whether the file can be processed. If a check fails, the task result will explain why.

Audio, images and video use the same upload API, but each task has its own file requirements. Transcription needs an audio uploadId; check the relevant API guide before choosing a file.

Supported files and size limits

mediaTypeSupported files and limits
audioAudio that can be decoded, up to 1 GiB
imageJPEG, PNG or WebP; up to 30 MiB and 100 million pixels
videoMP4; up to 500 MiB and 600 seconds

The service checks the file contents to determine its format, then checks the file size, SHA-256, image dimensions or audio/video duration. The type or Content-Type you send does not change the file's actual format. The file must also meet the requirements of the task you want to run.

If the file contains video, extract the audio before uploading it for transcription, or submit an audio/video file URL as described in the transcription guide.

Get an upload URL

curl https://api.meowload.net/openapi/v1/uploads \
  -H 'Authorization: Bearer <your API key>' \
  -H 'Content-Type: application/json' \
  -d '{"mediaType":"audio","sizeBytes":12345678,"sha256":"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"}'

Replace the example file size and SHA-256 with values calculated from your file. SHA-256 is a checksum calculated from the file contents to check that the file is intact. The Node.js example below shows how to calculate it.

FieldRequiredMeaning
mediaTypeYesaudio, image or video
sizeBytesYesFile size in bytes; a positive integer within the limits above
sha256YesSHA-256 of the whole file, as 64 hexadecimal characters

Send the file details as JSON in this step; upload the file itself in the next step.

Upload the file

The API returns HTTP 200 on success, with a response such as:

{
  "uploadId": "0123456789abcdefghijklmn",
  "upload": {
    "method": "PUT",
    "url": "https://uploads.example.com/signed-object?signature=EXAMPLE",
    "headers": {"Content-Type":"application/octet-stream"},
    "expiresAt": "2030-01-01T01:00:00.000Z"
  }
}

Upload the file using upload.url and upload.headers from the response. Send every header in upload.headers unchanged; the actual headers may differ from those in the example.

Send the file itself as the PUT request body, not as a form upload. Do not include your MeowLoad API key. The curl command below shows the format; include all the headers from your actual response:

curl --request PUT '<upload.url>' \
  --header 'Content-Type: application/octet-stream' \
  --header '<each additional returned header>: <its exact value>' \
  --data-binary @meeting.mp3

The upload URL is valid for up to one hour. Check upload.expiresAt for its expiration time. If the upload is interrupted, you can upload the same whole file again while the URL is valid. If it expires, get a new upload URL. Do not use the old URL to upload a different file.

upload.expiresAt is the upload URL's expiration time, not the file's storage lifetime. After PUT returns a successful response (2xx), use uploadId to create your task. The file will be checked as part of that task.

If your account already has a matching file available, the API returns:

{"uploadId":"0123456789abcdefghijklmn","upload":null}

upload: null means you can skip PUT and use this uploadId to create a task. It means the file can be reused, not that a task has already finished.

Reuse a file

You can use the same valid uploadId for multiple tasks with different options. Each task checks that the file is still available and meets its input requirements. Switching to another API key on the same account does not affect access to the file. Other accounts cannot use your uploadId.

Files may not stay available forever, so use uploadId while the file is available. If the file is no longer available, upload it again. Saved transcription text can still be queried after the source file is removed.

Node.js example: upload audio and create a transcription

This Node.js example reads the file in chunks to calculate SHA-256, then streams it for upload. It does not load the whole file into memory. Do not change the file between calculating its checksum and finishing the upload. Check the result every 3 seconds as described in the transcription guide.

import { createHash } from "node:crypto"
import { createReadStream, openAsBlob } from "node:fs"

const base = "https://api.meowload.net/openapi/v1"
const auth = { Authorization: "Bearer <your API key>", "Content-Type": "application/json" }
const path = "./meeting.mp3"
const file = await openAsBlob(path)
const hash = createHash("sha256")
for await (const chunk of createReadStream(path)) hash.update(chunk)

const uploadResponse = await fetch(`${base}/uploads`, {
  method: "POST",
  headers: auth,
  body: JSON.stringify({ mediaType: "audio", sizeBytes: file.size, sha256: hash.digest("hex") }),
})
if (!uploadResponse.ok) throw new Error(`Could not get upload URL: ${uploadResponse.status}`)
const { uploadId, upload } = await uploadResponse.json()
if (upload !== null) {
  const put = await fetch(upload.url, { method: upload.method, headers: upload.headers, body: file })
  if (!put.ok) throw new Error(`File upload failed: ${put.status}`)
}
const created = await fetch(`${base}/transcriptions`, {
  method: "POST", headers: auth,
  body: JSON.stringify({ uploadId, language: "auto", speakerLabels: false }),
})
if (!created.ok) throw new Error(`Could not create transcription: ${created.status}`)
console.log("Save this task ID:", (await created.json()).id)

API errors return a non-2xx status code and an error in the form {message, code?, detail?}. If a file check fails, the task result will explain why, and no API credits are charged for the task. See the API reference for all parameters and response fields.