API Examples You Can Run in 5 Minutes
Real, runnable demos for the Meicut developer platform — upload a video, cut it, and download the result with a few lines of Python or Node.js, or let your AI assistant call 25 media tools over MCP.
Simple REST API
Eight endpoints cover upload, every processing tool, and job polling. Authenticate with one header; results come back as presigned download URLs.
Hosted MCP Server
Point Claude Desktop or Cursor at our MCP endpoint and ask for edits in plain language — no code required.
25 Tools, One Key
Cut, merge, resize, convert, compress, subtitles, filters and more — every tool in the web app is callable from your code.
Quickstart
Pick your stack — every example below runs out of the box against the live API.
# Meicut quickstart — Python 3.8+, standard library only.
# Set your key first: export MEICUT_API_KEY=mv_your_api_key
import json
import os
import time
import urllib.request
API_KEY = os.environ["MEICUT_API_KEY"]
API = "https://meicut.com/api"
def call(method, path, payload=None, raw=None, content_type="application/json"):
if raw is not None:
data = raw
elif payload is not None:
data = json.dumps(payload).encode()
else:
data = None
req = urllib.request.Request(API + path, data=data, method=method, headers={
"X-API-Key": API_KEY,
"Content-Type": content_type,
})
with urllib.request.urlopen(req, timeout=120) as r:
return json.loads(r.read())
# 1. Upload a file (multipart/form-data) -> stored_name
boundary = "----meicut"
content = open("video.mp4", "rb").read()
body = (
("--" + boundary + "\r\n"
'Content-Disposition: form-data; name="file"; filename="video.mp4"' + "\r\n"
"Content-Type: application/octet-stream\r\n\r\n").encode()
+ content
+ ("\r\n--" + boundary + "--\r\n").encode()
)
up = call("POST", "/v1/upload", raw=body,
content_type="multipart/form-data; boundary=" + boundary)
stored_name = up["stored_name"]
# 2. Submit a cut job -> job_id (all video/audio tools use this same pattern)
job = call("POST", "/v1/video-tool", {
"stored_name": stored_name,
"tool": "cut-video",
"params": {"start_time": 0, "duration": 10},
})
job_id = job["job_id"]
# 3. Poll every 3s until the job finishes
while True:
st = call("GET", "/v1/job/" + job_id + "/status")
if st["status"] in ("completed", "failed"):
break
time.sleep(3)
if st["status"] == "failed":
raise SystemExit("Job failed: " + str(st.get("error")))
# 4. Download — download_url is presigned, no auth header needed
urllib.request.urlretrieve(st["download_url"], "result.mp4")
print("Done -> result.mp4")Using an older MCP client that only supports SSE? Use https://meicut.com/mcp/sse?api_key=YOUR_KEY as the URL instead.
Full Examples on GitHub
The complete, open-source example pack — clone it, set your API key, and run:
- rest_quickstart.py / .mjs — the minimal upload → process → download flow
- rest_full_suite.py — validates all 8 endpoints with a pass/fail report
- mcp_client.py — raw MCP JSON-RPC over Streamable HTTP
Ready to build?
Sign up free, grab an API key, and process your first video in minutes.
Get an API Key