How an edit runs
Upload, price, start.
Then fetch the result.
An edit takes the same path in the app, over REST and over MCP. Nothing is charged until you start a quoted edit, and the finished video lands privately in your Library.
The steps of an edit with their REST calls and MCP tools| Step | REST | MCP tool | What happens |
|---|
| Upload | POST /v1/uploads | create_upload | Returns a one-time upload link. PUT the file to it with the headers it names. |
|---|
| Or reuse | POST /v1/assets/from-library | use_library_video | Takes a finished edit from your Library as the source instead. |
|---|
| Check | GET /v1/assets/{id} | get_asset | Wait until the upload is ready; quote only with ready files. |
|---|
| Price | POST /v1/quotes | quote_edit | Prices your request, photos and quality in credits. Nothing is charged; the price holds for 15 minutes. |
|---|
| Start | POST /v1/jobs | start_edit | Starts the quoted edit and reserves its credits. An Idempotency-Key makes a retry return the same edit. |
|---|
| Follow | GET /v1/jobs/{id} | get_job | Status and confirmed progress, which reaches 100 only once the edited video is stored. |
|---|
| Fetch | POST /v1/jobs/{id}/result | get_result_link | A private link to the finished video, valid for one hour. |
|---|
REST quickstart
Four steps.
One edited clip.
Send your key as a bearer token. Bodies are JSON, ids are UUIDs and times are ISO 8601. The request below is the one behind the snowy forest at the top of this page.
# 1. Ask for an upload link
curl -X POST https://api.aisma.ai/v1/uploads \
-H "Authorization: Bearer $AISMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"video","contentType":"video/mp4","bytes":12345678}'
# Then PUT the file to uploadUrl with the headers it returns
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: video/mp4" \
--data-binary @clip.mp4
# 2. Price the edit once GET /v1/assets/ASSET_ID says ready (nothing is charged)
curl -X POST https://api.aisma.ai/v1/quotes \
-H "Authorization: Bearer $AISMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sourceId":"ASSET_ID","brief":"change the background to a snowy forest","quality":"720p"}'
# 3. Start it; the Idempotency-Key makes a retry return the same edit
curl -X POST https://api.aisma.ai/v1/jobs \
-H "Authorization: Bearer $AISMA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: first-edit-0001" \
-d '{"quoteId":"QUOTE_ID"}'
# 4. When GET /v1/jobs/JOB_ID says resultReady, get the one-hour link
curl -X POST https://api.aisma.ai/v1/jobs/JOB_ID/result \
-H "Authorization: Bearer $AISMA_API_KEY"
While Aisma is still checking a new clip, a quote answers 202 with retryAfterMs; ask again after that delay. Follow an edit no more often than every 10 seconds, or register a webhook and wait for it.
MCP server
Connect your assistant
with one address.
Add https://api.aisma.ai/mcp as a remote MCP server or custom connector in any assistant or coding agent that supports them. The server speaks Streamable HTTP without sessions and answers the protocol revisions 2025-11-25, 2025-06-18 and 2025-03-26.
The first call opens Aisma’s sign-in page (OAuth 2.1 with PKCE and dynamic client registration). There you choose what the connection may do and its monthly credit cap. You can disconnect it at any time under Profile → Settings & help → Connected apps and keys.
{
"mcpServers": {
"aisma": { "url": "https://api.aisma.ai/mcp" }
}
}
Prefer a key? Send it in the Authorization header as Bearer aisma_live_… instead of signing in.
New clips travel over HTTPS, never through the chat, so uploading one needs an assistant that can read your files, such as a coding agent with a shell. In a chat-only assistant, re-edit the videos already finished in your Library.
Sign-in
API keys or OAuth.
Your caps either way.
Personal API keys: create one in the web app under Profile → Settings & help → Connected apps and keys. A key starts with aisma_live_ and is shown once; Aisma keeps only its hash. Send it in the Authorization header as Bearer aisma_live_…, never in a link.
Connected apps: MCP clients and other apps sign in with OAuth 2.1 (authorization code with PKCE, rotating refresh tokens and dynamic client registration). Discovery starts at https://api.aisma.ai/.well-known/oauth-protected-resource.
Each key and connected app has its own scopes and a monthly credit cap, 300 credits until you change it, plus an optional cap per edit. Revoke a key or disconnect an app and it stops working at once.
Keys and connected apps need an account signed in with Google, Apple or email. Guest profiles can’t hold them.
The scopes a key or connected app can hold| Scope | Allows |
|---|
media:write | Upload videos and photos, and use Library videos as sources |
|---|
media:read | Check uploads and get links to finished videos |
|---|
jobs:read | See edit status and the Library |
|---|
jobs:write | Get prices and start edits that spend credits |
|---|
account:read | See the credit balance and limits |
|---|
webhooks:write | Register webhook endpoints |
|---|
Limits
What one edit
can carry.
- Video
- One clip of 2–60 seconds, up to 500 MB, MP4 or MOV, or a finished video from your Library.
- Photos
- Up to 10 per edit, JPEG, PNG or WebP, up to 20 MB each. Call them “photo 1”, “photo 2” in the request.
- Request
- Your own words, up to 2,000 characters.
- Result
- 720p by default or 1080p, with your original framing and audio, private in your Library.
- Price
- Credits, as in the app, quoted before you start. Current rates are on the pricing page.
- Rate limits
- Per key or connected app: 30 quotes a minute, 10 starts an hour, 120 reads a minute, 20 uploads an hour, 20 webhook changes an hour and 3 edits in progress. GET /v1/account reports yours.
- Headers
- Every response carries X-Request-Id and Aisma-Version; limited calls add RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset.
- Version
- 2026-10-19, in the Aisma-Version header.
Webhooks
Hear back
when an edit is done.
Register an HTTPS endpoint with POST /v1/webhooks (scope webhooks:write). Aisma sends job.completed, job.failed and job.settled for the edits the API started.
Deliveries follow Standard Webhooks: each carries webhook-id, webhook-timestamp and webhook-signature, an HMAC-SHA256 of the id, the timestamp and the body, signed with the secret you get once when you register. A failed delivery is retried for up to 24 hours. Following the edit with GET /v1/jobs/{id} stays the source of truth.
Errors
Every error
says what to do.
Every error is JSON in one shape, {"error": {"code", "message"}}, and the message is written for people. Include the X-Request-Id of the response when you write to us.
The error codes with their HTTP status and meaning| Code | HTTP | What it means |
|---|
invalid_request | 400 | A field or parameter is missing or invalid; the message names it. |
|---|
unauthorized | 401 | The key or token is missing, invalid or revoked. An MCP client signs in again. |
|---|
insufficient_credits | 402 | The balance doesn’t cover this edit. GET /v1/account returns the link to buy credits in Aisma. |
|---|
cap_reached | 402 | The key’s or app’s monthly cap, or its cap per edit, would be passed. |
|---|
forbidden_scope | 403 | The key or app wasn’t given the scope this call needs. |
|---|
not_found | 404 | No such upload, quote or edit on this account. |
|---|
quote_expired | 409 | The quote is older than 15 minutes. Ask for a new one. |
|---|
not_ready | 409 | The finished video isn’t stored yet. Keep following the edit. |
|---|
idempotency_mismatch | 409 | This Idempotency-Key was already used with a different body. |
|---|
rate_limited | 429 | Too many requests in this window. Wait for Retry-After. |
|---|
unavailable | 503 | Editing is briefly unavailable. Try again shortly. |
|---|
internal | 500 | Something failed on Aisma’s side. Retry, or write to support with the X-Request-Id. |
|---|