---
title: "Execute inference"
method: POST
path: "/v1/workspaces/{workspace_id}/inferences"
tags: ["Inferences"]
---

# Execute inference

`POST /v1/workspaces/{workspace_id}/inferences`

Start an AI inference (image, video, 3D, or audio). Returns immediately with an ID. Poll with GET /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.

## Path parameters

- `workspace_id` string, uuid, required — Id of the workspace that owns the resource.

## Headers

- `Idempotency-Key` string

## Request body

- ExecuteInferenceRequest — REST request body for executing an inference. workspace_id comes from path.
  - `model_id` string, uuid, required — Model/style ID to use for generation.
  - `weight` number — Style/LoRA strength applied to the model. 1.0 = as trained; lower weakens, higher over-applies the style. Only affects LoRA/adapter-backed styles; ignored for models without a trainable adapter.
  - `prompt` string, nullable — Text prompt.
  - `width` integer, nullable — Output width in pixels. If not specified, a default resolution based on the model will be applied.
  - `height` integer, nullable — Output height in pixels. If not specified, a default resolution based on the model will be applied.
  - `batch_size` integer — Number of outputs (1-16).
  - `num_inference_steps` integer, nullable — Number of diffusion steps.
  - `guidance_scale` number, nullable — Guidance scale (CFG).
  - `prompt_strength` number, nullable — 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` 'low' | 'medium' | 'high', nullable — Quality level: low, medium, or high.
  - `sharpness` number, nullable — Output sharpness.
  - `duration_seconds` number, nullable — Video duration in seconds.
  - `generate_audio` boolean, nullable — Generate audio with video.
  - `keep_audio` boolean, nullable — Keep audio from input video.
  - `fps` integer, nullable — FPS for LTX video generation (e.g. 25 or 50).
  - `video_effects` ForgeVideoEffectInput[] — Video effects to apply.
    - `type` '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', required
    - `weight` number, nullable — Effect strength (0-100).
  - `use_ta_pose` boolean, nullable — Deprecated: use pose_mode. Legacy rig-ready-pose toggle for 3D.
  - `pose_mode` 'A_POSE' | 'T_POSE' — 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` boolean, nullable — Include textures in 3D output.
  - `quad_mesh` boolean, nullable — Generate quad mesh.
  - `pbr_materials` boolean, nullable — Generate PBR materials.
  - `low_poly` boolean, nullable — Generate low-poly mesh.
  - `generate_parts` boolean, nullable — Generate separate parts.
  - `face_limit` integer, nullable — Face/polygon limit for 3D mesh.
  - `stability` number, nullable — Audio stability (0-1).
  - `use_speaker_boost` boolean, nullable — Boost speaker clarity.
  - `similarity_boost` number, nullable — Voice similarity boost (0-1).
  - `style_exaggeration` number, nullable — Style exaggeration (0-1).
  - `speed` number, nullable — Speech speed multiplier.
  - `upscale_ratio` number, nullable — Upscale factor (e.g. 2.0, 4.0).
  - `creativity` number, nullable — Creative variation strength for upscaling.
  - `resemblance` number, nullable — Resemblance to original for upscaling.
  - `vectorize` boolean, nullable — Vectorize the output image.
  - `remove_background` boolean, nullable — Remove background from output.
  - `reframe` boolean, nullable — Reframe/extend the image.
  - `refill` boolean, nullable — Outpaint/refill transparent areas.
  - `seed` integer — Random seed. -1 for random.
  - `guidance_files` ForgeGuidanceFileInput[] — Reference images/files to guide generation.
    - `file_id` string, uuid, required — File ID of an uploaded file.
    - `type` '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' | 'init_mesh' | 'texture_image' | 'element_frontal_image' | 'element_reference_image' | 'element_video' | 'init_audio' | 'reference_audio', required — What a guidance file *is*. The type names the medium and the slot the file occupies. Where a model conditions on a file through a different provider input — the legacy IP-adapter path — that is its own type, because it is not the same slot.
    - `weight` number, nullable — Influence weight (0-1). Defaults to 0.5 for init, 1 for others.
  - `mask` ForgeMaskInput
    - `file_id` string, uuid, nullable — Mask image file ID.
    - `for_transparency` boolean, nullable — Use transparent areas as mask.
    - `for_nontransparency` boolean, nullable — Use non-transparent areas as mask.
    - `edge_radius` integer — Mask edge blur radius in pixels.
  - `session_name` string, nullable — Session name.

## Response `202`

Successful Response

- ExecuteForgeOutput
  - `inference_id` string, uuid, required — Unique identifier for this forge run.
  - `status` 'in_progress' | 'complete' | 'failed' | 'cancelled' | 'deleted', required
  - `estimated_price_creative_units` number, nullable — Estimated price in Creative Units.
  - `poll_interval_seconds` integer, required — Suggested polling interval in seconds.
  - `created_at` string, date-time, required — Timestamp of when the run was created.
  - `session_id` string, uuid, nullable — Session ID the run was added to, if a session was specified.
  - `normalized_parameters` NormalizedInferenceParameters — Inference parameters after model-specific normalization. These reflect the actual values used for generation, including model defaults applied for any parameters not explicitly set.
    - `width` integer, nullable — Resolved output width in pixels.
    - `height` integer, nullable — Resolved output height in pixels.
    - `batch_size` integer, nullable — Number of outputs to generate.
    - `num_inference_steps` integer, nullable — Resolved number of diffusion steps.
    - `guidance_scale` number, nullable — Resolved guidance scale.
    - `duration_seconds` number, nullable — Resolved video duration in seconds.
    - `fps` integer, nullable — Resolved FPS.

## Other responses

- `401` — Unauthenticated — missing or invalid Bearer token.
- `403` — Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.
- `404` — Resource not found.
- `409` — The request with this `Idempotency-Key` is still running — retry after the number of seconds in `Retry-After`.
- `422` — Invalid input parameters, or an `Idempotency-Key` reused for a different request.
- `429` — Rate limited — retry after the number of seconds in `Retry-After`.
- `500` — Internal server error.

---

[API](https://skmtc.dev/layer/apis/layer-rest-api.md) · [All operations](https://skmtc.dev/layer/apis/layer-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/layer/layer-rest-api/revisions/fafc779f9ba2/schema)
