mimesays

MimeSays API · version 1

Render ads from your own tools.

The API does what the Studio does with a project that already has a script: price the ads, render them, follow them and download them. Webhooks tell your server when an ad is ready or fails. AI agents can do the same through the MCP server. It comes with the Agency plan.

Keys

Make a key in Settings → API and webhooks (owners and admins). It is shown once. Send it in every request:

curl https://mimesays.com/api/v1/workspace \
  -H "Authorization: Bearer ak_xxxxxxxx_your_secret"

A key works for one workspace and acts as the person who made it. A read only key can list and download but can't quote or render. Keep keys on your server; they are not meant for browsers.

Basics

  • Base URL: https://mimesays.com/api/v1. JSON in and out.
  • One object comes back as {"data": {…}}, a list as {"data": […], "nextCursor": "…"}: pass ?cursor= for the next page (limit up to 50).
  • Errors come back as {"error": {"code", "message", "details"}} with the HTTP status below.
  • Prices are in centi-ads: 100 is one ad, 50 half an ad. One ad covers up to 20 seconds of video: 21 to 40 seconds count as 2 ads, 41 to 60 seconds as 3.
  • Limits: 300 requests a minute per key, and 20 renders a minute per workspace (shared with the app). Over the limit you get 429 with a Retry-After header.

Endpoints

MethodPathWhat it does
GET/projectsProjects, most recently changed first
GET/projects/:idA project with its current script (hook and line ids) and saved cast
GET/actorsThe looks you can cast; filters gender, age, setting, accent, q
GET/voicesVoices; filters language, gender, age, accent
POST/ads/quotePrice in ads and anything that blocks the render; nothing is charged
POST/adsRender ads (needs an Idempotency-Key)
GET/adsAds, newest first; filters projectId, status
GET/ads/:idOne ad; a ready ad has download links
GET/ads/:id/timelineA ready ad’s timeline: shots, on-screen text, captions, cut lines, music, and the voice under them
POST/ads/:id/timelineRender an edited timeline as a new version of the ad, free (needs an Idempotency-Key)
GET/static-adsStatic ads made in the Studio, newest first; filter projectId. Each has its 1:1, 4:5 and 9:16 files as PNG and JPEG links (1 hour)
GET/workspaceThe workspace the key belongs to, its plan, the languages it renders and the ads left

Render an ad, step by step

1. Find the project and its script

curl https://mimesays.com/api/v1/projects -H "Authorization: Bearer $KEY"
curl https://mimesays.com/api/v1/projects/PROJECT_ID -H "Authorization: Bearer $KEY"

The project's script has its id and the hooks (h1, h2…). Write and save scripts in the Studio.

2. Pick the actors

curl "https://mimesays.com/api/v1/actors?setting=kitchen&gender=female" -H "Authorization: Bearer $KEY"

Each actor has a lookId. The voice is matched to the look unless you pass a voiceId from /voices.

3. Get the price

curl https://mimesays.com/api/v1/ads/quote -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID","scriptId":"SCRIPT_ID","hookIds":["h1","h2"],
       "cast":[{"lookId":"LOOK_ID"}],"language":"en"}'

You get totalC, availableC and any blockers. Each look pays one ad per 20 seconds for its first hook, and half that for each extra hook. If a blocker asks for an acknowledgement, tick it in the Studio first, or send its id in complianceAck: {issueIds: […]} when you can substantiate the claim.

4. Render

curl https://mimesays.com/api/v1/ads -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"projectId":"PROJECT_ID","scriptId":"SCRIPT_ID","hookIds":["h1","h2"],
       "cast":[{"lookId":"LOOK_ID"}],"language":"en","captionStyle":"pop"}'

The answer is 202 with the new ads (status queued). The ads are held now and charged only when they are ready; a failed render costs nothing. Send the same Idempotency-Key again after a network error and you get the first answer back, never a second render. captionStyle and options.aiLabelVisible default to the project's Studio settings.

captionStyle is one of the Studio's 16 caption styles, or none for no captions: clean, pop, box, tiktok-outline, tiktok-dark, tiktok-light, insta-outline, insta-dark, insta-light, karaoke, word-pop, highlight, bold-caps, handwritten, typewriter, minimal.

5. Follow and download

curl https://mimesays.com/api/v1/ads/AD_ID -H "Authorization: Bearer $KEY"

status goes queued → rendering → composing → finalizing → ready (or failed, with an error). A ready ad has downloads: the MP4 with and without captions, VTT, SRT and a thumbnail. The links are signed and last an hour; ask for the ad again for new ones. The files stay as long as the ad exists. A webhook saves you the polling.

Edit an ad’s timeline

What the video editor changes, the API can change too. GET /ads/AD_ID/timeline gives the ad’s timeline (its shots over the voice, overlays for the text on screen, captions with any per-caption edits, and cuts for lines taken out), its music, the voice it runs over (segments, and lines with their times) and the rules an edit keeps. Send the edited timeline back and it becomes a new version of the ad:

curl https://mimesays.com/api/v1/ads/AD_ID/timeline -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"timeline": { …the timeline, edited… }, "music": {"mood": "chill", "volume": 0.8}}'

The answer is 202 with the new version (kind edit). It is free: the ad is composed again from what was already filmed, up to 30 renders a day per workspace (429 after that). The words stay as recorded: shots cover the voice from start to end, an actor shot only sits where that part was filmed, and a line can be cut out at its word gaps, never the hook. An edit that breaks a rule gets 422 with the reason.

Webhooks

Add an https address in Settings → API and webhooks and pick the events: ad.ready and ad.failed. We POST this JSON:

{
  "id": "evt_5b0e…",
  "type": "ad.ready",
  "created": 1793450000,
  "workspaceId": "…",
  "data": { "ad": { "id": "…", "object": "ad", "status": "ready", "projectId": "…", … } }
}

Answer with any 2xx within 10 seconds. Otherwise we try again after 1 minute, 5 minutes, 30 minutes, 2, 6 and 12 hours, then give up (the settings page can send it again). The same event can arrive twice: use its id to drop duplicates. The event carries no download links; fetch /ads/:id for them.

Check the signature

Every event is signed the Standard Webhooks way, so their libraries work as they are. Three headers come with it: webhook-id, webhook-timestamp (Unix seconds) and webhook-signature (v1, then the signature). The signature is HMAC-SHA256 of id.timestamp.body (the raw body, as received), keyed with your secret without its whsec_ prefix, base64-decoded, and written in base64. Refuse timestamps older than 5 minutes.

// Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';

function verify(secret, headers, rawBody) {
  const id = headers['webhook-id'];
  const ts = headers['webhook-timestamp'];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
  const expected = createHmac('sha256', key).update(`${id}.${ts}.${rawBody}`).digest('base64');
  return headers['webhook-signature'].split(' ').some((part) => {
    const sig = part.split(',')[1] ?? '';
    return sig.length === expected.length && timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
  });
}
# Python
import base64, hashlib, hmac, time

def verify(secret, headers, raw_body: bytes) -> bool:
    msg_id, ts = headers["webhook-id"], headers["webhook-timestamp"]
    if abs(time.time() - int(ts)) > 300:
        return False
    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{ts}.".encode() + raw_body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    return any(hmac.compare_digest(p.split(",", 1)[-1], expected)
               for p in headers["webhook-signature"].split(" "))

Send a test event in the settings page posts a test event (with "ad": null) and shows what your server answered.

MCP server

Agents such as Claude Code and Cursor can make ads for you through our MCP server: find the project, pick the actors, get the price, render, and fetch the downloads. It takes the same key as the API, on the same plan, with the same limits, and each tool answers what its endpoint above answers.

  • URL: https://mimesays.com/api/mcp (Streamable HTTP).
  • Header: Authorization: Bearer ak_xxxxxxxx_your_secret, as for the API.

Claude Code

claude mcp add --transport http mimesays https://mimesays.com/api/mcp \
  --header "Authorization: Bearer ak_xxxxxxxx_your_secret"

That keeps the key in your own Claude Code settings. Don't add it with --scope project, which writes it into the repository's .mcp.json.

Cursor

In ~/.cursor/mcp.json, your own settings rather than the project's:

{
  "mcpServers": {
    "mimesays": {
      "url": "https://mimesays.com/api/mcp",
      "headers": { "Authorization": "Bearer ak_xxxxxxxx_your_secret" }
    }
  }
}

It works with any MCP client that can send an Authorization header. Clients that connect by signing in with OAuth instead, such as claude.ai's custom connectors, can't use it yet.

Tools

ToolKeyWhat it does
get_workspacereadThe plan, the ads left, the languages it renders and what the key may do
list_projectsreadProjects, most recently changed first
get_projectreadA project’s current script (its hook ids) and saved cast
list_actorsreadLooks to cast; filters gender, age, setting, accent, q, and a limit
list_voicesreadVoices; filters language, gender, age, accent, and a limit
quote_adswriteThe price and anything that blocks the render; nothing is charged
create_adswriteRenders ads: spends the workspace’s ads
get_adreadStatus, progress and, once ready, download links in a format (1 hour)
make_ad_formatwriteA ready ad in 4:5, 1:1 or 16:9, made from what was filmed, free
list_adsreadAds, newest first; filters projectId, status
list_static_adsreadStatic ads made in the Studio, with PNG and JPEG links per size (1 hour)

write tools need a key that isn't read only. create_ads spends ads as POST /ads does: the price is held at once and charged as each ad turns ready, and a failed ad costs nothing. It takes an idempotencyKey (a UUID); without one the arguments make the key, so the same call sent twice returns the first batch (replayed: true) and is charged once. Send a new UUID to render the same request again.

A tool that fails answers with isError, the code and the message of the table below. Requests count toward the key's 300 a minute, shared with the API, and renders toward the workspace's 20 a minute.

For client builders: MCP 2026-07-28, and the initialize handshake of 2025-11-25 and 2025-06-18. Every answer is one JSON object (no SSE); there are no sessions, and GET answers 405.

Errors

StatusCodeWhen
401UNAUTHENTICATEDNo key, a wrong key or a revoked key
402INSUFFICIENT_ADSNot enough ads left for this render
403PLAN_LIMITThe workspace is not on the Agency plan (details.limit = "api"), has more brands than its plan allows ("brands") or has a failed payment ("payment")
403FORBIDDENA read-only key tried to quote or render
404NOT_FOUNDNo such project or ad in this workspace
409CONFLICTThe same Idempotency-Key with a different body
422VALIDATION_FAILEDA field is missing or wrong (details.issues), or no Idempotency-Key
422COMPLIANCE_BLOCKED / COMPLIANCE_ACK_REQUIREDThe script has a claim to fix or to acknowledge (details.blockers)
422TOO_LONGThe ad runs longer than the plan allows, or one part is too long to film (details.blockers)
429RATE_LIMITEDToo many requests; wait the Retry-After seconds
503PROVIDER_UNAVAILABLEA video or voice provider is down; try again later

© 2026 MimeSays · API v1 · Luigi Vitofrancesco · Via Salaria 3, 70033 Corato (BA), Italy · VAT IT08756230721 · support@mimesays.com ·