FreestyleDevelopers Open the app

Studio API v1

The Studio API v1 is the versioned REST API for apps, backends and other DAW user interfaces. It is the primary way to integrate with Freestyle from code. It uses the same OAuth tokens and scopes as the MCP server, enforces the same project roles and runs the same service code, so a change made through the API is the change the Studio would make. It has 406 operations in 31 resource groups.

Studio API or MCP? Use the Studio API when your code decides what to call (buttons, timeline gestures, sync jobs). Use MCP when an AI model decides (ChatGPT, Claude and other assistants). Both accept the same user token. See which one to use.

Getting started

  1. Get an OAuth client. Use the same authorization server as MCP. A public app (a desktop or single-page DAW, a script) registers itself with dynamic client registration and gets a fst_dcr_… client id. An organization's app is a partner app: its admin creates it in the console at /org/apps or with the MCP tool create_partner_app (scope organization:manage). Set its redirect_uris, its scope ceiling (allowed_scopes) and the browser origins that may open realtime sockets (allowed_origins). The fst_sec_… secret is shown once.
  2. Sign the user in. Run the authorization-code flow with PKCE and ask for the scopes your interface needs, for example projects:list projects:read projects:write daw:read daw:write media:upload exports:read audio:listen offline_access. Omit resource or send the MCP URL; one access token is valid on both /api/mcp and /api/v1. The user must have Pro access.
  3. Call the API with Authorization: Bearer fst_at_…. Access tokens last an hour; refresh them with the rotating refresh token.

Base URL

https://freestyle.audio/api/v1

Every path in the API reference is relative to this base. The OpenAPI 3.1 document is public: GET https://freestyle.audio/api/v1/openapi.json live from the server, and /docs/openapi.json as published with these docs. Generate a client from either.

A first request

export FREESTYLE_TOKEN=fst_at_…

curl -s https://freestyle.audio/api/v1/projects?limit=5 \
  -H "Authorization: Bearer $FREESTYLE_TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json
X-Request-Id: rq…
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 599

{"data": [{"id": "…", "title": "Night drive", "artist": "…", "bpm": 92, "role": "owner",
           "shared": false, "visibility": "link", "liveRoom": null, "updated_at": "…"}],
 "pagination": {"limit": 5, "hasMore": true, "nextCursor": "…"}}

shared means shared with you: true when your role is editor or viewer, the same rule as the "Shared with you" marker in Freestyle's library. A project you own is shared: false even when its visibility (its share setting: private, link or public) lets others in. liveRoom is the project's DAW sync room ({"code", "members"}) or null.

Then read one project, including its lanes, clips and tempo, and keep its ETag for later edits:

curl -si https://freestyle.audio/api/v1/projects/<project_id> \
  -H "Authorization: Bearer $FREESTYLE_TOKEN"

bpm in that reply is the tempo the project runs at and is never null; bpmSource says where it comes from: "set" (an explicit tempo), "backing" (nothing set, the backing's detected tempo) or "default" (nothing set or detected: 120 BPM, the engine's tempo for a new project). Pass bpm to createProject to start at another tempo, or change it later with setProjectTempo. The bpm in listProjects rows is only the stored explicit tempo (null = none set).

New projects stay put while you set them up. An account keeps at most 50 active and 10 empty projects; past that, each create quietly closes one least-recently-used project (empty ones first) instead of failing, and that project then answers 404. A project created, written, opened or attached to an engine session in the last 30 minutes is never the one closed, so a new draft stays readable while your UI opens it, even if the same account creates more projects meanwhile.

Next: the DAW UI guide walks through a whole editing session.

Scopes and roles

Every operation requires exactly one scope, the same scope as its MCP tool (the full list is on the Authentication page). Project operations also check the caller's role on the project, as the app does: viewers read, editors change, and only the owner deletes or shares. The reference lists the scope and role of each operation.

  • A project you cannot see answers 404 not_found, so ids cannot be probed.
  • A role that is too low answers 403 editor_required or 403 owner_required.
  • A token without the scope answers 403 insufficient_scope with details.requiredScope and an RFC 6750 WWW-Authenticate challenge. Ask the user to authorize again with that scope.
  • An account without Pro access answers 403 pro_mode_required.
  • An account that fails the entitlement check (the surface is disabled for it, or the account is quarantined) answers 403 chatgpt_app_access_required, for OAuth tokens and Studio sessions alike. If the entitlement authority cannot be reached the API fails closed with 503 auth_unavailable.
  • A Studio session for an account that has not chosen a username answers 428 username_required.

Conventions

  • Requests and responses are JSON. Send Content-Type: application/json with a body; a body that is not a JSON object is 400 invalid_json.
  • Paths use resource nouns. Actions that are not plain CRUD use a colon: POST /projects/{project_id}/clips:batch, POST /projects/{project_id}/lanes:reorder, POST /projects/{project_id}/timing-map:undo.
  • Response fields keep the casing of the shared service (so they match MCP). v1 adds fields such as timelineRevision but never renames or removes them.
  • Identifiers are opaque. Use ids the API returned; never build one.
  • Many engine operations accept an optional track_id: the take, clip or lane whose live engine session to use. Leave it out to use the project's default session.
  • Time units. Clip timing is wall-clock time on the project timeline, never musical time: start_ms (clip cards: startMs) is an integer number of milliseconds from the start of the project (bar 1, beat 1 = 0) to where the clip's audible region starts; duration_sec (durationSec) is the audible length in seconds (float), after trimming; audio_offset_sec (audioOffsetSec) is how many seconds into the source file the audible region begins (a left trim). So a clip plays source seconds [audio_offset_sec, audio_offset_sec + duration_sec) at timeline seconds [start_ms/1000, start_ms/1000 + duration_sec). Clip reads also carry sourceDurationSec, the full length in seconds of the clip's source audio file (null when unknown): a slip toward later audio or a right-edge un-trim stays within audio_offset_sec + duration_sec <= sourceDurationSec. A few older clips already end slightly past their file (the tail plays as silence); do not extend those further. Fields named *_frame / *_frames are sample frames at the engine's sample rate (unless a sample_rate says otherwise), tick fields are 96 PPQ through the project's tempo map, and *_measure / bars are 1-based. A tempo change never moves a clip's start_ms; convert with convertMusicalTime.

Errors

Every failure uses one envelope, including 401, unknown routes, 429 and 500:

HTTP/1.1 400 Bad Request
X-Request-Id: rq…

{"error": {"code": "invalid_op",
           "message": "ops[1]: op must be update|insert|remove|restore.",
           "stage": "validation",
           "details": {"opIndex": 1},
           "requestId": "rq…"}}
FieldMeaning
codeStable, machine-readable reason. Branch on this. The codes are the ones MCP returns for the same failure.
messageA sentence for people. Do not parse it.
stageWhere it failed: auth, validation (nothing ran), precondition (a revision or If-Match did not match), rate_limit, engine_dispatch (the call to the engine did not complete), engine (the engine answered and refused) or internal.
detailsExtra fields for this failure, for example opIndex, currentRevision, requiredScope, retryAfterSec, bucket, requiresConfirmation, skipped_lanes.
engineStatusThe Mozart engine's HTTP status, when known.
requestIdSame as the X-Request-Id header. Quote it when you report a problem.

Codes and HTTP statuses

The status follows the code. Revision conflicts are always 412. A failure inside the engine is 502 (or 504 engine_timeout). Services can return codes that are not listed here (for example track_limit or invalid_url); they keep the service's status.

HTTPCodes
400action_mutates audio_invalid confirmation_required duplicate_mix_change engine_invalid_arguments guardrail_refused idempotency_key_required invalid_argument invalid_count_in invalid_cursor invalid_edits invalid_expected_mix_revision invalid_expected_value_norm invalid_idempotency_key invalid_json invalid_launch invalid_mix_change invalid_op invalid_request invalid_slot invalid_timing_map invalid_track_kind invalid_url lane_not_audio project_empty project_import_invalid project_metadata_contains_file query_is_link region_too_long replace_import_unsupported restore_state_invalid song_preset_invalid unsupported_mix_field username_mismatch youtube_import_too_long
401unauthorized
403chatgpt_app_access_required editor_required forbidden insufficient_scope oauth_grant_revoked owner_required peer_delegation_write_required plugin_not_in_plan pro_mode_required project_write_forbidden recording_delegation_required recording_take_owner_mismatch
404backing_not_found beat_not_found export_job_not_found import_job_not_found job_not_found mix_target_not_found no_backing_track no_custom_lyrics no_track no_waveform not_found recording_take_not_found session_not_found stem_job_not_found track_not_found waveform_unavailable
405method_not_allowed
409automation_exists clip_changed clip_not_found count_in_cancelled count_in_refused edit_in_progress editor_not_available editor_not_open engine_conflict engine_unavailable engine_update_required export_in_progress id_exists idempotency_in_progress idempotency_key_used in_place_unsupported_source lane_has_no_live_chain loop_region_required lyrics_retrying master_effects_not_supported mix_apply_partial mix_persist_unavailable no_audio_loaded no_source_lane not_armed nothing_to_undo plugin_instance_mismatch plugin_instance_not_found preset_not_supported project_track_limit recording_in_progress recording_take_pending session_loading source_encrypted_unsupported source_not_durable stale_preview_request state_conflict stem_job_running studio_busy_on_other_project target_not_found target_not_loaded tempo_map_not_constant tempo_stretch_in_progress timing_map_nothing_to_undo too_many_previews track_limit transport_rolling would_clip
411content_length_required
412conflict markers_revision_conflict mix_revision_conflict plugin_parameter_conflict precondition_failed revision_conflict timeline_revision_conflict timing_map_revision_conflict timing_map_revision_mismatch
413file_too_large payload_too_large source_too_long_for_in_place upload_too_large
415unsupported_media_type
422db_curve_gain_only idempotency_key_reused invalid_automation recording_take_rejected recording_take_silent target_not_on_lane
428expected_revision_required username_required
429rate_limited upload_concurrency upload_quota
451mozart_region_restricted region_restricted
500internal_error lyrics_save_failed play_not_recorded
502action_failed audio_add_failed audio_import_error backing_attach_failed download_failed engine_error engine_forbidden engine_rejected engine_route_not_found engine_unreachable project_import_failed
503auth_unavailable editor_frame_unavailable engine_restarting engine_session_contended engine_session_not_found enterprise_unavailable overloaded rate_limit_unavailable revision_unavailable service_unavailable stem_extraction_disabled storage_ledger_not_activated
504engine_timeout

A few statuses deserve a note:

  • 405 method_not_allowed: the path exists but not with this method. The Allow header lists the methods it supports (and OPTIONS answers with the same list).
  • 428 expected_revision_required: the operation needs a revision (If-Match or expected_revision) and none was sent. Read the resource and send its ETag. 428 username_required: see above.
  • 503 revision_unavailable: the server could not read the current revision to check your If-Match, so it applied nothing (it fails closed rather than risk overwriting). Retry shortly.
  • A failure without a specific code gets a stable code for its status, for example 409 state_conflict, 411 content_length_required or 413 payload_too_large.

Other statuses you can see: 413 file_too_large, 429 upload_quota / upload_concurrency and 503 overloaded / storage_ledger_not_activated on uploads (see limits).

Request ids

Every response, successful or not, carries X-Request-Id. Error bodies repeat it as error.requestId. Log it with your own request so a failure can be traced end to end.

Idempotency-Key

Every mutation that can be retried safely accepts an Idempotency-Key header. Send a new random key (8 to 128 characters of [A-Za-z0-9._:-], for example a UUID) for each logical action, and the same key when you retry it.

  • The key is scoped to your user, your app, the operation and the path.
  • Only deterministic outcomes are stored (for 24 hours): 2xx, and 400, 403, 404 and 422. Any other outcome (409, 412, 428, 429, 5xx) releases the key, so a retry with the same key really runs again, for example after a fresh read or after Retry-After.
  • A retry of the same request (same JSON body, query string and If-Match) with the same key replays the stored response with Idempotent-Replayed: true. Nothing runs a second time.
  • A replayed body never contains signed or credentialed URLs: such …Url fields are null and the body has signedUrlsOmitted: true. Read the resource again (for example getExportStatus) for a current link.
  • The same key with a different request is 422 idempotency_key_reused. A retry while the first request is still running is 409 idempotency_in_progress with Retry-After. A request still marked in progress after 600 s is treated as abandoned (for example after a server crash), and a retry then runs.
  • Some operations require a key and refuse a request without one with 400: uploads (uploadAudio, code idempotency_key_required) and sample edits (editClipSamples, undoClipSampleEdit, which need 16 to 128 characters). For range edits the key also seeds the new clip ids, so a retry produces the same ids.
curl -X POST https://freestyle.audio/api/v1/projects/<project_id>/exports \
  -H "Authorization: Bearer $FREESTYLE_TOKEN" \
  -H "Idempotency-Key: 7f6c2a52-6d0e-4c1e-9a55-2b0f0f6e0c11" \
  -H "Content-Type: application/json" -d '{}'

Revisions: ETag, If-Match and 412

State that several editors can change has a revision, returned as an ETag. Send it back as If-Match on the next write. If someone else changed the state in between, nothing is applied and the answer is 412 with the current revision, so you can reload and try again instead of overwriting their work.

RevisionRead fromGuardsConflict code
Timeline revision (lanes, clips, patterns, placements)ETag of getProject, listLanes, listClips; the timelineRevision field and ETag of every timeline mutationapplyClipBatch, editTimeRange and other timeline writestimeline_revision_conflict (details.currentRevision)
Clip source revisionETag of getClipWaveformeditClipSamples, undoClipSampleEdit (required)revision_conflict (details.current_revision)
Timing-map revisionETag of getTimingMapsetTimingMap, undoTimingMap, setProjectTempo, tick-based seek and setLooptiming_map_revision_conflict; from the engine on tick-based seek / setLoop, timing_map_revision_mismatch (details.current_revision)
Mix revision (lane gain / pan / mute / solo / routing, master gain, bus gain / mute / solo)ETag: "mix-<n>" and mixRevision of getEngineMix, waitEngineMix and every mix writeMixer, bus and routing writes, mix:apply, typed engine actions (header only). See Mixing safely.mix_revision_conflict (details.currentMixRevision)
Plug-in parameter valuevalueNorm from listLanePluginParameters / getLanePluginStateexpected_value_norm on setLanePluginParameterplugin_parameter_conflict (details.currentValueNorm)
Per-op expectationsThe clip fields you readAn op's expected object in applyClipBatchconflict
  • If-Match: * means "no precondition". Weak (W/) and quoted forms are accepted.
  • On reads, send the last ETag as If-None-Match; an unchanged resource answers 304 with no body. Poll cheaply this way.
  • Where a revision is mandatory (sample edits, for example) and you send none, the answer is 428 expected_revision_required. If the server cannot read the current revision, it answers 503 revision_unavailable and applies nothing.
  • Engine conflicts keep the engine's status in engineStatus; the current revision is in details.current_revision.
  • Where the service has its own field (expected_revision, timing_map_revision), you can send that in the body instead of the header.

Pagination

List operations return a page and a cursor:

{"data": [ … ],
 "pagination": {"limit": 50, "hasMore": true, "nextCursor": "eyJ…"}}
  • limit defaults to 50, maximum 200.
  • Pass nextCursor back as cursor with the same filters until it is null. A cursor is bound to the operation and its filters: changing a filter, or sending a cursor from another list, is 400 invalid_cursor.
  • Cursors are opaque. Do not decode or build them.

Destructive operations: the DELETE / confirm rule

Rate limits

The Studio API has its own budget, separate from every MCP budget:

ClassBudgetUsed by
interactive600 requests per minute per user, and for OAuth apps also 600 per minute per (app, user), so one user of your app can never use up the app for everyone else. First-party Studio sessions pay no app bucket.Almost every operation: reads, edits, transport, mixer, exports, uploads, polling. Not counted as Mozart AI usage.
wait120 requests per minute per user (and 120 per (app, user) for OAuth apps) instead of the interactive budget, plus at most 2 waits in flight per user and 32 per server (429 with Retry-After beyond)Long-polls that hold the request until something changes: waitEngineMix.
aiThe interactive budgets plus the Mozart AI per-minute and daily quotaOnly operations that invoke a model, or that MCP meters the same way: applyRegionEffect, previewRegionEffect, mozartAiCommand, engine_add_808, engine_add_drum_hits, engine_add_groove, engine_add_hat_rolls, engine_add_instrument_track, engine_adjust_volume, engine_align_to_beat, engine_analyze_harmony, engine_analyze_song_sections, engine_audit_arrangement, engine_audition_patch, engine_compose_song, engine_detect_tempo, engine_find_sounds, engine_find_splice_sounds, engine_listen, engine_listen_back, engine_mix_check, engine_read_skill, engine_refine_song, engine_remove_track, engine_replace_stem_part, engine_restore_original, engine_search_patches, engine_separate_stems, engine_set_instrument_patch, engine_set_patch, engine_set_pattern_steps, engine_song_brief, engine_stem_status, engine_swap_sound, engine_write_pattern_notes. Undo and job polling stay interactive.

There is no app-wide hard limit: app-wide volume above 6000 requests per minute only alerts Freestyle and never refuses a request.

Expensive server work has dedicated per-user budgets on top of the interactive one. They apply to every account:

BudgetDefaultOperations
Fetches (details.bucket fetch)30 per hour per useraddAudioFromUrl, and createProject with a YouTube or URL source
Exports and renders (details.bucket export)60 per hour per userexportMix, and the render_share and render_live_window engine actions
Splice searches (details.bucket external_search)120 per minute per usersearchCatalogSpliceSounds, previewCatalogSpliceSound
Sound previews (rate_limited, with Retry-After)120 preview requests per minute and 900 distinct sounds per hour per user, shared with Studio playback (previewing the same sound again within the hour is free)previewCatalogSound
Stem splits1 per 5 minutes, 2 per hour and 10 per day per user, shared with the StudiosplitClipStems (refunded when no GPU job was queued)
Listening renders60 per hour per user, shared with MCPlistenToProject

Responses carry X-RateLimit-Limit and X-RateLimit-Remaining for the per-user bucket. An exhausted budget answers 429 rate_limited with Retry-After (seconds) and details.bucket (user, app_user, fetch, export or ai). Wait at least that long. Uploads and sample edits have their own quotas; all budgets are on Rate limits & errors.

Engine actions and live state

Every live-engine action of the Pro catalog is available as typed REST, for anything the dedicated resource groups do not cover.

  • Catalog. GET /engine/actions lists each action with its typed argument schema, family, risk, whether it mutates, the scope and project role it needs, its rate class and the operation that runs it. Filter with family or mutates.
  • Typed operations. Each action has its own operation, POST /projects/{project_id}/engine/actions/<action>, with the operationId engine_<action> and the action's argument schema as the request body. A generated client therefore gets one typed method per action. The generic POST …/engine:execute takes {action, arguments} and runs any action by name with the same rules. Unknown argument keys are rejected with 400, as the typed schemas declare.
  • Rules. Only an explicit list of pure reads (transport, clock, session and history status, track, bus and plug-in reads, waveforms, patterns and the timing map) need just daw:read and the viewer role; the catalog marks them. Every other action needs daw:write and the editor role and takes an Idempotency-Key. That includes analysis tools that render audio, call a model or write project notes (such as listen, mix_check and song_brief). Destructive actions need confirm=true. Actions are interactive and never counted as Mozart AI usage, with two exceptions: the generative compose family, stems included, pays the AI quota as on MCP (for a deterministic split use the typed, interactive splitClipStems instead; stem_status is a pure read), and offline renders (render_share, render_live_window) pay the export budget, like exportMix. The engine's own error codes and HTTP status come back in the envelope (error.code, error.engineStatus).
  • Live state. GET …/engine/state returns session, transport, tracks, live clips with their ids, buses, history status, patterns and the mix in one read. GET …/engine/tracks and GET …/engine/mix read just the tracks or just the mix; the mix carries its revision (see Mixing safely). A typed engine action that writes the mix accepts the mix If-Match too.
  • MIDI audition. POST …/engine/midi plays notes now: one note, or events (1 to 64) with note 0 to 127, action note_on or note_off, velocity 0 to 1 and channel 1 to 16. Malformed input is rejected before the engine. …/engine/midi:allNotesOff silences an instrument.
  • Recording. POST …/recording:start, GET …/recording and POST …/recording:finalize (needs confirm=true). The take's audio never travels through this API: the client streams its microphone to the engine on its own WebRTC uplink (POST …/live-ingest/offer) and marks the take with take_start / take_stop on the uplink's data channel; finalize saves it by take_id. The take is recorded as you, and scanned and promoted to a clip exactly like a take recorded in the Studio. A count-in (count_in_beats) returns at its boundary. To add an existing audio file instead, use uploadAudio or addAudioFromUrl.
  • Engine history. GET …/history, POST …/history:undo and POST …/history:redo expose the Studio's undo log.
    • It holds only edits the Studio recorded. Edits made through this API are not in it, so history:undo never reverts them.
    • history:undo and history:redo only move the log's cursor and return the entry. Your client must apply that entry's before or after state, as the Studio does.
    • To undo your own API edits, use the undo objects they return: undo from clip moves, undo.inverse_ops from time-range edits and region effects (post them to clips:batch), sample-edit undo, timing-map undo, undo.before and undo.restoreToken from pattern-placement deletes (post both to :restore, which brings back the same placement id with its automation; the token is signed, bound to that deletion and your account, and valid for 24 hours) and ai:undo. Channel Rack writes (addPatternChannel, updatePatternChannel, deletePatternChannel) answer undo: {method, path, body, timelineRevision}: send body to path (relative to /api/v1) with method, exactly as it is, with If-Match: timelineRevision. The older op fields are still there, and posting the whole undo object as a body is accepted (op, method, path, body and timelineRevision are ignored). assignPatternChannelToNewTrack answers undo.steps: two such requests, run in order. An audio import (uploadAudio / addAudioFromUrl, which make a lane) is undone with deleteLane: the lane also leaves the running engine session at once (liveEngine.applied), so it stops sounding and drops out of getEngineState / listEngineTracks; :restore brings it back and reloads its clips into the session.
    • Send an Idempotency-Key so a retry never steps twice.

Mixing safely

A Studio user mixes directly on the live engine, so an agent's write can land on a fader a person just moved. The engine keeps one mix revision that every mix change bumps, whoever made it (the Studio's direct fader, pan, mute, solo and routing moves, other agents, the WebRTC control channel, a session reload; lanes and buses added or removed). Automation playback and meters never bump it. Use it as a compare-and-set:

  1. Read GET …/engine/mix: master gain, every lane's gain, pan, mute, solo and bus, every live bus's gain, mute and solo, mixRevision, and ETag: "mix-<n>".
  2. Write with If-Match set to that ETag (or send expected_mix_revision in the body) on setLaneGain, setLanePan, setLaneMute, setLaneSolo, setLaneRouting, setMasterGain, setMasterPan, setBusGain, setBusPan, setBusMute, setBusSolo and the mix fields (volume, pan, muted, soloed) of updateLane (there, If-Match: "mix-<n>" is the mix precondition and any other If-Match is the timeline revision). The engine compares and applies under one lock, so if anyone changed the mix since your read, nothing is applied and the answer is 412 mix_revision_conflict with details.currentMixRevision. A successful write answers the new mixRevision and ETag, ready for your next write.
  3. Move several controls at once with POST …/engine/mix:apply: {"changes": [...]} with up to 64 of {"target": "lane", "lane_id", "gain"?, "pan"?, "muted"?, "soloed"?, "bus_id"?}, {"target": "master", "gain"?, "pan"?} and {"target": "bus", "bus_id", "gain"?, "pan"?, "muted"?, "soloed"?} (bus_pan / master_pan are accepted as aliases of pan on bus / master changes). Every change is validated before any applies (one value per control; gain 0 to 4, pan -1 to 1), and the whole move is one revision step. response.undo_changes is the inverse batch: send it back to mix:apply with the new ETag to undo the move as one step. The Studio's native history is client-logged, so the move is not added to it.
  4. Wait for changes instead of polling: GET …/engine/mix:wait?if_none_match=<n>&wait_ms=10000 returns the new mix as soon as the revision differs, or 304 after wait_ms (at most 10 s; at most 2 waits in flight per user and 32 per server, 429 + Retry-After beyond). It has its own wait rate class and holds no database connection while waiting. getEngineMix with If-None-Match answers 304 while nothing changed.
  5. Plug-in parameters: send expected_value_norm (the valueNorm you read) with setLanePluginParameter, plus expected_plugin_instance_id to pin the slot. If the parameter moved by more than 1e-4, the write is refused with 412 plugin_parameter_conflict (details.currentValueNorm). Hosted plug-ins are compared on the engine in the same step as the write; native effects under the engine's parameter-write lock.

What is saved. Lane faders are saved with the project like the Studio's (setLaneGain and mix:apply lane gains write the lane's volume, which get_project shows and a reload restores; the beat writes backing_gain), unless you pass persist: false while sweeping. Lane pan and master gain are saved the same way; lane mute and solo write the same lane and clip rows as the Studio's M/S buttons. Bus pan and master pan (equal-power balance after the bus or master fader, smoothed) are live session state: a reopened project starts centered.

Pattern lanes. setLaneMute / setLaneSolo on a pattern lane mute its placements exactly like the timeline row's M/S (so the Studio's button lights) and the lane's own mixer track in the engine, so getEngineMix shows it and mix:wait wakes. When a Studio user clicks the row's M/S instead, the lane row and its mixer track follow the placements, so the two never disagree: unmuting from either side unmutes both. mix:apply takes pattern-lane mute/solo too (a lane with trackType: "pattern"), with the same effects: the mixer track flag, the placements' mute/solo rows and the engine's realtime placement filter change in the same mix revision as the rest of the batch. Soloing a pattern lane also unmutes it (as the button does) unless the same change names muted, so response.results may carry an extra muted row and undo_changes restores both. The reply's patternRuntimeMuted lists the lanes and placements written; sameRevision: false means an older engine applied the placement filter as one extra revision step (the reply's mixRevision / ETag is already the latest). A legacy rack lane with placements but no mixer track is still 400 unsupported_mix_field: use setLaneMute / setLaneSolo there.

db_persisted in mix:apply results. Each response.results[] row says whether that control was saved with the project: true for a lane gain (unless persist: false), lane pan, routing, master gain and lane mute/solo; false for live-only controls (bus gain/mute/solo, bus and master pan, persist: false sweeps) and for a change that failed.

Older engines. A live engine that predates mix revisions reports mixRevision: null and no ETag. A write that carries If-Match, expected_mix_revision or expected_value_norm is then refused with 409 engine_update_required and nothing is applied: the API never drops a precondition and writes anyway. The same writes without a precondition keep working. The Studio itself never sends a precondition, so it is unaffected.

Catalog, plug-ins and instruments

Three resource groups let an interface browse what it can use and add it to a project without MCP. They follow every convention above; the notes below are what is specific to them.

Plug-in catalog

  • listPluginCatalog lists every plug-in a lane or bus can host by catalog id, with its kind (effect or instrument), format (vst3 or native), category and preset catalog. Filter with kind, format and q. With project_id (editor role) instrument availability is checked on that project's engine host; native effects are always available, and hosted effects report installed: null because the engine has no probe for them. include_presets=true inlines the named presets of plug-ins that have a preset catalog (Nectar, AutoTune); getCatalogPlugin reads one entry.
  • addLanePlugin appends a plug-in to a lane by catalog id, exactly as the Studio's add-plug-in menu does (the plug-in gets an instance id and survives a reload). It answers 201 with pluginIndex and instanceId. position (alias plugin_index, 0-based) inserts it at that slot in the same request instead of appending; the plug-ins from that slot on move down one, live and in the saved chain. Instruments are refused here (400 invalid_track_kind; create an instrument lane instead), and so are vocal suites on instrument lanes. addBusPlugin does the same for a bus, the master bus included (hosted effects only; see Master effects). Limitation: the engine has no add-by-catalog-id for buses, so the plug-in must be installed at its catalog location on the project's engine host. Otherwise the answer is 409 plugin_not_installed_on_host, and host paths are never echoed.
  • Host file paths are never accepted. A body with path, plugin_path or a similar field, or a plugin_id that looks like a path or a bundle name, is 400 invalid_argument with details.refusedFields, and nothing reaches the engine. Responses never contain host paths either.
  • deleteLanePlugin removes the plug-in in one slot. The server reads the slot's instance id in the same request and removes that instance, so a stale index never removes another plug-in. Send expected_plugin_type to also pin the catalog id; a mismatch is 412 precondition_failed with details.currentPluginType. As with every ordinary DELETE, no confirm is needed. The remaining plug-ins move up one slot, and the saved chain is renumbered the same way, so positions never collide.
  • Undoing a plug-in delete. deleteLanePlugin and deleteLanePluginInstance answer removed.restore (PluginRestoreState): the plug-in's typeId, name, bypassed, the position it held and its state, an opaque base64 blob (a hosted plug-in's saved chunk, read from the running plug-in just before the delete; for a native effect, its parameters and EQ curve). removed.restore.addLanePlugin is the ready-made body: post it to addLanePlugin (plugin_id, state, bypassed, position, instance_id) and the plug-in comes back in the same slot, under the same instance id, with exactly its settings, restored the way a saved chain is restored on load. state is at most 4 MiB (413 payload_too_large; a larger state is returned as null with stateOmitted: "too_large"), and an instance_id the lane already has is 409 plugin_instance_exists.
  • listLanePluginParameters and listBusPluginParameters discover a slot's parameters: a host-stable id (index:N when the host has none), name, unit, range (normalized 0 to 1, the unit setLanePluginParameter takes; native slots add rawMin / rawMax), steps when the host reports it, default and the current value. They are paginated; the slot summary (name, catalog id, instance id, current program) is in plugin. Use the index for writes and the id as the durable identity.
  • Slot preconditions. A slot index is a position, not an identity. setLanePluginParameter, setLanePluginBypassed, applyLanePluginPreset and setLanePluginProgram accept expected_plugin_instance_id and expected_plugin_type (the instance_id / type_id from listLanePlugins). If the slot now holds another plug-in, the answer is 409 plugin_instance_mismatch with details.currentInstanceId and details.currentPluginType, and nothing is written. The engine write is pinned to the instance the server just checked, so a plug-in swapped in during the request is refused too.
  • Editor windows. After openPluginEditor, poll getPluginEditorFrame for the window as a JPEG (editor role; at most 2 frame requests in flight per user, more get 429). Send the last X-Editor-Revision as if_revision with wait_ms to get 304 until the frame changes; the engine answers as soon as an input event has reached the editor and it repainted, so request the next frame as soon as one arrives. For frames pushed without a round trip per frame, subscribe on your monitoring WebRTC peer (Live plug-in editor frames). Drive it with sendPluginEditorPointer (down, move, up with one gesture_id, coordinates normalized 0 to 1), sendPluginEditorScroll and sendPluginEditorKeys (editor role). A pointer up, a scroll and keys are confirmed by their effect: a plug-in parameter or the editor's pixels changed. Otherwise the answer is ok: false with code: input_unconfirmed; an event that was only handed to a window is never reported as delivered. code: not_hit_testable (delivery: "rejected") means nothing was sent: the engine host could not make the slot's editor the window under the pointer (another window covers it, it is off-screen or minimized, or the host's display is locked). Re-open the editor with openPluginEditor and retry; repeating the same event does not help. no_editor_view means the point hit no view inside the editor (outside its content), and dispatch_failed means the host refused the event. None of these is retried by the server. The frame always comes from the slot's own editor window (X-Editor-Window-Id, X-Editor-Plugin-Instance-Id). X-Editor-Frame-Stale: 1 means the parameters moved but the editor did not repaint. No open editor is always 409 editor_not_open. These use their own rate class. Close with releasePluginEditor. Built-in (native) effects have no editor window: their rows carry hasEditor: false and editor requests answer 409 editor_not_available (final; use listLanePluginParameters instead). plugin_index on every editor route is the index listLanePlugins reports; on an instrument lane, index 0 is the instrument itself, so …/plugins/0/editor:open opens the instrument's editor.
curl -X POST https://freestyle.audio/api/v1/projects/<project_id>/lanes/<lane_id>/plugins \
  -H "Authorization: Bearer $FREESTYLE_TOKEN" \
  -H "Idempotency-Key: 0b8f7a1e-2c55-4c0e-8d1f-7e7c1f3a9d42" \
  -H "Content-Type: application/json" -d '{"plugin_id": "native-reverb"}'

Master effects

The master bus has a real insert chain. Address it as bus_id master on the bus plug-in routes, exactly like any other bus. It processes the final mix (every lane, every bus and the beat) before the master fader and pan and before the output limiter, both in live playback and in exports (the engine render behind render_share; stems and pattern bounces are not master-processed).

  • Add with addBusPlugin (hosted effects by catalog id, the same ones a bus takes; position inserts at a slot, bypassed creates it bypassed). The answer carries pluginIndex, instanceId and persisted.
  • List the live chain with listBusPlugins (index, name, type_id, instance_id, bypassed, hasEditor, chainLatencySamples) and the saved one with getBusPluginState or listBuses (the master entry's pluginChain).
  • Change it with moveBusPlugin, setBusPluginBypassed, listBusPluginParameters / setBusPluginParameter.
  • Remove and undo. deleteBusPlugin answers removed (BusPluginRestoreState: instance id, catalog id, bypass, slot and the plug-in's saved chunk with its stateSignature, read from the running plug-in just before the delete) and undo, the addBusPlugin request that puts it back in the same slot under the same instance id with the same settings. Only a state a bus delete issued is accepted back (400 restore_state_invalid); a state over 4 MiB is omitted (stateOmitted: "too_large"). This works on every bus.
  • Editors. Hosted master inserts have the full editor contract under …/buses/master/plugins/{plugin_index}/editor: openBusPluginEditor, getBusPluginEditorFrame, sendBusPluginEditorPointer, sendBusPluginEditorScroll, sendBusPluginEditorKeys, getBusPluginEditorStatus, closeBusPluginEditor, releaseBusPluginEditor, with the same semantics as the lane editor routes above. Other buses have no editor routes (409 editor_not_available, details.reason: "bus_editor_not_supported"); a built-in master processor has no editor (409 editor_not_available).
  • Saved automatically. The engine saves the master chain itself (order, bypass and the plug-in state, which is captured about 1.5 s after the last parameter or state edit) and restores it on every session load; project copies and project saves carry it. saveBusPluginState on master only refines a saved insert (its fields merge); an unknown plugin_key is 404 not_found.
  • Latency. A master insert that reports latency delays the whole output equally, so nothing in the mix drifts against anything else. It counts as output latency: getTransportClock producer_latency_seconds includes it (draw the playhead with it, see Realtime), and exports compensate it, so the file stays sample-aligned with the timeline.
  • Older engine hosts. A project whose engine host predates master effects answers master plug-in requests with 409 master_effects_not_supported (details.reason: "engine_outdated"); retry after the host is upgraded.
curl -X POST https://freestyle.audio/api/v1/projects/<project_id>/buses/master/plugins \
  -H "Authorization: Bearer $FREESTYLE_TOKEN" \
  -H "Idempotency-Key: 6f1d2c3b-4a5e-4f60-8172-93a4b5c6d7e8" \
  -H "Content-Type: application/json" -d '{"plugin_id": "tdr_kotelnikov"}'

Instruments

  • listInstrumentCatalog lists instrument generators by catalog id with their captured patch catalog (LABS, Omnisphere, Splice INSTRUMENT, Xpand!2), creatable, and, with project_id, host availability.
  • createInstrumentLane creates an instrument lane with a catalog instrument loaded, the same flow the Studio uses. preset names a patch from its catalog; role and articulation pick one by role. It runs no audition renders and writes no notes: add musical content afterwards. Like other lane writes it honours If-Match (timeline revision) and returns the new revision as ETag and timelineRevision.
  • replaceLaneInstrument (PUT …/lanes/{lane_id}/instrument) swaps the instrument of an existing instrument lane in place, like the Studio's Sound Library replace: the new instrument is loaded and saved first, then the old one is removed, so a failed load leaves the lane as it was. The lane keeps its id, name, row, patterns, notes, pattern clips, effects, sends and mix; its pattern channels keep playing it. instrument_id is a creatable catalog id and preset optionally names a patch from the new instrument's catalog. The answer names previousInstrument and carries undo ({method, path, body}): send body to path with method and If-Match to put the previous instrument back with its exact saved sound (body.restore_state is signed and only accepted for that instrument). The new instrument sits at plug-in index 0 (pluginIndex). The same instrument with no preset is replaced: false and changes nothing. It honours If-Match and returns the new revision.

The catalog group is read-only search over the libraries the user can reach, one operation per kind of item, each with the scope of the matching MCP tool: sounds (browseCatalogSounds, auditioned without touching a project through previewCatalogSound, which returns a short-lived credential-free previewUrl served straight from media storage), Splice (searchCatalogSpliceSounds, previewCatalogSpliceSound), effect presets (listCatalogEffectPresets), vocal chain presets (listCatalogVocalChainPresets, getCatalogVocalChainPreset), plug-in presets (listCatalogPluginPresets, getCatalogNectarPreset, listCatalogPresetPackItems), drum kits (listCatalogDrumKits), beats (searchCatalogBeats) and the marketplace (browseCatalogMarketplace, listCatalogMarketplaceFeed).

  • Results hold only what the user may see. A project_id or song_project_id filter checks the project role first, so another user's project is 404 not_found.
  • Every list uses the cursor pagination above. Beats, the marketplace feed and preset pack items page through the source's own pages (their limit maximum is lower: 25, 50 and 100), and the page size is part of the cursor. The other lists return one bounded window of results that you page with the cursor; narrow the query to see past it.
  • The marketplace feed order is fixed by seed (default 0), so pages never repeat or skip; another seed reshuffles.
  • Preview and cover URLs can be short-lived. These operations are all GETs, so a response is never stored for an Idempotency-Key replay; read again for a fresh link.

Versioning

  • The major version is in the path: /api/v1. Within v1, changes are additive only: new operations, new optional parameters, new response fields and new error codes. Ignore fields you do not know, and handle an unknown code by its HTTP status.
  • Fields are never renamed or removed, and types are never changed, within v1. Such a change needs a new major version path.
  • info.version in the OpenAPI document tracks the published contract. The document is generated from the server's registry and checked against a committed snapshot on every change, and the reference is rendered from the same snapshot, so the docs cannot drift from the server.

Where to go next

Freestyle developer documentation. Base URL https://freestyle.audio. Generated from the server's own registry and configuration.