# Execute inference

POST

/v2/workspaces/{workspace\_id}/inferences

```bash
curl --request POST \
  --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "subtitle_preset": "<string>",
  "subtitle_color": "<string>",
  "subtitle_secondary_color": "<string>",
  "subtitle_alignment": "top",
  "base_model_id": "<string>",
  "reference_sets": [],
  "modality": "text",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "width": 0,
  "height": 0,
  "auto_aspect_ratio": true,
  "auto_resolution": "<string>",
  "batch_size": 4,
  "num_inference_steps": 0,
  "guidance_scale": 0,
  "prompt_strength": 0,
  "quality": "low",
  "sharpness": 0,
  "prompt_enhancement": "off",
  "duration_seconds": 0,
  "generate_audio": true,
  "keep_audio": true,
  "draft": true,
  "instrumental": true,
  "loop": true,
  "output_format": "mp3",
  "lyrics": "<string>",
  "composition_plan": {
    "positive_styles": [],
    "negative_styles": [],
    "sections": [
      {
        "name": null,
        "duration_seconds": null,
        "positive_styles": null,
        "negative_styles": null,
        "lines": null
      }
    ],
    "respect_section_durations": true
  },
  "fps": 0,
  "video_effects": [],
  "use_ta_pose": true,
  "pose_mode": "A_POSE",
  "include_textures": true,
  "detailed_geometry": true,
  "remesh_geometry": true,
  "texture_resolution": "RES_2K",
  "remove_lighting": true,
  "mesh_density": "ULTRA",
  "preserve_uvs": true,
  "segment_by": "AUTO",
  "segment_part_names": [
    "<string>"
  ],
  "segment_target": "CHARACTER",
  "segment_parts": 0,
  "segment_level": "LOW",
  "segment_strength": 0,
  "quad_mesh": true,
  "pbr_materials": true,
  "low_poly": true,
  "generate_parts": true,
  "face_limit": 0,
  "enable_rigging": true,
  "enable_animation": true,
  "stability": 0,
  "use_speaker_boost": true,
  "similarity_boost": 0,
  "style_exaggeration": 0,
  "speed": 0,
  "upscale_ratio": 0,
  "creativity": 0,
  "resemblance": 0,
  "denoise": 0,
  "compression_repair": 0,
  "halo_reduction": 0,
  "recover_detail": 0,
  "detail": 0,
  "grain": 0,
  "refine_strength": 0,
  "realism": 0,
  "face_enhancement": true,
  "face_enhancement_strength": 0,
  "face_enhancement_creativity": 0,
  "target_region": "all",
  "color_preservation": true,
  "vectorize": true,
  "vectorization_mode": "spline",
  "vectorization_color_mode": "color",
  "vectorization_layering": "stacked",
  "vectorization_filter_speckle": 0,
  "vectorization_color_precision": 0,
  "vectorization_layer_difference": 0,
  "vectorization_corner_threshold": 0,
  "vectorization_length_threshold": 0,
  "vectorization_splice_threshold": 0,
  "vectorization_max_iterations": 0,
  "vectorization_path_precision": 0,
  "transparency": true,
  "reframe": true,
  "tileability": true,
  "projection": "EQUIRECTANGULAR",
  "projection_strength": 0,
  "refill": true,
  "camera_transform": {
    "distance_delta": 0,
    "rotation_delta": {
      "pitch_delta": null,
      "yaw_delta": null,
      "roll_delta": null
    },
    "zoom_delta": {
      "fov_y_delta": null
    }
  },
  "camera_trajectory": [
    {
      "time": 0,
      "azimuth": 0,
      "elevation": 0,
      "distance": 0
    }
  ],
  "scene_lighting": {
    "lights": []
  },
  "tile_grid": {
    "shape": "SQUARE",
    "orientation": "DIAMOND",
    "elevation": 0,
    "facing": 0,
    "footprint_width": 1,
    "footprint_depth": 1,
    "height": 0,
    "tile_width": 128,
    "light_from": "left"
  },
  "output_fit": {
    "trim": false,
    "canvas": "CONTENT",
    "width": 0,
    "height": 0,
    "scale": "PLACE",
    "anchor": "TOP_LEFT",
    "padding": 0
  },
  "nine_slice": true,
  "parallax": {
    "layers": 5,
    "cuts": [
      0
    ],
    "loop": false
  },
  "color_palette": {
    "colors": [],
    "reference_set_id": "<uuid>"
  },
  "expression": "<string>",
  "target_language": "<string>",
  "audio_sections": [],
  "audio_extension": {
    "before_seconds": 0,
    "after_seconds": 0
  },
  "video_section": {
    "start_seconds": 0,
    "end_seconds": 0
  },
  "guidance_files": [],
  "seed": -1,
  "mask": {
    "file_id": "<uuid>",
    "for_transparency": true,
    "for_nontransparency": true,
    "edge_radius": 0
  },
  "session_name": "<string>",
  "session_id": "<uuid>",
  "webhook": {
    "url": "<string>",
    "events": [
      "inference.completed"
    ],
    "metadata": {}
  }
}'
```

```python
import requests


url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences"


payload = {
    "subtitle_preset": "<string>",
    "subtitle_color": "<string>",
    "subtitle_secondary_color": "<string>",
    "subtitle_alignment": "top",
    "base_model_id": "<string>",
    "reference_sets": [],
    "modality": "text",
    "prompt": "<string>",
    "negative_prompt": "<string>",
    "width": 0,
    "height": 0,
    "auto_aspect_ratio": True,
    "auto_resolution": "<string>",
    "batch_size": 4,
    "num_inference_steps": 0,
    "guidance_scale": 0,
    "prompt_strength": 0,
    "quality": "low",
    "sharpness": 0,
    "prompt_enhancement": "off",
    "duration_seconds": 0,
    "generate_audio": True,
    "keep_audio": True,
    "draft": True,
    "instrumental": True,
    "loop": True,
    "output_format": "mp3",
    "lyrics": "<string>",
    "composition_plan": {
        "positive_styles": [],
        "negative_styles": [],
        "sections": [
            {
                "name": None,
                "duration_seconds": None,
                "positive_styles": None,
                "negative_styles": None,
                "lines": None
            }
        ],
        "respect_section_durations": True
    },
    "fps": 0,
    "video_effects": [],
    "use_ta_pose": True,
    "pose_mode": "A_POSE",
    "include_textures": True,
    "detailed_geometry": True,
    "remesh_geometry": True,
    "texture_resolution": "RES_2K",
    "remove_lighting": True,
    "mesh_density": "ULTRA",
    "preserve_uvs": True,
    "segment_by": "AUTO",
    "segment_part_names": ["<string>"],
    "segment_target": "CHARACTER",
    "segment_parts": 0,
    "segment_level": "LOW",
    "segment_strength": 0,
    "quad_mesh": True,
    "pbr_materials": True,
    "low_poly": True,
    "generate_parts": True,
    "face_limit": 0,
    "enable_rigging": True,
    "enable_animation": True,
    "stability": 0,
    "use_speaker_boost": True,
    "similarity_boost": 0,
    "style_exaggeration": 0,
    "speed": 0,
    "upscale_ratio": 0,
    "creativity": 0,
    "resemblance": 0,
    "denoise": 0,
    "compression_repair": 0,
    "halo_reduction": 0,
    "recover_detail": 0,
    "detail": 0,
    "grain": 0,
    "refine_strength": 0,
    "realism": 0,
    "face_enhancement": True,
    "face_enhancement_strength": 0,
    "face_enhancement_creativity": 0,
    "target_region": "all",
    "color_preservation": True,
    "vectorize": True,
    "vectorization_mode": "spline",
    "vectorization_color_mode": "color",
    "vectorization_layering": "stacked",
    "vectorization_filter_speckle": 0,
    "vectorization_color_precision": 0,
    "vectorization_layer_difference": 0,
    "vectorization_corner_threshold": 0,
    "vectorization_length_threshold": 0,
    "vectorization_splice_threshold": 0,
    "vectorization_max_iterations": 0,
    "vectorization_path_precision": 0,
    "transparency": True,
    "reframe": True,
    "tileability": True,
    "projection": "EQUIRECTANGULAR",
    "projection_strength": 0,
    "refill": True,
    "camera_transform": {
        "distance_delta": 0,
        "rotation_delta": {
            "pitch_delta": None,
            "yaw_delta": None,
            "roll_delta": None
        },
        "zoom_delta": { "fov_y_delta": None }
    },
    "camera_trajectory": [
        {
            "time": 0,
            "azimuth": 0,
            "elevation": 0,
            "distance": 0
        }
    ],
    "scene_lighting": { "lights": [] },
    "tile_grid": {
        "shape": "SQUARE",
        "orientation": "DIAMOND",
        "elevation": 0,
        "facing": 0,
        "footprint_width": 1,
        "footprint_depth": 1,
        "height": 0,
        "tile_width": 128,
        "light_from": "left"
    },
    "output_fit": {
        "trim": False,
        "canvas": "CONTENT",
        "width": 0,
        "height": 0,
        "scale": "PLACE",
        "anchor": "TOP_LEFT",
        "padding": 0
    },
    "nine_slice": True,
    "parallax": {
        "layers": 5,
        "cuts": [0],
        "loop": False
    },
    "color_palette": {
        "colors": [],
        "reference_set_id": "<uuid>"
    },
    "expression": "<string>",
    "target_language": "<string>",
    "audio_sections": [],
    "audio_extension": {
        "before_seconds": 0,
        "after_seconds": 0
    },
    "video_section": {
        "start_seconds": 0,
        "end_seconds": 0
    },
    "guidance_files": [],
    "seed": -1,
    "mask": {
        "file_id": "<uuid>",
        "for_transparency": True,
        "for_nontransparency": True,
        "edge_radius": 0
    },
    "session_name": "<string>",
    "session_id": "<uuid>",
    "webhook": {
        "url": "<string>",
        "events": ["inference.completed"],
        "metadata": {}
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}


response = requests.post(url, json=payload, headers=headers)


print(response.json())
```

```js
const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"subtitle_preset":"<string>","subtitle_color":"<string>","subtitle_secondary_color":"<string>","subtitle_alignment":"top","base_model_id":"<string>","reference_sets":[],"modality":"text","prompt":"<string>","negative_prompt":"<string>","width":0,"height":0,"auto_aspect_ratio":true,"auto_resolution":"<string>","batch_size":4,"num_inference_steps":0,"guidance_scale":0,"prompt_strength":0,"quality":"low","sharpness":0,"prompt_enhancement":"off","duration_seconds":0,"generate_audio":true,"keep_audio":true,"draft":true,"instrumental":true,"loop":true,"output_format":"mp3","lyrics":"<string>","composition_plan":{"positive_styles":[],"negative_styles":[],"sections":[{"name":null,"duration_seconds":null,"positive_styles":null,"negative_styles":null,"lines":null}],"respect_section_durations":true},"fps":0,"video_effects":[],"use_ta_pose":true,"pose_mode":"A_POSE","include_textures":true,"detailed_geometry":true,"remesh_geometry":true,"texture_resolution":"RES_2K","remove_lighting":true,"mesh_density":"ULTRA","preserve_uvs":true,"segment_by":"AUTO","segment_part_names":["<string>"],"segment_target":"CHARACTER","segment_parts":0,"segment_level":"LOW","segment_strength":0,"quad_mesh":true,"pbr_materials":true,"low_poly":true,"generate_parts":true,"face_limit":0,"enable_rigging":true,"enable_animation":true,"stability":0,"use_speaker_boost":true,"similarity_boost":0,"style_exaggeration":0,"speed":0,"upscale_ratio":0,"creativity":0,"resemblance":0,"denoise":0,"compression_repair":0,"halo_reduction":0,"recover_detail":0,"detail":0,"grain":0,"refine_strength":0,"realism":0,"face_enhancement":true,"face_enhancement_strength":0,"face_enhancement_creativity":0,"target_region":"all","color_preservation":true,"vectorize":true,"vectorization_mode":"spline","vectorization_color_mode":"color","vectorization_layering":"stacked","vectorization_filter_speckle":0,"vectorization_color_precision":0,"vectorization_layer_difference":0,"vectorization_corner_threshold":0,"vectorization_length_threshold":0,"vectorization_splice_threshold":0,"vectorization_max_iterations":0,"vectorization_path_precision":0,"transparency":true,"reframe":true,"tileability":true,"projection":"EQUIRECTANGULAR","projection_strength":0,"refill":true,"camera_transform":{"distance_delta":0,"rotation_delta":{"pitch_delta":null,"yaw_delta":null,"roll_delta":null},"zoom_delta":{"fov_y_delta":null}},"camera_trajectory":[{"time":0,"azimuth":0,"elevation":0,"distance":0}],"scene_lighting":{"lights":[]},"tile_grid":{"shape":"SQUARE","orientation":"DIAMOND","elevation":0,"facing":0,"footprint_width":1,"footprint_depth":1,"height":0,"tile_width":128,"light_from":"left"},"output_fit":{"trim":false,"canvas":"CONTENT","width":0,"height":0,"scale":"PLACE","anchor":"TOP_LEFT","padding":0},"nine_slice":true,"parallax":{"layers":5,"cuts":[0],"loop":false},"color_palette":{"colors":[],"reference_set_id":"<uuid>"},"expression":"<string>","target_language":"<string>","audio_sections":[],"audio_extension":{"before_seconds":0,"after_seconds":0},"video_section":{"start_seconds":0,"end_seconds":0},"guidance_files":[],"seed":-1,"mask":{"file_id":"<uuid>","for_transparency":true,"for_nontransparency":true,"edge_radius":0},"session_name":"<string>","session_id":"<uuid>","webhook":{"url":"<string>","events":["inference.completed"],"metadata":{}}}'
};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main


import (
  "fmt"
  "strings"
  "net/http"
  "io"
)


func main() {


  url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences"


  payload := strings.NewReader("{\n  \"subtitle_preset\": \"<string>\",\n  \"subtitle_color\": \"<string>\",\n  \"subtitle_secondary_color\": \"<string>\",\n  \"subtitle_alignment\": \"top\",\n  \"base_model_id\": \"<string>\",\n  \"reference_sets\": [],\n  \"modality\": \"text\",\n  \"prompt\": \"<string>\",\n  \"negative_prompt\": \"<string>\",\n  \"width\": 0,\n  \"height\": 0,\n  \"auto_aspect_ratio\": true,\n  \"auto_resolution\": \"<string>\",\n  \"batch_size\": 4,\n  \"num_inference_steps\": 0,\n  \"guidance_scale\": 0,\n  \"prompt_strength\": 0,\n  \"quality\": \"low\",\n  \"sharpness\": 0,\n  \"prompt_enhancement\": \"off\",\n  \"duration_seconds\": 0,\n  \"generate_audio\": true,\n  \"keep_audio\": true,\n  \"draft\": true,\n  \"instrumental\": true,\n  \"loop\": true,\n  \"output_format\": \"mp3\",\n  \"lyrics\": \"<string>\",\n  \"composition_plan\": {\n    \"positive_styles\": [],\n    \"negative_styles\": [],\n    \"sections\": [\n      {\n        \"name\": null,\n        \"duration_seconds\": null,\n        \"positive_styles\": null,\n        \"negative_styles\": null,\n        \"lines\": null\n      }\n    ],\n    \"respect_section_durations\": true\n  },\n  \"fps\": 0,\n  \"video_effects\": [],\n  \"use_ta_pose\": true,\n  \"pose_mode\": \"A_POSE\",\n  \"include_textures\": true,\n  \"detailed_geometry\": true,\n  \"remesh_geometry\": true,\n  \"texture_resolution\": \"RES_2K\",\n  \"remove_lighting\": true,\n  \"mesh_density\": \"ULTRA\",\n  \"preserve_uvs\": true,\n  \"segment_by\": \"AUTO\",\n  \"segment_part_names\": [\n    \"<string>\"\n  ],\n  \"segment_target\": \"CHARACTER\",\n  \"segment_parts\": 0,\n  \"segment_level\": \"LOW\",\n  \"segment_strength\": 0,\n  \"quad_mesh\": true,\n  \"pbr_materials\": true,\n  \"low_poly\": true,\n  \"generate_parts\": true,\n  \"face_limit\": 0,\n  \"enable_rigging\": true,\n  \"enable_animation\": true,\n  \"stability\": 0,\n  \"use_speaker_boost\": true,\n  \"similarity_boost\": 0,\n  \"style_exaggeration\": 0,\n  \"speed\": 0,\n  \"upscale_ratio\": 0,\n  \"creativity\": 0,\n  \"resemblance\": 0,\n  \"denoise\": 0,\n  \"compression_repair\": 0,\n  \"halo_reduction\": 0,\n  \"recover_detail\": 0,\n  \"detail\": 0,\n  \"grain\": 0,\n  \"refine_strength\": 0,\n  \"realism\": 0,\n  \"face_enhancement\": true,\n  \"face_enhancement_strength\": 0,\n  \"face_enhancement_creativity\": 0,\n  \"target_region\": \"all\",\n  \"color_preservation\": true,\n  \"vectorize\": true,\n  \"vectorization_mode\": \"spline\",\n  \"vectorization_color_mode\": \"color\",\n  \"vectorization_layering\": \"stacked\",\n  \"vectorization_filter_speckle\": 0,\n  \"vectorization_color_precision\": 0,\n  \"vectorization_layer_difference\": 0,\n  \"vectorization_corner_threshold\": 0,\n  \"vectorization_length_threshold\": 0,\n  \"vectorization_splice_threshold\": 0,\n  \"vectorization_max_iterations\": 0,\n  \"vectorization_path_precision\": 0,\n  \"transparency\": true,\n  \"reframe\": true,\n  \"tileability\": true,\n  \"projection\": \"EQUIRECTANGULAR\",\n  \"projection_strength\": 0,\n  \"refill\": true,\n  \"camera_transform\": {\n    \"distance_delta\": 0,\n    \"rotation_delta\": {\n      \"pitch_delta\": null,\n      \"yaw_delta\": null,\n      \"roll_delta\": null\n    },\n    \"zoom_delta\": {\n      \"fov_y_delta\": null\n    }\n  },\n  \"camera_trajectory\": [\n    {\n      \"time\": 0,\n      \"azimuth\": 0,\n      \"elevation\": 0,\n      \"distance\": 0\n    }\n  ],\n  \"scene_lighting\": {\n    \"lights\": []\n  },\n  \"tile_grid\": {\n    \"shape\": \"SQUARE\",\n    \"orientation\": \"DIAMOND\",\n    \"elevation\": 0,\n    \"facing\": 0,\n    \"footprint_width\": 1,\n    \"footprint_depth\": 1,\n    \"height\": 0,\n    \"tile_width\": 128,\n    \"light_from\": \"left\"\n  },\n  \"output_fit\": {\n    \"trim\": false,\n    \"canvas\": \"CONTENT\",\n    \"width\": 0,\n    \"height\": 0,\n    \"scale\": \"PLACE\",\n    \"anchor\": \"TOP_LEFT\",\n    \"padding\": 0\n  },\n  \"nine_slice\": true,\n  \"parallax\": {\n    \"layers\": 5,\n    \"cuts\": [\n      0\n    ],\n    \"loop\": false\n  },\n  \"color_palette\": {\n    \"colors\": [],\n    \"reference_set_id\": \"<uuid>\"\n  },\n  \"expression\": \"<string>\",\n  \"target_language\": \"<string>\",\n  \"audio_sections\": [],\n  \"audio_extension\": {\n    \"before_seconds\": 0,\n    \"after_seconds\": 0\n  },\n  \"video_section\": {\n    \"start_seconds\": 0,\n    \"end_seconds\": 0\n  },\n  \"guidance_files\": [],\n  \"seed\": -1,\n  \"mask\": {\n    \"file_id\": \"<uuid>\",\n    \"for_transparency\": true,\n    \"for_nontransparency\": true,\n    \"edge_radius\": 0\n  },\n  \"session_name\": \"<string>\",\n  \"session_id\": \"<uuid>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}")


  req, _ := http.NewRequest("POST", url, payload)


  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")


  res, _ := http.DefaultClient.Do(req)


  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)


  fmt.Println(res)
  fmt.Println(string(body))


}
```

```php
<?php


$curl = curl_init();


curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'subtitle_preset' => '<string>',
    'subtitle_color' => '<string>',
    'subtitle_secondary_color' => '<string>',
    'subtitle_alignment' => 'top',
    'base_model_id' => '<string>',
    'reference_sets' => [


    ],
    'modality' => 'text',
    'prompt' => '<string>',
    'negative_prompt' => '<string>',
    'width' => 0,
    'height' => 0,
    'auto_aspect_ratio' => null,
    'auto_resolution' => '<string>',
    'batch_size' => 4,
    'num_inference_steps' => 0,
    'guidance_scale' => 0,
    'prompt_strength' => 0,
    'quality' => 'low',
    'sharpness' => 0,
    'prompt_enhancement' => 'off',
    'duration_seconds' => 0,
    'generate_audio' => null,
    'keep_audio' => null,
    'draft' => null,
    'instrumental' => null,
    'loop' => null,
    'output_format' => 'mp3',
    'lyrics' => '<string>',
    'composition_plan' => [
        'positive_styles' => [


        ],
        'negative_styles' => [


        ],
        'sections' => [
                [
                                'name' => null,
                                'duration_seconds' => null,
                                'positive_styles' => null,
                                'negative_styles' => null,
                                'lines' => null
                ]
        ],
        'respect_section_durations' => null
    ],
    'fps' => 0,
    'video_effects' => [


    ],
    'use_ta_pose' => null,
    'pose_mode' => 'A_POSE',
    'include_textures' => null,
    'detailed_geometry' => null,
    'remesh_geometry' => null,
    'texture_resolution' => 'RES_2K',
    'remove_lighting' => null,
    'mesh_density' => 'ULTRA',
    'preserve_uvs' => null,
    'segment_by' => 'AUTO',
    'segment_part_names' => [
        '<string>'
    ],
    'segment_target' => 'CHARACTER',
    'segment_parts' => 0,
    'segment_level' => 'LOW',
    'segment_strength' => 0,
    'quad_mesh' => null,
    'pbr_materials' => null,
    'low_poly' => null,
    'generate_parts' => null,
    'face_limit' => 0,
    'enable_rigging' => null,
    'enable_animation' => null,
    'stability' => 0,
    'use_speaker_boost' => null,
    'similarity_boost' => 0,
    'style_exaggeration' => 0,
    'speed' => 0,
    'upscale_ratio' => 0,
    'creativity' => 0,
    'resemblance' => 0,
    'denoise' => 0,
    'compression_repair' => 0,
    'halo_reduction' => 0,
    'recover_detail' => 0,
    'detail' => 0,
    'grain' => 0,
    'refine_strength' => 0,
    'realism' => 0,
    'face_enhancement' => null,
    'face_enhancement_strength' => 0,
    'face_enhancement_creativity' => 0,
    'target_region' => 'all',
    'color_preservation' => null,
    'vectorize' => null,
    'vectorization_mode' => 'spline',
    'vectorization_color_mode' => 'color',
    'vectorization_layering' => 'stacked',
    'vectorization_filter_speckle' => 0,
    'vectorization_color_precision' => 0,
    'vectorization_layer_difference' => 0,
    'vectorization_corner_threshold' => 0,
    'vectorization_length_threshold' => 0,
    'vectorization_splice_threshold' => 0,
    'vectorization_max_iterations' => 0,
    'vectorization_path_precision' => 0,
    'transparency' => null,
    'reframe' => null,
    'tileability' => null,
    'projection' => 'EQUIRECTANGULAR',
    'projection_strength' => 0,
    'refill' => null,
    'camera_transform' => [
        'distance_delta' => 0,
        'rotation_delta' => [
                'pitch_delta' => null,
                'yaw_delta' => null,
                'roll_delta' => null
        ],
        'zoom_delta' => [
                'fov_y_delta' => null
        ]
    ],
    'camera_trajectory' => [
        [
                'time' => 0,
                'azimuth' => 0,
                'elevation' => 0,
                'distance' => 0
        ]
    ],
    'scene_lighting' => [
        'lights' => [


        ]
    ],
    'tile_grid' => [
        'shape' => 'SQUARE',
        'orientation' => 'DIAMOND',
        'elevation' => 0,
        'facing' => 0,
        'footprint_width' => 1,
        'footprint_depth' => 1,
        'height' => 0,
        'tile_width' => 128,
        'light_from' => 'left'
    ],
    'output_fit' => [
        'trim' => null,
        'canvas' => 'CONTENT',
        'width' => 0,
        'height' => 0,
        'scale' => 'PLACE',
        'anchor' => 'TOP_LEFT',
        'padding' => 0
    ],
    'nine_slice' => null,
    'parallax' => [
        'layers' => 5,
        'cuts' => [
                0
        ],
        'loop' => null
    ],
    'color_palette' => [
        'colors' => [


        ],
        'reference_set_id' => '<uuid>'
    ],
    'expression' => '<string>',
    'target_language' => '<string>',
    'audio_sections' => [


    ],
    'audio_extension' => [
        'before_seconds' => 0,
        'after_seconds' => 0
    ],
    'video_section' => [
        'start_seconds' => 0,
        'end_seconds' => 0
    ],
    'guidance_files' => [


    ],
    'seed' => -1,
    'mask' => [
        'file_id' => '<uuid>',
        'for_transparency' => null,
        'for_nontransparency' => null,
        'edge_radius' => 0
    ],
    'session_name' => '<string>',
    'session_id' => '<uuid>',
    'webhook' => [
        'url' => '<string>',
        'events' => [
                'inference.completed'
        ],
        'metadata' => [


        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);


$response = curl_exec($curl);
$err = curl_error($curl);


curl_close($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```java
OkHttpClient client = new OkHttpClient();


MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"subtitle_preset\": \"<string>\",\n  \"subtitle_color\": \"<string>\",\n  \"subtitle_secondary_color\": \"<string>\",\n  \"subtitle_alignment\": \"top\",\n  \"base_model_id\": \"<string>\",\n  \"reference_sets\": [],\n  \"modality\": \"text\",\n  \"prompt\": \"<string>\",\n  \"negative_prompt\": \"<string>\",\n  \"width\": 0,\n  \"height\": 0,\n  \"auto_aspect_ratio\": true,\n  \"auto_resolution\": \"<string>\",\n  \"batch_size\": 4,\n  \"num_inference_steps\": 0,\n  \"guidance_scale\": 0,\n  \"prompt_strength\": 0,\n  \"quality\": \"low\",\n  \"sharpness\": 0,\n  \"prompt_enhancement\": \"off\",\n  \"duration_seconds\": 0,\n  \"generate_audio\": true,\n  \"keep_audio\": true,\n  \"draft\": true,\n  \"instrumental\": true,\n  \"loop\": true,\n  \"output_format\": \"mp3\",\n  \"lyrics\": \"<string>\",\n  \"composition_plan\": {\n    \"positive_styles\": [],\n    \"negative_styles\": [],\n    \"sections\": [\n      {\n        \"name\": null,\n        \"duration_seconds\": null,\n        \"positive_styles\": null,\n        \"negative_styles\": null,\n        \"lines\": null\n      }\n    ],\n    \"respect_section_durations\": true\n  },\n  \"fps\": 0,\n  \"video_effects\": [],\n  \"use_ta_pose\": true,\n  \"pose_mode\": \"A_POSE\",\n  \"include_textures\": true,\n  \"detailed_geometry\": true,\n  \"remesh_geometry\": true,\n  \"texture_resolution\": \"RES_2K\",\n  \"remove_lighting\": true,\n  \"mesh_density\": \"ULTRA\",\n  \"preserve_uvs\": true,\n  \"segment_by\": \"AUTO\",\n  \"segment_part_names\": [\n    \"<string>\"\n  ],\n  \"segment_target\": \"CHARACTER\",\n  \"segment_parts\": 0,\n  \"segment_level\": \"LOW\",\n  \"segment_strength\": 0,\n  \"quad_mesh\": true,\n  \"pbr_materials\": true,\n  \"low_poly\": true,\n  \"generate_parts\": true,\n  \"face_limit\": 0,\n  \"enable_rigging\": true,\n  \"enable_animation\": true,\n  \"stability\": 0,\n  \"use_speaker_boost\": true,\n  \"similarity_boost\": 0,\n  \"style_exaggeration\": 0,\n  \"speed\": 0,\n  \"upscale_ratio\": 0,\n  \"creativity\": 0,\n  \"resemblance\": 0,\n  \"denoise\": 0,\n  \"compression_repair\": 0,\n  \"halo_reduction\": 0,\n  \"recover_detail\": 0,\n  \"detail\": 0,\n  \"grain\": 0,\n  \"refine_strength\": 0,\n  \"realism\": 0,\n  \"face_enhancement\": true,\n  \"face_enhancement_strength\": 0,\n  \"face_enhancement_creativity\": 0,\n  \"target_region\": \"all\",\n  \"color_preservation\": true,\n  \"vectorize\": true,\n  \"vectorization_mode\": \"spline\",\n  \"vectorization_color_mode\": \"color\",\n  \"vectorization_layering\": \"stacked\",\n  \"vectorization_filter_speckle\": 0,\n  \"vectorization_color_precision\": 0,\n  \"vectorization_layer_difference\": 0,\n  \"vectorization_corner_threshold\": 0,\n  \"vectorization_length_threshold\": 0,\n  \"vectorization_splice_threshold\": 0,\n  \"vectorization_max_iterations\": 0,\n  \"vectorization_path_precision\": 0,\n  \"transparency\": true,\n  \"reframe\": true,\n  \"tileability\": true,\n  \"projection\": \"EQUIRECTANGULAR\",\n  \"projection_strength\": 0,\n  \"refill\": true,\n  \"camera_transform\": {\n    \"distance_delta\": 0,\n    \"rotation_delta\": {\n      \"pitch_delta\": null,\n      \"yaw_delta\": null,\n      \"roll_delta\": null\n    },\n    \"zoom_delta\": {\n      \"fov_y_delta\": null\n    }\n  },\n  \"camera_trajectory\": [\n    {\n      \"time\": 0,\n      \"azimuth\": 0,\n      \"elevation\": 0,\n      \"distance\": 0\n    }\n  ],\n  \"scene_lighting\": {\n    \"lights\": []\n  },\n  \"tile_grid\": {\n    \"shape\": \"SQUARE\",\n    \"orientation\": \"DIAMOND\",\n    \"elevation\": 0,\n    \"facing\": 0,\n    \"footprint_width\": 1,\n    \"footprint_depth\": 1,\n    \"height\": 0,\n    \"tile_width\": 128,\n    \"light_from\": \"left\"\n  },\n  \"output_fit\": {\n    \"trim\": false,\n    \"canvas\": \"CONTENT\",\n    \"width\": 0,\n    \"height\": 0,\n    \"scale\": \"PLACE\",\n    \"anchor\": \"TOP_LEFT\",\n    \"padding\": 0\n  },\n  \"nine_slice\": true,\n  \"parallax\": {\n    \"layers\": 5,\n    \"cuts\": [\n      0\n    ],\n    \"loop\": false\n  },\n  \"color_palette\": {\n    \"colors\": [],\n    \"reference_set_id\": \"<uuid>\"\n  },\n  \"expression\": \"<string>\",\n  \"target_language\": \"<string>\",\n  \"audio_sections\": [],\n  \"audio_extension\": {\n    \"before_seconds\": 0,\n    \"after_seconds\": 0\n  },\n  \"video_section\": {\n    \"start_seconds\": 0,\n    \"end_seconds\": 0\n  },\n  \"guidance_files\": [],\n  \"seed\": -1,\n  \"mask\": {\n    \"file_id\": \"<uuid>\",\n    \"for_transparency\": true,\n    \"for_nontransparency\": true,\n    \"edge_radius\": 0\n  },\n  \"session_name\": \"<string>\",\n  \"session_id\": \"<uuid>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}");
Request request = new Request.Builder()
  .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences")
  .post(body)
  .addHeader("Authorization", "Bearer <token>")
  .addHeader("Content-Type", "application/json")
  .build();


Response response = client.newCall(request).execute();
```

```ruby
require 'uri'
require 'net/http'


url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences")


http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true


request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"subtitle_preset\": \"<string>\",\n  \"subtitle_color\": \"<string>\",\n  \"subtitle_secondary_color\": \"<string>\",\n  \"subtitle_alignment\": \"top\",\n  \"base_model_id\": \"<string>\",\n  \"reference_sets\": [],\n  \"modality\": \"text\",\n  \"prompt\": \"<string>\",\n  \"negative_prompt\": \"<string>\",\n  \"width\": 0,\n  \"height\": 0,\n  \"auto_aspect_ratio\": true,\n  \"auto_resolution\": \"<string>\",\n  \"batch_size\": 4,\n  \"num_inference_steps\": 0,\n  \"guidance_scale\": 0,\n  \"prompt_strength\": 0,\n  \"quality\": \"low\",\n  \"sharpness\": 0,\n  \"prompt_enhancement\": \"off\",\n  \"duration_seconds\": 0,\n  \"generate_audio\": true,\n  \"keep_audio\": true,\n  \"draft\": true,\n  \"instrumental\": true,\n  \"loop\": true,\n  \"output_format\": \"mp3\",\n  \"lyrics\": \"<string>\",\n  \"composition_plan\": {\n    \"positive_styles\": [],\n    \"negative_styles\": [],\n    \"sections\": [\n      {\n        \"name\": null,\n        \"duration_seconds\": null,\n        \"positive_styles\": null,\n        \"negative_styles\": null,\n        \"lines\": null\n      }\n    ],\n    \"respect_section_durations\": true\n  },\n  \"fps\": 0,\n  \"video_effects\": [],\n  \"use_ta_pose\": true,\n  \"pose_mode\": \"A_POSE\",\n  \"include_textures\": true,\n  \"detailed_geometry\": true,\n  \"remesh_geometry\": true,\n  \"texture_resolution\": \"RES_2K\",\n  \"remove_lighting\": true,\n  \"mesh_density\": \"ULTRA\",\n  \"preserve_uvs\": true,\n  \"segment_by\": \"AUTO\",\n  \"segment_part_names\": [\n    \"<string>\"\n  ],\n  \"segment_target\": \"CHARACTER\",\n  \"segment_parts\": 0,\n  \"segment_level\": \"LOW\",\n  \"segment_strength\": 0,\n  \"quad_mesh\": true,\n  \"pbr_materials\": true,\n  \"low_poly\": true,\n  \"generate_parts\": true,\n  \"face_limit\": 0,\n  \"enable_rigging\": true,\n  \"enable_animation\": true,\n  \"stability\": 0,\n  \"use_speaker_boost\": true,\n  \"similarity_boost\": 0,\n  \"style_exaggeration\": 0,\n  \"speed\": 0,\n  \"upscale_ratio\": 0,\n  \"creativity\": 0,\n  \"resemblance\": 0,\n  \"denoise\": 0,\n  \"compression_repair\": 0,\n  \"halo_reduction\": 0,\n  \"recover_detail\": 0,\n  \"detail\": 0,\n  \"grain\": 0,\n  \"refine_strength\": 0,\n  \"realism\": 0,\n  \"face_enhancement\": true,\n  \"face_enhancement_strength\": 0,\n  \"face_enhancement_creativity\": 0,\n  \"target_region\": \"all\",\n  \"color_preservation\": true,\n  \"vectorize\": true,\n  \"vectorization_mode\": \"spline\",\n  \"vectorization_color_mode\": \"color\",\n  \"vectorization_layering\": \"stacked\",\n  \"vectorization_filter_speckle\": 0,\n  \"vectorization_color_precision\": 0,\n  \"vectorization_layer_difference\": 0,\n  \"vectorization_corner_threshold\": 0,\n  \"vectorization_length_threshold\": 0,\n  \"vectorization_splice_threshold\": 0,\n  \"vectorization_max_iterations\": 0,\n  \"vectorization_path_precision\": 0,\n  \"transparency\": true,\n  \"reframe\": true,\n  \"tileability\": true,\n  \"projection\": \"EQUIRECTANGULAR\",\n  \"projection_strength\": 0,\n  \"refill\": true,\n  \"camera_transform\": {\n    \"distance_delta\": 0,\n    \"rotation_delta\": {\n      \"pitch_delta\": null,\n      \"yaw_delta\": null,\n      \"roll_delta\": null\n    },\n    \"zoom_delta\": {\n      \"fov_y_delta\": null\n    }\n  },\n  \"camera_trajectory\": [\n    {\n      \"time\": 0,\n      \"azimuth\": 0,\n      \"elevation\": 0,\n      \"distance\": 0\n    }\n  ],\n  \"scene_lighting\": {\n    \"lights\": []\n  },\n  \"tile_grid\": {\n    \"shape\": \"SQUARE\",\n    \"orientation\": \"DIAMOND\",\n    \"elevation\": 0,\n    \"facing\": 0,\n    \"footprint_width\": 1,\n    \"footprint_depth\": 1,\n    \"height\": 0,\n    \"tile_width\": 128,\n    \"light_from\": \"left\"\n  },\n  \"output_fit\": {\n    \"trim\": false,\n    \"canvas\": \"CONTENT\",\n    \"width\": 0,\n    \"height\": 0,\n    \"scale\": \"PLACE\",\n    \"anchor\": \"TOP_LEFT\",\n    \"padding\": 0\n  },\n  \"nine_slice\": true,\n  \"parallax\": {\n    \"layers\": 5,\n    \"cuts\": [\n      0\n    ],\n    \"loop\": false\n  },\n  \"color_palette\": {\n    \"colors\": [],\n    \"reference_set_id\": \"<uuid>\"\n  },\n  \"expression\": \"<string>\",\n  \"target_language\": \"<string>\",\n  \"audio_sections\": [],\n  \"audio_extension\": {\n    \"before_seconds\": 0,\n    \"after_seconds\": 0\n  },\n  \"video_section\": {\n    \"start_seconds\": 0,\n    \"end_seconds\": 0\n  },\n  \"guidance_files\": [],\n  \"seed\": -1,\n  \"mask\": {\n    \"file_id\": \"<uuid>\",\n    \"for_transparency\": true,\n    \"for_nontransparency\": true,\n    \"edge_radius\": 0\n  },\n  \"session_name\": \"<string>\",\n  \"session_id\": \"<uuid>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}"


response = http.request(request)
puts response.read_body
```

```csharp
var client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences");
var request = new RestRequest("", Method.Post);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"subtitle_preset\": \"<string>\",\n  \"subtitle_color\": \"<string>\",\n  \"subtitle_secondary_color\": \"<string>\",\n  \"subtitle_alignment\": \"top\",\n  \"base_model_id\": \"<string>\",\n  \"reference_sets\": [],\n  \"modality\": \"text\",\n  \"prompt\": \"<string>\",\n  \"negative_prompt\": \"<string>\",\n  \"width\": 0,\n  \"height\": 0,\n  \"auto_aspect_ratio\": true,\n  \"auto_resolution\": \"<string>\",\n  \"batch_size\": 4,\n  \"num_inference_steps\": 0,\n  \"guidance_scale\": 0,\n  \"prompt_strength\": 0,\n  \"quality\": \"low\",\n  \"sharpness\": 0,\n  \"prompt_enhancement\": \"off\",\n  \"duration_seconds\": 0,\n  \"generate_audio\": true,\n  \"keep_audio\": true,\n  \"draft\": true,\n  \"instrumental\": true,\n  \"loop\": true,\n  \"output_format\": \"mp3\",\n  \"lyrics\": \"<string>\",\n  \"composition_plan\": {\n    \"positive_styles\": [],\n    \"negative_styles\": [],\n    \"sections\": [\n      {\n        \"name\": null,\n        \"duration_seconds\": null,\n        \"positive_styles\": null,\n        \"negative_styles\": null,\n        \"lines\": null\n      }\n    ],\n    \"respect_section_durations\": true\n  },\n  \"fps\": 0,\n  \"video_effects\": [],\n  \"use_ta_pose\": true,\n  \"pose_mode\": \"A_POSE\",\n  \"include_textures\": true,\n  \"detailed_geometry\": true,\n  \"remesh_geometry\": true,\n  \"texture_resolution\": \"RES_2K\",\n  \"remove_lighting\": true,\n  \"mesh_density\": \"ULTRA\",\n  \"preserve_uvs\": true,\n  \"segment_by\": \"AUTO\",\n  \"segment_part_names\": [\n    \"<string>\"\n  ],\n  \"segment_target\": \"CHARACTER\",\n  \"segment_parts\": 0,\n  \"segment_level\": \"LOW\",\n  \"segment_strength\": 0,\n  \"quad_mesh\": true,\n  \"pbr_materials\": true,\n  \"low_poly\": true,\n  \"generate_parts\": true,\n  \"face_limit\": 0,\n  \"enable_rigging\": true,\n  \"enable_animation\": true,\n  \"stability\": 0,\n  \"use_speaker_boost\": true,\n  \"similarity_boost\": 0,\n  \"style_exaggeration\": 0,\n  \"speed\": 0,\n  \"upscale_ratio\": 0,\n  \"creativity\": 0,\n  \"resemblance\": 0,\n  \"denoise\": 0,\n  \"compression_repair\": 0,\n  \"halo_reduction\": 0,\n  \"recover_detail\": 0,\n  \"detail\": 0,\n  \"grain\": 0,\n  \"refine_strength\": 0,\n  \"realism\": 0,\n  \"face_enhancement\": true,\n  \"face_enhancement_strength\": 0,\n  \"face_enhancement_creativity\": 0,\n  \"target_region\": \"all\",\n  \"color_preservation\": true,\n  \"vectorize\": true,\n  \"vectorization_mode\": \"spline\",\n  \"vectorization_color_mode\": \"color\",\n  \"vectorization_layering\": \"stacked\",\n  \"vectorization_filter_speckle\": 0,\n  \"vectorization_color_precision\": 0,\n  \"vectorization_layer_difference\": 0,\n  \"vectorization_corner_threshold\": 0,\n  \"vectorization_length_threshold\": 0,\n  \"vectorization_splice_threshold\": 0,\n  \"vectorization_max_iterations\": 0,\n  \"vectorization_path_precision\": 0,\n  \"transparency\": true,\n  \"reframe\": true,\n  \"tileability\": true,\n  \"projection\": \"EQUIRECTANGULAR\",\n  \"projection_strength\": 0,\n  \"refill\": true,\n  \"camera_transform\": {\n    \"distance_delta\": 0,\n    \"rotation_delta\": {\n      \"pitch_delta\": null,\n      \"yaw_delta\": null,\n      \"roll_delta\": null\n    },\n    \"zoom_delta\": {\n      \"fov_y_delta\": null\n    }\n  },\n  \"camera_trajectory\": [\n    {\n      \"time\": 0,\n      \"azimuth\": 0,\n      \"elevation\": 0,\n      \"distance\": 0\n    }\n  ],\n  \"scene_lighting\": {\n    \"lights\": []\n  },\n  \"tile_grid\": {\n    \"shape\": \"SQUARE\",\n    \"orientation\": \"DIAMOND\",\n    \"elevation\": 0,\n    \"facing\": 0,\n    \"footprint_width\": 1,\n    \"footprint_depth\": 1,\n    \"height\": 0,\n    \"tile_width\": 128,\n    \"light_from\": \"left\"\n  },\n  \"output_fit\": {\n    \"trim\": false,\n    \"canvas\": \"CONTENT\",\n    \"width\": 0,\n    \"height\": 0,\n    \"scale\": \"PLACE\",\n    \"anchor\": \"TOP_LEFT\",\n    \"padding\": 0\n  },\n  \"nine_slice\": true,\n  \"parallax\": {\n    \"layers\": 5,\n    \"cuts\": [\n      0\n    ],\n    \"loop\": false\n  },\n  \"color_palette\": {\n    \"colors\": [],\n    \"reference_set_id\": \"<uuid>\"\n  },\n  \"expression\": \"<string>\",\n  \"target_language\": \"<string>\",\n  \"audio_sections\": [],\n  \"audio_extension\": {\n    \"before_seconds\": 0,\n    \"after_seconds\": 0\n  },\n  \"video_section\": {\n    \"start_seconds\": 0,\n    \"end_seconds\": 0\n  },\n  \"guidance_files\": [],\n  \"seed\": -1,\n  \"mask\": {\n    \"file_id\": \"<uuid>\",\n    \"for_transparency\": true,\n    \"for_nontransparency\": true,\n    \"edge_radius\": 0\n  },\n  \"session_name\": \"<string>\",\n  \"session_id\": \"<uuid>\",\n  \"webhook\": {\n    \"url\": \"<string>\",\n    \"events\": [\n      \"inference.completed\"\n    ],\n    \"metadata\": {}\n  }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
```

* Layer API

> **Changed in v2.** This endpoint’s contract differs from v1\. See the [v2 migration guide](/docs/migration) for the request and response changes before you switch.

Start an AI inference (image, video, 3D, or audio). Pass a `base_model_id`, at least one entry in `reference_sets`, or both — with reference sets alone a compatible base model is picked from them. Returns immediately with an ID. Poll with GET /v2/workspaces/{workspace\_id}/inferences/{inference\_id} for results. Creative Units are not checked here: an underfunded workspace is still accepted and the run then reports FAILED with error\_code INSUFFICIENT\_BALANCE. Use the estimate endpoint’s has\_sufficient\_creative\_units to check before submitting.

Reference-set errors: `REFERENCE_SET_NOT_FOUND` (404 — unknown, deleted, or outside this workspace’s reach), `NO_COMPATIBLE_MODEL` (422 — no enabled base model can apply these sets), `REFERENCE_SET_REQUIRED` (422 — the chosen model needs an applicable set), `REFERENCE_SET_CONFLICT` (422 — two sets supply the same singular adapter), `REFERENCE_SET_LIMIT_EXCEEDED` (422: more sets of one kind than the model takes, e.g. a second ANIMATION set on a 3D animating model), and `INPUT_FILE_REQUIRED` (422 — the sets select an edit-only model with no asset to edit).

## Authorizations

* **[bearerAuth](/docs/v2/rest-api#bearerauth)**
* **[oauth2](/docs/v2/rest-api#oauth2)**
* **[serviceAccount](/docs/v2/rest-api#serviceaccount)**  
generation:write

## Parameters

### Path Parameters

**workspace\_id**

required

_Workspace Id_

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

### Header Parameters

**Idempotency-Key**

string

<= 255 characters

Opaque key making a retry of this request return the first result. A 2xx response is replayed for 24 hours with `Idempotent-Replayed: true`. A 4xx releases the key. A 5xx, or a request still running, holds the key for 120 seconds, during which a retry gets 409; after that a retry executes again. The key covers the method, path, query, and byte-identical body it was first used with; reusing it for a different request is rejected with 422\. Protection is best effort: if the key store is unavailable, or a record is lost early, a retry can execute again even after an earlier 409\. See the Idempotency section of the API description.

## Request Bodyrequired

_ExecuteInferenceV2Request_

REST request body for executing an inference. workspace\_id comes from path.

object

**subtitle\_preset**

_Subtitle Preset_

Caption style, spelled exactly as one of the model’s `subtitle_presets`: any other name is quoted at the default style and refused at launch. Its `subtitle_dynamic_presets` animate word by word and bill at a higher rate, so pass the same preset to the estimate. Omit for the model’s default style.

string

nullable

**subtitle\_color**

_Subtitle Color_

Caption text colour as hex (`#FFFFFF`), for models whose capabilities report `subtitle_primary_color`.

string

nullable /^#(\[0-9A-Fa-f\]{3}){1,2}$/

**subtitle\_secondary\_color**

_Subtitle Secondary Color_

Colour of the words the model emphasises, as hex, for models whose capabilities report `subtitle_secondary_color`.

string

nullable /^#(\[0-9A-Fa-f\]{3}){1,2}$/

**subtitle\_alignment**

_Subtitle Alignment_

Where the captions sit vertically, for models whose capabilities report `subtitle_alignment`.

string

nullable

Allowed values: top center bottom

**base\_model\_id**

_Base Model Id_

Base model to run, as an id (e.g. flux-dev), display name, or community alias.

string

nullable

**reference\_sets**

_Reference Sets_

Reference sets to apply, up to 25.

Array<object>

default: <= 25 items

_InferenceReferenceSetInput_object

**set\_id**

required

_Set Id_

Reference set ID from GET /v2/workspaces/{workspace\_id}/reference-sets.

string format: uuid

**weight**

_Weight_

Weight for the set’s LoRA adapter when one applies. Ignored for sets applied as reference images or prompt text.

number

default: 1 <= 2

**modality**

Any of:

**Modality**

_Modality_

string

Allowed values: text image audio video three\_d playable world

**null**

null

**prompt**

_Prompt_

Text prompt.

string

nullable <= 100000 characters

**negative\_prompt**

_Negative Prompt_

What to steer the output away from. Honored by the models whose `inference-schema` lists `negative_prompt`, and ignored by the rest.

string

nullable <= 100000 characters

**width**

_Width_

Output width in pixels. If not specified, a default resolution based on the model will be applied.

integer

nullable \> 0

**height**

_Height_

Output height in pixels. If not specified, a default resolution based on the model will be applied.

integer

nullable \> 0

**auto\_aspect\_ratio**

_Auto Aspect Ratio_

Derive the output’s shape from the input instead of from width/height. Only on models whose capabilities include autoAspectRatio.

boolean

nullable

**auto\_resolution**

_Auto Resolution_

The size tier of an auto\_aspect\_ratio run (e.g. ‘2K’), one of the model’s autoResolutions. Unset on an image run, the smallest tier that holds the input image.

string

nullable

**batch\_size**

_Batch Size_

Number of outputs (1-16).

integer

default: 4 \>= 1 <= 16

**num\_inference\_steps**

_Num Inference Steps_

Number of diffusion steps.

integer

nullable \> 0

**guidance\_scale**

_Guidance Scale_

Guidance scale (CFG).

number

nullable

**prompt\_strength**

_Prompt Strength_

How closely the generated audio follows the text prompt (0-1); higher means less variation. Honored by ElevenLabs Sound Effects and the Sonilo video-to-music models, and ignored by every other model. To control how closely an image or video generation follows an input image, set guidance\_files\[\].weight instead.

number

nullable <= 1

**quality**

_Quality_

Quality level: low, medium, or high.

string

nullable

Allowed values: low medium high

**sharpness**

_Sharpness_

Output sharpness.

number

nullable

**prompt\_enhancement**

Any of:

**PromptEnhancement**

_PromptEnhancement_

How much effort the provider spends rewriting the prompt before it generates.

One ladder for a dial providers spell a dozen ways: an on/off flag (`enable_prompt_expansion`, `prompt_optimizer`, `enhance_prompt`, `expand_prompt`, `autoprompt`, …) or a mode (MiniMax’s disabled/fast/balanced/quality, Seedream’s fast/standard, Qwen’s none/quality). Member order is the ladder. Each model declares the levels it offers as `prompt_enhancement_levels`, and the provider mapping spells a level its own way; an on/off provider offers OFF and STANDARD.

This is the provider’s own rewriting, distinct from Layer’s prompt-enhance action, which rewrites the prompt visibly before the request is made.

string

Allowed values: off fast standard quality

**null**

null

**duration\_seconds**

_Duration Seconds_

Output length in seconds — a video clip’s duration, or the clip length for audio models whose capabilities report duration\_seconds\_min and duration\_seconds\_max. A value outside a model’s supported range is refused.

number

nullable \> 0

**generate\_audio**

_Generate Audio_

Generate audio with video.

boolean

nullable

**keep\_audio**

_Keep Audio_

Keep audio from input video.

boolean

nullable

**draft**

_Draft_

Render a quick, low-cost draft instead of the full-quality output, on models whose capabilities report draft. Complete the draft later with the model named by the generating model’s draftCompletionModelId, passing the draft file as a DRAFT\_VIDEO input (DRAFT\_WORLD for a world, DRAFT\_MESH for a mesh).

boolean

nullable

**instrumental**

_Instrumental_

Guarantee a track with no vocals, on models whose capabilities report instrumental. Asking for one in the prompt is only a suggestion.

boolean

nullable

**loop**

_Loop_

Compose the clip to repeat with no audible seam, on models whose capabilities report loop.

boolean

nullable

**output\_format**

Any of:

**AudioOutputFormat**

_AudioOutputFormat_

Container for a delivered audio file.

Providers name these their own way and Layer never re-encodes what one returns, so the format a caller asks for is only keepable on models whose capabilities list it. Members are named for their wire value: the frontend artifacts preserve enum _names_, and a name that differed from the value would hand clients a format string the request API rejects.

string

Allowed values: mp3 wav aac flac

**null**

null

**lyrics**

_Lyrics_

Words to be sung, for models whose capabilities report lyrics. A separate input from the prompt, which describes the music itself.

string

nullable

**composition\_plan**

Any of:

**CompositionPlan**

_CompositionPlan_

A track authored as an ordered list of sections rather than as one description.

The split is load-bearing: the plan’s own styles carry what must hold for the whole track, genre, era, production character, palette, and each section carries only what changes. Reversing it produces a track that either drifts or never moves.

A plan replaces the prompt rather than supplementing it. Providers taking a plan ignore the prompt, the requested length and the vocal-free flag, because the plan already states all three.

object

**positive\_styles**

_Positive Styles_

Array<string>

default: 

**negative\_styles**

_Negative Styles_

Array<string>

default: 

**sections**

required

_Sections_

Array<object>

\>= 1 items <= 30 items

_MusicSection_

One section of a planned track, carrying its own length, styles and sung lines.

`positive_styles`/`negative_styles` are the section’s delta: what enters or leaves here, against the palette the plan holds for the whole track. A section’s exclusions are what keep it empty of something the rest of the track has, the plan-wide negatives cannot express “no percussion until the second section”.

object

**name**

required

_Name_

string

\>= 1 characters <= 100 characters

**duration\_seconds**

required

_Duration Seconds_

number

\>= 3 <= 120

**positive\_styles**

_Positive Styles_

Array<string>

default: 

**negative\_styles**

_Negative Styles_

Array<string>

default: 

**lines**

_Lines_

Array<string>

default: 

**respect\_section\_durations**

_Respect Section Durations_

boolean

default: true

**null**

null

**fps**

_Fps_

FPS for LTX video generation (e.g. 25 or 50).

integer

nullable \> 0

**video\_effects**

_Video Effects_

Video effects to apply.

Array<object>

default: 

_ForgeVideoEffectInput_object

**type**

required

_VideoEffectType_

Video effect type. See model capabilities for supported effects per model.

string

Allowed values: general orbit\_360 action\_run agent\_reveal arc arc\_left baseball\_kick basketball\_dunks boxing buckle\_up building\_explosion bullet\_time car\_chasing car\_explosion car\_grip catch catwalk crane\_down crane\_over\_the\_head crane\_up crash\_zoom\_in crash\_zoom\_out dirty\_lens disintegration dolly\_in dolly\_left dolly\_out dolly\_right dolly\_zoom\_in dolly\_zoom\_out double\_dolly downhill\_pov dutch\_angle eyes\_in face\_punch fisheye flying focus\_change fpv\_drone glam handheld head\_tracking hyperlapse invisible jib\_down jib\_up kiss lazy\_susan lens\_crack lens\_flare levitation low\_shutter melting moonwalk\_left moonwalk\_right mouth\_in object\_pov overhead push\_to\_glass rap\_flex robo\_arm set\_on\_fire skateboard\_glide skateboarding skateboard\_kickflip skateboard\_ollie skate\_cruise ski\_carving ski\_powder snorricam snowboard\_carving snowboard\_powder soul\_jump static super\_dolly\_in super\_dolly\_out tentacles through\_object\_in through\_object\_out thunder\_god tilt\_down tilt\_up timelapse\_human timelapse\_landscape turning\_metal whip\_pan wiggle wind\_to\_face yoyo\_zoom zoom\_in zoom\_out

**weight**

_Weight_

Effect strength (0-100).

number

nullable <= 100

**use\_ta\_pose**

_Use Ta Pose_

Deprecated: use pose\_mode. Legacy rig-ready-pose toggle for 3D.

boolean

nullable

**pose\_mode**

Any of:

**PoseMode**

_PoseMode_

Canonical rest pose a character-mesh model is asked to generate in. `A_POSE` places the arms angled down at roughly 45°; `T_POSE` holds them straight out to the sides. Only meaningful for models that advertise the `pose_modes` capability (e.g. Meshy V7).

Deliberately a light top-level module (like `base_model_id`), NOT under `pkg.models.inference`: the Blueprint definition layer registers this as a BlueprintType and migrates legacy node ports, and must do so without pulling in the heavy `pkg.models.inference` package, which would perturb the Temporal workflow-sandbox import graph and split pydantic class identity.

string

Allowed values: A\_POSE T\_POSE

**null**

null

**include\_textures**

_Include Textures_

Include textures in 3D output.

boolean

nullable

**detailed\_geometry**

_Detailed Geometry_

Denser, more detailed geometry (Meshy V7 ultra mode). Costs extra; support varies by model.

boolean

nullable

**remesh\_geometry**

_Remesh Geometry_

Set false to skip the provider’s remesh phase and keep its raw geometry. Support varies by model.

boolean

nullable

**texture\_resolution**

Any of:

**TextureResolution**

_TextureResolution_

Edge length of a generated mesh’s base color texture.

Offered where the model’s `texture_resolutions` capability lists it (Meshy’s and Tripo’s own APIs).

string

Allowed values: RES\_2K RES\_4K RES\_8K

**null**

null

**remove\_lighting**

_Remove Lighting_

Strip baked highlights and shadows from the texture. Support varies by model.

boolean

nullable

**mesh\_density**

Any of:

**MeshDensity**

_MeshDensity_

How many faces a mesh keeps, as a level the provider sizes adaptively.

Stands in for a fixed face limit where the model’s `mesh_densities` capability offers it.

string

Allowed values: ULTRA HIGH MEDIUM LOW

**null**

null

**preserve\_uvs**

_Preserve Uvs_

Keep the mesh’s own UV layout when retexturing. Support varies by model.

boolean

nullable

**segment\_by**

Any of:

**SegmentBy**

_SegmentBy_

What a mesh is split along.

`AUTO` finds the parts itself; `PARTS` cuts along the parts `segment_part_names` names. Offered where the model’s `segment_by` capability lists it.

string

Allowed values: AUTO PARTS

**null**

null

**segment\_part\_names**

_Segment Part Names_

Parts to split along when segment\_by is PARTS, at most 10.

Array<string>

nullable <= 10 items

**segment\_target**

Any of:

**SegmentTarget**

_SegmentTarget_

What a mesh-segmentation model treats the input as, selecting its split strategy. `CHARACTER` splits a humanoid mesh with a body-part template; `GENERAL` splits any mesh by granularity level (e.g. Hi3D Parts).

string

Allowed values: CHARACTER GENERAL

**null**

null

**segment\_parts**

_Segment Parts_

How many parts a CHARACTER split makes. Support varies by model.

integer

nullable \>= 1

**segment\_level**

Any of:

**SegmentLevel**

_SegmentLevel_

Split granularity for a general-target segmentation (more parts as it rises). Only meaningful when the target is `GENERAL`.

string

Allowed values: LOW MEDIUM HIGH

**null**

null

**segment\_strength**

_Segment Strength_

How aggressively a mesh split cuts: higher makes more parts. Support varies by model.

integer

nullable \>= 1

**quad\_mesh**

_Quad Mesh_

Generate quad mesh.

boolean

nullable

**pbr\_materials**

_Pbr Materials_

Generate PBR materials.

boolean

nullable

**low\_poly**

_Low Poly_

Generate low-poly mesh.

boolean

nullable

**generate\_parts**

_Generate Parts_

Generate separate parts.

boolean

nullable

**face\_limit**

_Face Limit_

Face/polygon limit for 3D mesh.

integer

nullable \> 0

**enable\_rigging**

_Enable Rigging_

Rig the generated 3D mesh with a skeleton. Honored by the models whose capabilities report `rigging`.

boolean

nullable

**enable\_animation**

_Enable Animation_

Animate the generated 3D mesh with the motion of the animation reference set passed in `reference_sets` (category `animation`), or the provider’s default motion without one; implies rigging. Honored by the models whose capabilities report `animation`.

boolean

nullable

**stability**

_Stability_

Audio stability (0-1).

number

nullable <= 1

**use\_speaker\_boost**

_Use Speaker Boost_

Boost speaker clarity.

boolean

nullable

**similarity\_boost**

_Similarity Boost_

Voice similarity boost (0-1).

number

nullable <= 1

**style\_exaggeration**

_Style Exaggeration_

Style exaggeration (0-1).

number

nullable <= 1

**speed**

_Speed_

Speech speed multiplier.

number

nullable \> 0

**upscale\_ratio**

_Upscale Ratio_

Upscale factor (e.g. 2.0, 4.0).

number

nullable

**creativity**

_Creativity_

Creative variation strength for upscaling.

number

nullable

**resemblance**

_Resemblance_

Resemblance to original for upscaling.

number

nullable

**denoise**

_Denoise_

Noise removal. On the models whose capabilities report `denoise_range`, in that range; a value outside it is refused.

number

nullable

**compression\_repair**

_Compression Repair_

Compression-artifact removal. On the models whose capabilities report `compression_repair_range`, in that range; a value outside it is refused.

number

nullable

**halo\_reduction**

_Halo Reduction_

Removal of bright edge outlines. On the models whose capabilities report `halo_reduction_range`, in that range; a value outside it is refused.

number

nullable

**recover\_detail**

_Recover Detail_

How much of the source’s own detail is kept. On the models whose capabilities report `recover_detail_range`, in that range; a value outside it is refused.

number

nullable

**detail**

_Detail_

How much fine detail the model adds. On the models whose capabilities report `detail_range`, in that range; a value outside it is refused.

number

nullable

**grain**

_Grain_

Film grain laid over the result. On the models whose capabilities report `grain_range`, in that range; a value outside it is refused.

number

nullable

**refine\_strength**

_Refine Strength_

How strongly lettering and shapes are rebuilt. On the models whose capabilities report `refine_strength_range`, in that range; a value outside it is refused.

number

nullable

**realism**

_Realism_

Bias of added detail toward photorealism. On the models whose capabilities report `realism_range`, in that range; a value outside it is refused.

number

nullable

**face\_enhancement**

_Face Enhancement_

Set false to skip the face-restoration pass, on models whose capabilities report face\_enhancement.

boolean

nullable

**face\_enhancement\_strength**

_Face Enhancement Strength_

Strength of the face pass. On the models whose capabilities report `face_enhancement_strength_range`, in that range; a value outside it is refused.

number

nullable

**face\_enhancement\_creativity**

_Face Enhancement Creativity_

Facial detail the face pass invents. On the models whose capabilities report `face_enhancement_creativity_range`, in that range; a value outside it is refused.

number

nullable

**target\_region**

Any of:

**TargetRegion**

_TargetRegion_

string

Allowed values: all subject background

**null**

null

**color\_preservation**

_Color Preservation_

Keep the source’s palette, on models whose capabilities report color\_preservation.

boolean

nullable

**vectorize**

_Vectorize_

Vectorize the output image.

boolean

nullable

**vectorization\_mode**

Any of:

**VectorizationMode**

_VectorizationMode_

string

Allowed values: spline polygon

**null**

null

**vectorization\_color\_mode**

Any of:

**VectorizationColorMode**

_VectorizationColorMode_

string

Allowed values: color binary

**null**

null

**vectorization\_layering**

Any of:

**VectorizationLayering**

_VectorizationLayering_

string

Allowed values: stacked cutout

**null**

null

**vectorization\_filter\_speckle**

_Vectorization Filter Speckle_

Drop specks smaller than this many pixels. Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable <= 20

**vectorization\_color\_precision**

_Vectorization Color Precision_

Color quantization level; lower merges more colors. Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable \>= 1 <= 10

**vectorization\_layer\_difference**

_Vectorization Layer Difference_

Color difference that splits gradient layers. Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable \>= 1 <= 32

**vectorization\_corner\_threshold**

_Vectorization Corner Threshold_

Minimum angle, in degrees, kept as a sharp corner (spline mode). Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable <= 180

**vectorization\_length\_threshold**

_Vectorization Length Threshold_

Longest curve segment before it is subdivided (spline mode). Honored by the models whose capabilities report `vectorization_controls`.

number

nullable <= 10

**vectorization\_splice\_threshold**

_Vectorization Splice Threshold_

Angle, in degrees, at which a curve is split (spline mode). Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable <= 90

**vectorization\_max\_iterations**

_Vectorization Max Iterations_

Curve-fitting passes. Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable \>= 1 <= 20

**vectorization\_path\_precision**

_Vectorization Path Precision_

Decimal places kept in SVG path coordinates. Honored by the models whose capabilities report `vectorization_controls`.

integer

nullable \>= 1 <= 10

**transparency**

_Transparency_

Put the output on a transparent background. Also accepted as `remove_background`.

boolean

nullable

**reframe**

_Reframe_

Reframe/extend the image.

boolean

nullable

**tileability**

_Tileability_

Generate a seamless texture that tiles without a visible edge. Honored by the models whose `inference-schema` lists `tileability` (list them with `GET .../base-models?tileable=true`), and ignored by the rest.

boolean

nullable

**projection**

Any of:

**ImageProjection**

_ImageProjection_

The geometry an output image is drawn in, when it is not an ordinary flat picture.

string

Allowed values: EQUIRECTANGULAR

**null**

null

**projection\_strength**

_Projection Strength_

How strongly a model’s 360 LoRA draws the projection, as its scale. Unset takes the LoRA’s own.

number

nullable <= 2

**refill**

_Refill_

Outpaint/refill transparent areas.

boolean

nullable

**camera\_transform**

Any of:

**CameraTransformDelta**

_CameraTransformDelta_

Relative adjustments to apply to an existing origin-locked orbit camera state.

object

**distance\_delta**

_Distance Delta_

number

nullable

**rotation\_delta**

Any of:

**null**

_CameraRotationDelta_object

**pitch\_delta**

_Pitch Delta_

number

nullable

**yaw\_delta**

_Yaw Delta_

number

nullable

**roll\_delta**

_Roll Delta_

number

nullable

**CameraRotationDelta**

null

**zoom\_delta**

Any of:

**null**

_CameraZoomDelta_object

**fov\_y\_delta**

_Fov Y Delta_

number

nullable

**CameraZoomDelta**

null

**null**

null

**camera\_trajectory**

_Camera Trajectory_

A camera path for an image-to-video run: 2 to 12 keyframes, each an orbit pose (`azimuth` and `elevation` in degrees, `distance` where 1 is the source image’s framing) at a `time` from 0 (first frame) to 1 (last). Honored by the models whose capabilities report `camera_trajectory`.

Array<object>

nullable \>= 2 items <= 12 items

_CameraTrajectoryKeyframe_

One orbit-camera pose at a normalized point in a generated clip.

object

**time**

required

_Time_

number

<= 1

**azimuth**

required

_Azimuth_

number

**elevation**

required

_Elevation_

number

\>= -90 <= 90

**distance**

required

_Distance_

number

\> 0

**scene\_lighting**

Any of:

**SceneLightingConfig**

_SceneLightingConfig_

An array of orbiting light sources to populate the graphics engine environment.

object

**lights**

_Lights_

Array<object>

default: 

_OrbitLight_object

**id**

required

_Id_

string

**distance**

required

_Distance_

number

\>= 0.0001

**rotation**

required

_OrbitLightRotation_object

**pitch**

required

_Pitch_

number

\>= -90 <= 90

**yaw**

required

_Yaw_

number

\>= -360 <= 360

**properties**

required

_OrbitLightProperties_object

**intensity**

required

_Intensity_

number

**color\_hex**

required

_Color Hex_

string

/^#(\[A-Fa-f0-9\]{6})$/

**cast\_shadows**

_Cast Shadows_

boolean

nullable

**null**

null

**tile\_grid**

Any of:

**TileGrid**

_TileGrid_

One tile’s place on the grid. Every tile of a set shares all but the footprint and height.

object

**shape**

_TileShape_

The outline of one cell of the grid, seen from straight above.

string

default: SQUARE

Allowed values: SQUARE HEXAGON

**orientation**

Any of:

**null**

_TileOrientation_

How a cell’s outline is turned to the camera.

A square cell is either `DIAMOND`, turned 45 degrees so its base reads as a diamond (the isometric look), or `ALIGNED` with the camera, as top-down maps are. A hexagon has either a vertex (`POINTY_TOP`) or an edge (`FLAT_TOP`) at the top.

string

Allowed values: DIAMOND ALIGNED POINTY\_TOP FLAT\_TOP

**TileOrientation**

null

**elevation**

_Elevation_

Unset takes 30 (2:1 dimetric) for a square, 60 for a hexagon.

number

nullable \>= 20 <= 90

**facing**

_TileFacing_

A quarter turn of the camera around a diamond tile, in degrees clockwise seen from above.

0 is the facing a set is drawn in first; the others show the same subject’s other sides. A hexagon is only drawn facing 0.

integer

0

Allowed values: 0 90 180 270

**footprint\_width**

_Footprint Width_

integer

default: 1 \>= 1 <= 8

**footprint\_depth**

_Footprint Depth_

integer

default: 1 \>= 1 <= 8

**height**

_Height_

number

0 <= 6

**tile\_width**

_Tile Width_

integer

default: 128 \>= 16 <= 1024

**light\_from**

_TileLightSide_

The side the key light comes from, seen from the camera.

string

default: left

Allowed values: left right

**null**

null

**output\_fit**

Any of:

**OutputFit**

_OutputFit_object

**trim**

_Trim_

boolean

**canvas**

_OutputFitCanvas_

string

default: CONTENT

Allowed values: CONTENT FIXED

**width**

_Width_

integer

nullable \>= 1 <= 4096

**height**

_Height_

integer

nullable \>= 1 <= 4096

**scale**

_OutputFitScale_

How the drawing goes onto a fixed canvas. The names follow the workflow Resize node’s.

string

default: PLACE

Allowed values: PLACE SHRINK\_AND\_PAD FIT\_AND\_PAD FIT\_AND\_CROP STRETCH

**anchor**

_OutputFitAnchor_

The point of the drawing that lands on the same point of the canvas.

`BASE` is a game tile’s base: its anchor, the bottom centre of the cell it stands on, lands at the bottom centre of the canvas, so tiles of one grid stand on the same point whatever rises above them.

string

default: CENTER

Allowed values: TOP\_LEFT TOP\_CENTER TOP\_RIGHT CENTER\_LEFT CENTER CENTER\_RIGHT BOTTOM\_LEFT BOTTOM\_CENTER BOTTOM\_RIGHT BASE

**padding**

_Padding_

integer

0 <= 512

**null**

null

**nine\_slice**

_Nine Slice_

Deliver the image as a 9-slice UI element (a button, frame or panel that resizes): after everything else the run does, the plain band through its middle is found on each axis, the edges and centre are made to tile (painted texture kept, light evened out), and the insets are recorded as the file’s `nineSlice` metadata. An image with no such band is delivered as drawn, without insets. Image outputs only.

boolean

nullable

**parallax**

Any of:

**ParallaxSplit**

_ParallaxSplit_object

**layers**

_Layers_

integer

default: 5 \>= 2 <= 6

**cuts**

_Cuts_

Array<number>

nullable

**loop**

_Loop_

boolean

**null**

null

**color\_palette**

Any of:

**InferenceColorPalette**

_InferenceColorPalette_

The colors a generation is asked to use, and the reference set they were picked from.

The run uses the colors it carries: a later edit to the set changes no run already made. `reference_set_id` only names where they came from, so a form can show and restore it.

object

**colors**

_Colors_

Array<object>

default: <= 16 items

_PaletteColor_

One named color of a palette.

object

**name**

required

_Name_

string

\>= 1 characters <= 64 characters

**hex**

required

_Hex_

string

/^#(?:\[0-9A-Fa-f\]{6}|\[0-9A-Fa-f\]{3})$/

**role**

_Role_

string

nullable <= 64 characters

**reference\_set\_id**

_Reference Set Id_

string format: uuid

nullable

**null**

null

**expression**

_Expression_

The expression a face edit gives the face, one of the names the model’s capabilities list under `expressions`.

string

nullable

**target\_language**

_Target Language_

The language a dub speaks, as one of the ISO 639-1 codes the model’s capabilities list under `dub_languages`.

string

nullable

**audio\_sections**

_Audio Sections_

Regenerate stretches of the init audio: each section is a window from `start_seconds` to `end_seconds`, measured from the clip’s `anchor` (its start by default), that the prompt rewrites while the rest is kept. Honored by the audio models listed for the `inpainting` use case.

Array<object>

default: 

_AudioEditSection_

An interior time window of the source clip to regenerate (inpaint).

Times are non-negative magnitudes measured from `anchor`. The window is always inside the clip; extending past the clip is outpainting (see \[\[AudioExtension\]\]), a separate operation.

object

**start\_seconds**

required

_Start Seconds_

number

**end\_seconds**

required

_End Seconds_

number

**anchor**

_AudioAnchor_

Which boundary of the source clip a section’s times are measured from.

string

default: START

Allowed values: START END

**audio\_extension**

Any of:

**AudioExtension**

_AudioExtension_

Outpaint: how much audio to add before/after the source clip.

object

**before\_seconds**

_Before Seconds_

number

0

**after\_seconds**

_After Seconds_

number

0

**null**

null

**video\_section**

Any of:

**VideoSection**

_VideoSection_

A time window of the source clip, in seconds from its start, that an edit replaces.

A video insert cuts the source at `start_seconds`, plays a generated scene, then picks the source back up at `end_seconds`.

object

**start\_seconds**

required

_Start Seconds_

number

**end\_seconds**

required

_End Seconds_

number

**null**

null

**guidance\_files**

_Guidance Files_

Reference images/files to guide generation.

Array<object>

default: <= 20 items

_ForgeGuidanceFileInput_object

**file\_id**

required

_File Id_

File ID of an uploaded file.

string format: uuid

**type**

required

_GuidanceFileType_

Guidance type. See model capabilities for supported types per model.

string

Allowed values: init\_image reference\_image scribble color\_sketch pose depth canny softedge\_hed segmentation lineart face ip\_adapter first\_frame last\_frame init\_video reference\_video draft\_video init\_mesh texture\_image draft\_mesh element\_frontal\_image element\_reference\_image element\_video draft\_world init\_audio reference\_audio

**weight**

_Weight_

Influence weight (0-1). Defaults to 0.5 for init, 1 for others.

number

nullable <= 1

**view**

Any of:

**MultiViewSlot**

_MultiViewSlot_

The view a source image shows, for 3D models that read their sources by view.

string

Allowed values: FRONT LEFT BACK RIGHT

**null**

null

**annotations**

Any of:

**ImageAnnotations**

_ImageAnnotations_

The marks drawn on one image, in the order they are numbered.

object

**items**

_Items_

Array<object>

default: <= 32 items

_ImageAnnotation_

One mark. Its number, on the image and in the legend, is its position in the list plus one.

object

**id**

required

_Id_

string

\>= 1 characters <= 64 characters

**kind**

required

_ImageAnnotationKind_

string

Allowed values: BOX ELLIPSE ARROW FREEHAND PIN

**intent**

_ImageAnnotationIntent_

string

default: EDIT

Allowed values: EDIT REMOVE MOVE

**points**

required

_Points_

Array<object>

_ImageAnnotationPoint_

A point on the image, from (0, 0) at the top left to (1, 1) at the bottom right.

The image is the one the slot sends, before the model fits it: the file as stored (or, for a video or a 3D model, the frame taken from it, `video_to_image` / `mesh_to_image`) after its flip, scale, rotation and crop. Marks are the last edit on it.

object

**x**

required

_X_

number

<= 1

**y**

required

_Y_

number

<= 1

**note**

_Note_

string

nullable <= 500 characters

**color**

_Color_

string

nullable

**source\_id**

_Source Id_

string

nullable

**color**

_Color_

string

nullable

**null**

null

**seed**

_Seed_

Random seed. -1 for random.

integer

default: -1

**mask**

Any of:

**ForgeMaskInput**

_ForgeMaskInput_object

**file\_id**

_File Id_

Mask image file ID.

string format: uuid

nullable

**for\_transparency**

_For Transparency_

Use the init image’s transparent areas as the mask. As the only mask source, a fully opaque init used as stored (no transform, padding or target) is refused; a mask file works on any init.

boolean

nullable

**for\_nontransparency**

_For Nontransparency_

Use non-transparent areas as mask.

boolean

nullable

**edge\_radius**

_Edge Radius_

Mask edge blur radius in pixels.

integer

0

**null**

null

**session\_name**

_Session Name_

Organize this run under the most recent active session with this name, creating one if none matches. Ignored when `session_id` is given.

string

nullable <= 255 characters

**session\_id**

_Session Id_

Organize this run under this session, from GET /v2/workspaces/{workspace\_id}/sessions. Takes precedence over `session_name`, and must belong to this workspace.

string format: uuid

nullable

**webhook**

Any of:

**WebhookInput**

_WebhookInput_

Where to POST this request’s terminal events, and what to include with them.

object

**url**

required

_Url_

HTTPS URL that receives a POST when this request reaches a terminal state. Must be publicly reachable; must not redirect. Acknowledge with any 2xx within 10 seconds and do the work asynchronously. Reply 410 to stop delivery permanently.

string

<= 2048 characters

**events**

_Events_

Narrows what is delivered. Omit to receive every event this request can produce, which is what `expected_events` on the response lists.

Array<string>

nullable

Allowed values: inference.completed inference.failed inference.cancelled training.succeeded training.failed scoring\_run.completed scoring\_run.failed workflow\_run.succeeded workflow\_run.failed workflow\_run.cancelled

**metadata**

_Metadata_

Opaque key/value pairs echoed back verbatim in every delivery, for correlating a callback with your own records. At most 10 keys and 1024 bytes in total.

object

**_key_**

additional properties

string

**null**

null

## Responses

### 202

Successful Response

_ExecuteInferenceV2Output_object

**inference\_id**

required

_Inference Id_

Unique identifier for this inference run.

string format: uuid

**status**

required

_InferenceStatus_

Current status: IN\_PROGRESS.

string

Allowed values: in\_progress complete failed cancelled deleted

**estimated\_price\_creative\_units**

_Estimated Price Creative Units_

Estimated price in Creative Units.

number

nullable

**poll\_interval\_seconds**

required

_Poll Interval Seconds_

Suggested polling interval in seconds.

integer

**created\_at**

required

_Created At_

Timestamp of when the run was created.

string format: date-time

**session\_id**

_Session Id_

Session ID the run was added to, if a session was specified.

string format: uuid

nullable

**normalized\_parameters**

Any of:

**NormalizedInferenceParametersV2**

_NormalizedInferenceParametersV2_

Inference parameters after model-specific normalization.

These reflect the actual values used for generation, including model defaults applied for any parameters not explicitly set.

object

**width**

_Width_

Resolved output width in pixels.

integer

nullable

**height**

_Height_

Resolved output height in pixels.

integer

nullable

**batch\_size**

_Batch Size_

Number of outputs to generate.

integer

nullable

**num\_inference\_steps**

_Num Inference Steps_

Resolved number of diffusion steps.

integer

nullable

**guidance\_scale**

_Guidance Scale_

Resolved guidance scale.

number

nullable

**duration\_seconds**

_Duration Seconds_

Resolved output length in seconds — video duration or audio clip length.

number

nullable

**fps**

_Fps_

Resolved FPS.

integer

nullable

**null**

null

**base\_model\_id**

required

_Base Model Id_

Base model used for the run, resolved or auto-picked.

string

**reference\_set\_contributions**

_Reference Set Contributions_

Per-set summary of what each reference set contributed.

Array<object>

default: 

_ForgeReferenceSetContribution_object

**set\_id**

_Set Id_

Reference Set ID this contribution belongs to, if any.

string format: uuid

nullable

**lora\_applied**

_Lora Applied_

True when a LoRA finetune was applied for this set.

boolean

**animation\_applied**

_Animation Applied_

True when an animation (Meshy rigging action) finetune was applied for this set.

boolean

**voice\_applied**

_Voice Applied_

True when a voice (ElevenLabs) finetune was applied for this set.

boolean

**mapped\_asset\_count**

_Mapped Asset Count_

Number of assets successfully mapped to guidance inputs.

integer

0

**palette\_applied**

_Palette Applied_

True when the set’s palette went into the run’s color palette (up to the model’s color limit), or a palette passed with the request stood in for it.

boolean

**prompt\_fallback\_applied**

_Prompt Fallback Applied_

True when the set fell back to prompt-only representation.

boolean

**auto\_prompt\_applied**

_Auto Prompt Applied_

True when the set’s auto prompt addition was appended to the prompt. Informational: the text rides on top of whatever else the set contributed and is not a degradation.

boolean

**lora\_available\_but\_incompatible**

_Lora Available But Incompatible_

True when SBMC has a LoRA for this set on another base model but not the one used.

boolean

**skipped\_not\_applicable**

_Skipped Not Applicable_

True when the set isn’t applicable to the chosen model (its modality / applicable base models exclude it) so no LoRA or assets were applied.

boolean

**skipped\_irrelevant\_category**

_Skipped Irrelevant Category_

True when the set’s category means nothing for the chosen model’s modality (a camera move on an image model), so it was dropped entirely, prompt text included. Implies skipped\_not\_applicable.

boolean

**reference\_sets\_degraded**

_Reference Sets Degraded_

True when at least one attached reference set did not meaningfully contribute. The run still costs Creative Units.

boolean

**reference\_sets\_warning**

_Reference Sets Warning_

Names each degraded reference set and why, or null when none is degraded.

string

nullable

**expected\_events**

_Expected Events_

Deliveries this run will produce, resolved when it was submitted. Empty when no webhook was supplied. A generation reports its own outcome, and additionally produces a scoring run when this scope has automatic scoring rules — so this is how to tell ‘more is coming’ from ‘that was everything’. Best-effort: a rule turned off mid-run can still remove an event listed here.

Array<string>

default: 

Allowed values: inference.completed inference.failed inference.cancelled training.succeeded training.failed scoring\_run.completed scoring\_run.failed workflow\_run.succeeded workflow\_run.failed workflow\_run.cancelled

##### Example

```json
{
  "status": "in_progress",
  "reference_set_contributions": [],
  "reference_sets_degraded": false,
  "expected_events": []
}
```

### 401

Unauthenticated — missing or invalid Bearer token.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 403

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 404

Resource not found.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 409

The outcome of the request with this `Idempotency-Key` is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in `Retry-After`.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 422

Invalid input parameters, or an `Idempotency-Key` reused for a different request.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 429

Rate limited — retry after the number of seconds in `Retry-After`.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```

### 500

Internal server error.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

**error\_code**

required

Machine-readable error code: the last path segment of `type`.

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description.",
  "error_code": "ERROR_CODE"
}
```
