01Quick start
In the developer area of your account. It is shown once — copy it right away.
In an environment variable MASHAHID_API_KEY on your server, never in browser code.
With the header Authorization: Bearer … or X-API-Key. One word is enough.
02Models & top-ups
The same credits and model prices as the site. Subscribe, or top up with no subscription. Credits are reserved on request; a failed video is fully refunded, and on auto length only the real length is charged.
"flow"Pure motion
"lens"Cinematic film
"canvas"Illustrated story
Production, rendering and storage are on us and included. Post images are free.
03Create a video
The reply is immediate with the id and reserved credits; the engine works in the background.
curl -X POST https://mashahid.pages.dev/api/v1/videos \
-H "Authorization: Bearer $MASHAHID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"idea": "A new oud perfume for men",
"model": "lens",
"aspect": "9:16",
"duration": 30,
"voice": "en-amelia"
}'const API = "https://mashahid.pages.dev/api/v1";
const headers = {
Authorization: `Bearer ${process.env.MASHAHID_API_KEY}`,
"Content-Type": "application/json",
};
// 1) create — type, length, tone and voice default to "auto"
const res = await fetch(`${API}/videos`, {
method: "POST",
headers,
body: JSON.stringify({ idea: "specialty coffee", model: "flow" }),
});
let video = await res.json(); // { id, status: "queued", credits_cost, ... }
// 2) wait until it is ready (or use a webhook instead)
while (!["ready", "failed"].includes(video.status)) {
await new Promise((r) => setTimeout(r, 10_000));
video = await (await fetch(`${API}/videos/${video.id}`, { headers })).json();
}
console.log(video.video_url, video.post_text);import os, time, requests
API = "https://mashahid.pages.dev/api/v1"
H = {"Authorization": f"Bearer {os.environ['MASHAHID_API_KEY']}"}
video = requests.post(f"{API}/videos", headers=H, json={
"idea": "5 tips for better product photos",
"type": "tips",
"model": "canvas",
"language": "en",
}).json()
while video["status"] not in ("ready", "failed"):
time.sleep(10)
video = requests.get(f"{API}/videos/{video['id']}", headers=H).json()
print(video["video_url"]){
"id": "7c1e…",
"status": "queued",
"model": "lens",
"duration_s": 30,
"aspect": "9:16",
"credits_cost": 30,
"created_at": "2026-11-28T12:00:00Z"
}04Track status
Poll about every 10 seconds, or add a webhook and we will tell you. progress goes 0–100.
curl https://mashahid.pages.dev/api/v1/videos/VIDEO_ID \
-H "Authorization: Bearer $MASHAHID_API_KEY"{
"id": "7c1e…",
"status": "ready",
"progress": 100,
"title": "Oud, your signature",
"model": "lens",
"duration_s": 31,
"credits_cost": 60,
"video_url": "https://…/video.mp4",
"srt_url": "https://…/captions.srt",
"cover_url": "https://…/cover.jpg",
"post_text": "…post caption with hashtags",
"post_images": {},
"post_images_status": "none"
}05Post images
From any ready video: 1:1, 4:5 and 16:9 images (plus 9:16 when the video is not vertical) and up to 5 carousel slides, with the headline or clean. Free, made only when you ask.
curl -X POST https://mashahid.pages.dev/api/v1/videos/VIDEO_ID/images \
-H "Authorization: Bearer $MASHAHID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "with_text": false }'
# 202 → { "post_images_status": "queued", "with_text": false }
# then GET /videos/VIDEO_ID → post_images:
# { "post_1x1": "…", "post_4x5": "…", "post_16x9": "…", "slide_1": "…" }06Create fields
| Field | Values | Default |
|---|---|---|
| idearequired | 1–2000 characters (optional with document_url) | — |
| document_url | https link to a PDF up to 25 MB (profile, catalogue, menu, report). The video is built from its facts, numbers, pictures and contacts | — |
| model | flow · lens · canvas | flow |
| type | auto · questions · myths · story · manifesto · idea_to_product · info · promo · launch · how_to · before_after · tips · faq · comparison · announcement | auto |
| duration | "auto" or 10–600 s | auto |
| aspect | 9:16 · 4:5 · 1:1 · 16:9 | 9:16 |
| tone | auto · confident · energetic · cinematic · warm · formal | auto |
| language | ar · en | ar |
| voice | auto or an id from GET /voices | auto |
| voice_settings | speed 0.75–1.35 · pitch −4…4 · warmth −1…1 · energy 0…2 · pauses 0…2 | — |
| captions | boxed · bold · minimal · none | boxed |
| sound_effects | true · false | true |
| brand_id | A brand id from GET /me | Default brand |
30 voices in Arabic and English with several accents — full list with samples from GET /voices. Examples: ar-faisal · ar-layla · ar-fahad · ar-tariq · ar-maryam …
Up to 5 minutes on Creator and up to 10 minutes on Business.
07All endpoints
| POST | /videos | Create a video | |
| GET | /videos/{id} | Status, links and post images | |
| GET | /videos?limit=20 | Your latest videos | |
| POST | /videos/{id}/images | Post images from a ready video (free) | |
| GET | /me | Plan, credits (with USD value) and brands | |
| GET | /voices | Voice library with samples | no key |
| GET | /types | Every option, model and price | no key |
08MCP server for AI assistants
Tell your assistant “make a video about my store’s Friday deal” and it does the rest. Streamable HTTP at:
https://mashahid.pages.dev/api/mcpclaude mcp add --transport http mashahid https://mashahid.pages.dev/api/mcp \
--header "Authorization: Bearer msh_live_..."{
"mcpServers": {
"mashahid": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mashahid.pages.dev/api/mcp",
"--header", "Authorization:${MASHAHID_AUTH}"],
"env": { "MASHAHID_AUTH": "Bearer msh_live_..." }
}
}
}// ~/.cursor/mcp.json
{
"mcpServers": {
"mashahid": {
"url": "https://mashahid.pages.dev/api/mcp",
"headers": { "Authorization": "Bearer msh_live_..." }
}
}
}// .vscode/mcp.json
{
"servers": {
"mashahid": {
"type": "http",
"url": "https://mashahid.pages.dev/api/mcp",
"headers": { "Authorization": "Bearer msh_live_..." }
}
}
}curl -X POST https://mashahid.pages.dev/api/mcp \
-H "Authorization: Bearer $MASHAHID_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Claude Desktop: put it in claude_desktop_config.json and restart (needs Node.js).
create_videoCreates a video from an ideaget_videoStatus, links and post imagescreate_post_imagesPost images from a ready videolist_videosLatest videoslist_typesModels, types and voicesaccountPlan, credits and brands09Webhooks
Add an HTTPS URL in the developer area (Business plan) to receive video.ready and video.failed. Each request is signed with the URL’s secret: HMAC-SHA256 of “timestamp + dot + body”. Without a 2xx we retry up to 3 times.
POST https://your-server.com/hooks/mashahid
Content-Type: application/json
X-Mashahid-Event: video.ready
X-Mashahid-Delivery: 3f0c… # unique per delivery
X-Mashahid-Timestamp: 1764331200
X-Mashahid-Signature: sha256=9b1d…
{ "id": "3f0c…", "event": "video.ready", "created": 1764331200,
"video": { "id": "7c1e…", "status": "ready", "video_url": "…", … } }import crypto from "node:crypto";
// raw = the request body as a Buffer, before JSON.parse
export function verify(raw, headers, secret) {
const ts = headers["x-mashahid-timestamp"];
const sig = headers["x-mashahid-signature"] || "";
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // replay guard
const mac = crypto.createHmac("sha256", secret)
.update(`${ts}.`).update(raw).digest("hex");
const a = Buffer.from(sig), b = Buffer.from(`sha256=${mac}`);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}import hmac, hashlib, time
def verify(raw: bytes, headers, secret: str) -> bool:
ts = headers["X-Mashahid-Timestamp"]
if abs(time.time() - int(ts)) > 300: # replay guard
return False
mac = hmac.new(secret.encode(), ts.encode() + b"." + raw, hashlib.sha256).hexdigest()
return hmac.compare_digest(headers.get("X-Mashahid-Signature", ""), "sha256=" + mac)10Errors & limits
Every error comes back as { "error": "code", "message": "…" } with a human-readable message.
| HTTP | error | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON |
| 401 | invalid_api_key | Wrong or revoked key |
| 402 | no_credits | Not enough credits for this length and model |
| 403 | plan_required | Not on your plan (e.g. a longer length) |
| 404 | not_found · brand_not_found | Not found in your account |
| 409 | video_not_ready | Post images need a ready video |
| 422 | invalid_request | Invalid value; the message lists the allowed ones |
| 429 | rate_limited | Over 30 requests per minute per key |
| 503 | maintenance | Short maintenance; retry |
Create your key, top up, and your first video is one request away.