API reference
Base URL, authentication, ids, pagination, idempotency, errors and the OpenAPI spec.
Base URL
https://api.muzekit.com/v1Authentication
Every request needs a secret key: Authorization: Bearer mk_test_… or mk_live_…. A key only sees its own environment's data. See API keys. AI apps don't use keys: they connect through the MCP server with a Muzekit sign-in.
IDs
Ids are opaque strings with a prefix (tpl_, usr_, ver_, ast_, rnd_, bat_, shr_, ses_, ws_). Store them as strings.
Lists
List endpoints return { "object": "list", "data": [...], "has_more": true, "next_cursor": "tpl_…" }. Pass ?limit= (1 to 100, default 20) and ?after=<next_cursor> for the next page.
Idempotency
Send Idempotency-Key: <unique string> on any POST. Repeating the request within 24 hours returns the first response (with Idempotent-Replayed: true) instead of doing the work twice. While the first request is still running, a repeat answers 409 idempotency_in_progress; retry in a moment. A key used on a different endpoint answers 409 idempotency_key_reused.
Rate limits
600 requests a minute from one address, and of those up to 60 renders a minute per key (single and batch). Responses carry RateLimit headers; over the limit you get 429 rate_limited.
Test renders are free, so a Test environment can make up to 500 renders a day, 50 of them videos (429 test_renders_exhausted); render with your Live key for production.
Errors
See Errors.
Common flows
Each flow runs on your server with your secret key. Each step links to its endpoint, with examples there.
Onboard a user with their own library
- When the user signs up in your app, create the user with your own id. Keep the
usr_…id it returns. - Upload files into their library with
user: "usr_…", thenPUTthe bytes toupload_url. Their logo and photos are ready before they open the editor. - When they open the editor, create a session with the same
user.idand mount it on your page with the SDK.
Let a user fill in your template and get the files
- Your team makes a template in the dashboard, marks its fillable fields, and gives it a key such as
product-card(or set the key withexternal_id). - Create a session with
mode: "fill"andtemplate: "product-card". - The user's first change saves their own copy: you get the
template.createdwebhook, thentemplate.updatedon each save. Store thetpl_…id against your user to reopen it later. - Get the files: turn on Render on save to receive
render.succeededwith the file URLs, or create a render of the saved template when you need it.
Render personalized images in bulk
- List the template's parameters to get the keys a render can change.
- With a Live key, check your API credits cover the job.
- Create a batch with up to 100 items, one set of
modificationseach. - Follow it with List renders (
?batch=bat_…) or therender.succeededwebhook, and store each output URL beforeexpires_at.
Show a user their designs in your app
- List templates with
?user=usr_…for their designs and preview images. - When they pick one, create a session with
template: "tpl_…"indesignmode; saves update that design in place. - For a read-only preview or an approval step, open the same design with
mode: "view".
Match the editor to your pricing tiers
- Map each of your tiers to session choices:
features,formats,videoFormats,maxPages(example). - Pass them on every session your server creates. Your page can narrow them further, never widen them.
- Watch what it costs you: get the workspace for this period's sessions and credits, and get usage for what your users did each day.
OpenAPI
Download the OpenAPI spec (OpenAPI 3.1) for every endpoint on these pages. Import it into Postman, Insomnia or a client generator.