API Overview
Authentication, rate limits and conventions for Mosaic’s REST API.
Overview
Mosaic’s REST API allows you to kick off professional-grade video editing workflows (“Agents”) entirely from code. An agent is a pre-built graph of AI and rendering nodes that can do anything from audio enhancement to animated captions – you supply a video and optional parameters, Mosaic returns a polished result.
Typical flow
- Upload a video – Get a signed URL and PUT the bytes (
/video/get-upload-url
,/video/finalize-upload
). - Run an agent – Call
/run-agent
with thefile_id
you just created. - Track progress – Poll
/get-agent-run-simple/{id}
or subscribe to a webhook. - Download outputs – Fetch signed URLs via
/get-agent-run-outputs/{id}
.
Grab the full walk-through in the Quickstart.
Authentication
Mosaic supports two flavours of authentication:
1. API Keys (Production traffic)
Use an API key prefixed mk_
for all operational endpoints (/run-agent
, polling status, downloading outputs etc.).
2. Session Tokens (Developer Portal)
When you log in to the Mosaic dashboard you receive a short-lived JWT issued by Supabase. Use this to manage API keys and check your credit balance under the /api/dev
namespace.
Rate Limiting & Quotas
Plan | Concurrent Runs | Upload Size | Free Credits |
---|---|---|---|
Pro | 10 | 10 GiB | 20 000 |
Enterprise | custom | custom | custom |
Additional request-per-minute limits only apply to developer-portal endpoints.
Error Handling
Responses use conventional HTTP status codes. On errors the body contains a machine-readable error
field plus a human friendly detail
.
Status | Error Code | Typical Cause |
---|---|---|
400 | validation_error | Malformed JSON or missing field |
401 | invalid_api_key | Key revoked / wrong value |
403 | concurrent_agent_limit | > 10 running agents (Free plan) |
403 | insufficient_credits | Balance too low |
404 | not_found | Unknown ID |
422 | parameter_out_of_range | Field outside validation bounds |
429 | rate_limit | > 120 requests / min to /api/dev/* |
500 | internal_server_error | Unexpected exception |