Estimate inference price
Viewing v2— current version
curl --request POST \ --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "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>" ], "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, "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": [], "mask": { "file_id": "<uuid>", "for_transparency": true, "for_nontransparency": true, "edge_radius": 0 }}'import requests
url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate"
payload = { "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>"], "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, "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": [], "mask": { "file_id": "<uuid>", "for_transparency": True, "for_nontransparency": True, "edge_radius": 0 }}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"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>"],"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,"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":[],"mask":{"file_id":"<uuid>","for_transparency":true,"for_nontransparency":true,"edge_radius":0}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate"
payload := strings.NewReader("{\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 \"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 \"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 \"mask\": {\n \"file_id\": \"<uuid>\",\n \"for_transparency\": true,\n \"for_nontransparency\": true,\n \"edge_radius\": 0\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
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate", 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([ '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>' ], '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, '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' => [
], 'mask' => [ 'file_id' => '<uuid>', 'for_transparency' => null, 'for_nontransparency' => null, 'edge_radius' => 0 ] ]), 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;}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{\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 \"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 \"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 \"mask\": {\n \"file_id\": \"<uuid>\",\n \"for_transparency\": true,\n \"for_nontransparency\": true,\n \"edge_radius\": 0\n }\n}");Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate")
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 \"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 \"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 \"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 \"mask\": {\n \"file_id\": \"<uuid>\",\n \"for_transparency\": true,\n \"for_nontransparency\": true,\n \"edge_radius\": 0\n }\n}"
response = http.request(request)puts response.read_bodyvar client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/inferences/estimate");var request = new RestRequest("", Method.Post);request.AddHeader("Authorization", "Bearer <token>");request.AddHeader("Content-Type", "application/json");request.AddParameter("application/json", "{\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 \"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 \"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 \"mask\": {\n \"file_id\": \"<uuid>\",\n \"for_transparency\": true,\n \"for_nontransparency\": true,\n \"edge_radius\": 0\n }\n}", ParameterType.RequestBody);var response = client.Execute(request);Changed in v2. This endpoint’s contract differs from v1. See the v2 migration guide for the request and response changes before you switch.
Estimate the Creative Units cost of an inference with given parameters. Prices through the same reference-set translation and model selection as the execute endpoint, so the price matches what execution charges for identical inputs.
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
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Id of the workspace that owns the resource.
Id of the workspace that owns the resource.
Header Parameters
Section titled “Header Parameters”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
Section titled “Request Bodyrequired”REST request body for estimating inference price. workspace_id comes from path.
object
Base model to run, as an id (e.g. flux-dev), display name, or community alias.
Reference sets to apply, up to 10.
object
Reference set ID from GET /v2/workspaces/{workspace_id}/reference-sets.
Weight for the set’s LoRA adapter when one applies. Ignored for sets applied as reference images or prompt text.
Text prompt.
What to steer the output away from. Honored by the models whose inference-schema lists negative_prompt, and ignored by the rest.
Output width in pixels. If not specified, a default resolution based on the model will be applied.
Output height in pixels. If not specified, a default resolution based on the model will be applied.
Derive the output’s shape from the input instead of from width/height. Only on models whose capabilities include autoAspectRatio.
The size tier of an auto_aspect_ratio run (e.g. ‘2K’), one of the model’s autoResolutions. Unset, the size follows the input.
Number of outputs (1-16).
Number of diffusion steps.
Guidance scale (CFG).
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.
Quality level: low, medium, or high.
Output sharpness.
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.
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.
Generate audio with video.
Keep audio from input video.
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).
Guarantee a track with no vocals, on models whose capabilities report instrumental. Asking for one in the prompt is only a suggestion.
Compose the clip to repeat with no audible seam, on models whose capabilities report loop.
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.
Words to be sung, for models whose capabilities report lyrics. A separate input from the prompt, which describes the music itself.
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
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
FPS for LTX video generation (e.g. 25 or 50).
Video effects to apply.
object
Video effect type. See model capabilities for supported effects per model.
Effect strength (0-100).
Deprecated: use pose_mode. Legacy rig-ready-pose toggle for 3D.
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.
Include textures in 3D output.
Denser, more detailed geometry (Meshy V7 ultra mode). Costs extra; support varies by model.
Set false to skip the provider’s remesh phase and keep its raw geometry. Support varies by model.
Edge length of a generated mesh’s base color texture.
Offered where the model’s texture_resolutions capability lists it (Meshy’s own API).
Strip baked highlights and shadows from the texture. Support varies by model.
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.
Keep the mesh’s own UV layout when retexturing. Support varies by model.
Parts to split along when segment_by is PARTS, at most 10.
Generate quad mesh.
Generate PBR materials.
Generate low-poly mesh.
Generate separate parts.
Face/polygon limit for 3D mesh.
Rig the generated 3D mesh with a skeleton. Honored by the models whose capabilities report rigging.
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.
Audio stability (0-1).
Boost speaker clarity.
Voice similarity boost (0-1).
Style exaggeration (0-1).
Speech speed multiplier.
Upscale factor (e.g. 2.0, 4.0).
Creative variation strength for upscaling.
Resemblance to original for upscaling.
Noise removal. On the models whose capabilities report denoise_range, in that range; a value outside it is refused.
Compression-artifact removal. On the models whose capabilities report compression_repair_range, in that range; a value outside it is refused.
Removal of bright edge outlines. On the models whose capabilities report halo_reduction_range, in that range; a value outside it is refused.
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.
How much fine detail the model adds. On the models whose capabilities report detail_range, in that range; a value outside it is refused.
Film grain laid over the result. On the models whose capabilities report grain_range, in that range; a value outside it is refused.
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.
Bias of added detail toward photorealism. On the models whose capabilities report realism_range, in that range; a value outside it is refused.
Set false to skip the face-restoration pass, on models whose capabilities report face_enhancement.
Strength of the face pass. On the models whose capabilities report face_enhancement_strength_range, in that range; a value outside it is refused.
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.
Keep the source’s palette, on models whose capabilities report color_preservation.
Vectorize the output image.
Drop specks smaller than this many pixels. Honored by the models whose capabilities report vectorization_controls.
Color quantization level; lower merges more colors. Honored by the models whose capabilities report vectorization_controls.
Color difference that splits gradient layers. Honored by the models whose capabilities report vectorization_controls.
Minimum angle, in degrees, kept as a sharp corner (spline mode). Honored by the models whose capabilities report vectorization_controls.
Longest curve segment before it is subdivided (spline mode). Honored by the models whose capabilities report vectorization_controls.
Angle, in degrees, at which a curve is split (spline mode). Honored by the models whose capabilities report vectorization_controls.
Curve-fitting passes. Honored by the models whose capabilities report vectorization_controls.
Decimal places kept in SVG path coordinates. Honored by the models whose capabilities report vectorization_controls.
Put the output on a transparent background. Also accepted as remove_background.
Reframe/extend the image.
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.
The geometry an output image is drawn in, when it is not an ordinary flat picture.
How strongly a model’s 360 LoRA draws the projection, as its scale. Unset takes the LoRA’s own.
Outpaint/refill transparent areas.
Relative adjustments to apply to an existing origin-locked orbit camera state.
object
object
object
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.
One orbit-camera pose at a normalized point in a generated clip.
object
An array of orbiting light sources to populate the graphics engine environment.
object
object
object
object
One tile’s place on the grid. Every tile of a set shares all but the footprint and height.
object
The outline of one cell of the grid, seen from straight above.
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.
Unset takes 30 (2:1 dimetric) for a square, 60 for a hexagon.
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.
The side the key light comes from, seen from the camera.
object
How the drawing goes onto a fixed canvas. The names follow the workflow Resize node’s.
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.
Deliver the image as a 9-slice UI element (a button, frame or panel that stretches): after everything else the run does, the plain band through its middle is found on each axis, the stretched regions are cleaned so nothing smears, 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.
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
One named color of a palette.
object
The expression a face edit gives the face, one of the names the model’s capabilities list under expressions.
The language a dub speaks, as one of the ISO 639-1 codes the model’s capabilities list under dub_languages.
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.
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
Which boundary of the source clip a section’s times are measured from.
Outpaint: how much audio to add before/after the source clip.
object
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
Reference images/files to guide generation.
object
File ID of an uploaded file.
Guidance type. See model capabilities for supported types per model.
Influence weight (0-1). Defaults to 0.5 for init, 1 for others.
The view a source image shows, for 3D models that read their sources by view.
object
Mask image file ID.
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.
Use non-transparent areas as mask.
Mask edge blur radius in pixels.
Responses
Section titled “Responses”Successful Response
object
Total estimated Creative Units price for this run.
Usable Creative Units balance (total balance minus reserved by in-progress generations).
Usable balance after subtracting the estimated price. Can be negative.
Whether the workspace has enough available Creative Units to cover the estimated price.
Base model this price refers to, resolved or auto-picked.
True when no base_model_id was supplied — the base model was selected from the reference sets.
Per-set summary of what each reference set would contribute to this run.
object
Reference Set ID this contribution belongs to, if any.
True when a LoRA finetune was applied for this set.
True when an animation (Meshy rigging action) finetune was applied for this set.
True when a voice (ElevenLabs) finetune was applied for this set.
Number of assets successfully mapped to guidance inputs.
True when the set’s color palette was appended to the prompt.
True when the set fell back to prompt-only representation.
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.
True when SBMC has a LoRA for this set on another base model but not the one used.
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.
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.
True when at least one attached reference set would not meaningfully contribute on the selected model.
Names each degraded reference set and why, or null when none is degraded.
Example
{ "reference_set_contributions": [], "reference_sets_degraded": false}Unauthenticated — missing or invalid Bearer token.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Resource not found.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}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
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Invalid input parameters, or an Idempotency-Key reused for a different request.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Rate limited — retry after the number of seconds in Retry-After.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Internal server error.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}