# Developer > Developer API reference for ML Autocapture Category: AUTOCAPTURE · Source: https://miciomods.it/docs/ml-autocapture-developer · Last updated: 2026-09-21 ## Overview ML Autocapture exposes server helpers for opening the studio and resolving generated images. The full edition also exposes a client capture function for existing entities. ## Server exports ### Open the studio - `OpenStudio(source)` — Opens the full studio for a real player source. Returns `true` when the request is accepted or `false` when the resource is locked or the source is invalid. ```lua local opened = exports['ml_autocapture']:OpenStudio(source) ``` ### Resolve generated images - `getImage(key)` — Returns a `nui://` URL for the first matching PNG, JPG or WebP in the self-contained output and then `ox_inventory`. Returns `nil` when no image exists. - `getImages(keys)` — Resolves an array of keys and returns a table keyed by the original values. ```lua local url = exports['ml_autocapture']:getImage('model_windowway_metal') local urls = exports['ml_autocapture']:getImages({ 'adder', 'sultan', 'model_windowway_metal' }) ``` ### Vehicle configurator output - `getConfiguratorManifest(model)` — Returns the decoded configurator manifest for a model or `nil`. - `getConfiguratorImage(model, file)` — Returns the `nui://` URL for a generated configurator layer or `nil`. ```lua local manifest = exports['ml_autocapture']:getConfiguratorManifest('adder') local layer = exports['ml_autocapture']:getConfiguratorImage('adder', 'front_bumper_0.png') ``` ## Client exports ### Admin menu integration - `MLAdminPanel()` — Returns the admin-menu label and icon when the command is enabled. - `MLAdminOpen()` — Executes the configured studio command. ```lua local entry = exports['ml_autocapture']:MLAdminPanel() exports['ml_autocapture']:MLAdminOpen() ``` ### Capture an existing entity - `CaptureEntity(entity, key, options?)` — Moves an existing vehicle or ped into the studio, creates a transparent image in the self-contained output, restores the entity and returns its `nui://` URL. Returns `nil` if the studio is busy, the entity is invalid or capture fails. ```lua local url = exports['ml_autocapture']:CaptureEntity(entity, 'preview_vehicle', { width = 512, height = 512, format = 'png', quality = 92, yaw = 35.0, pitch = -8.0, fov = 40.0, margin = 1.25, returnData = false, }) ``` Supported options are `width`, `height`, `format`, `quality`, `yaw`, `pitch`, `fov`, `margin` and `returnData`. ## Client event - `ml_autocapture:entityCaptured` — Fires locally after `CaptureEntity` completes. Parameters are the sanitized key and the resulting URL or `nil`. ```lua AddEventHandler('ml_autocapture:entityCaptured', function(key, url) if not url then return end print(key, url) end) ``` ## File naming Capture keys are converted to lowercase and stripped to letters, digits, underscores and dashes. Prop batches use each entry's `item` value as the key and use `model` only for spawning the object.