Skip to main content
POST
/
v1
/
workspaces
/
{workspace_id}
/
inferences
Execute inference
curl --request POST \
  --url https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/inferences \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "prompt": "<string>",
  "width": 1,
  "height": 1,
  "batch_size": 4,
  "num_inference_steps": 1,
  "guidance_scale": 123,
  "prompt_strength": 0.5,
  "quality": "low",
  "sharpness": 123,
  "duration_seconds": 1,
  "generate_audio": true,
  "keep_audio": true,
  "fps": 1,
  "video_effects": [],
  "use_ta_pose": true,
  "include_textures": true,
  "quad_mesh": true,
  "pbr_materials": true,
  "low_poly": true,
  "generate_parts": true,
  "face_limit": 1,
  "stability": 0.5,
  "use_speaker_boost": true,
  "similarity_boost": 0.5,
  "style_exaggeration": 0.5,
  "speed": 1,
  "upscale_ratio": 123,
  "creativity": 123,
  "resemblance": 123,
  "vectorize": true,
  "remove_background": true,
  "reframe": true,
  "refill": true,
  "seed": -1,
  "guidance_files": [],
  "mask": {
    "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "for_transparency": true,
    "for_nontransparency": true,
    "edge_radius": 0
  },
  "session_name": "<string>"
}
'
{
  "inference_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "in_progress",
  "poll_interval_seconds": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "estimated_price_creative_units": 123,
  "session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "normalized_parameters": {
    "width": 123,
    "height": 123,
    "batch_size": 123,
    "num_inference_steps": 123,
    "guidance_scale": 123,
    "duration_seconds": 123,
    "fps": 123
  }
}

Authorizations

Authorization
string
header
required

Personal Access Token or OAuth2 JWT. Create a PAT at app.layer.ai → Settings → Personal Access Tokens.

Path Parameters

workspace_id
string<uuid>
required

Body

application/json

REST request body for executing an inference. workspace_id comes from path.

model_id
string<uuid>
required

Model/style ID to use for generation.

prompt
string | null

Text prompt.

Maximum string length: 100000
width
integer | null

Output width in pixels.

Required range: x > 0
height
integer | null

Output height in pixels.

Required range: x > 0
batch_size
integer
default:4

Number of outputs (1-16).

Required range: 1 <= x <= 16
num_inference_steps
integer | null

Number of diffusion steps.

Required range: x > 0
guidance_scale
number | null

Guidance scale (CFG).

prompt_strength
number | null

Prompt strength for img2img (0-1).

Required range: 0 <= x <= 1
quality
enum<string> | null

Quality level: low, medium, or high.

Available options:
low,
medium,
high
sharpness
number | null

Output sharpness.

duration_seconds
number | null

Video duration in seconds.

Required range: x > 0
generate_audio
boolean | null

Generate audio with video.

keep_audio
boolean | null

Keep audio from input video.

fps
integer | null

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

Required range: x > 0
video_effects
ForgeVideoEffectInput · object[]

Video effects to apply.

use_ta_pose
boolean | null

Use T/A pose for 3D.

include_textures
boolean | null

Include textures in 3D output.

quad_mesh
boolean | null

Generate quad mesh.

pbr_materials
boolean | null

Generate PBR materials.

low_poly
boolean | null

Generate low-poly mesh.

generate_parts
boolean | null

Generate separate parts.

face_limit
integer | null

Face/polygon limit for 3D mesh.

Required range: x > 0
stability
number | null

Audio stability (0-1).

Required range: 0 <= x <= 1
use_speaker_boost
boolean | null

Boost speaker clarity.

similarity_boost
number | null

Voice similarity boost (0-1).

Required range: 0 <= x <= 1
style_exaggeration
number | null

Style exaggeration (0-1).

Required range: 0 <= x <= 1
speed
number | null

Speech speed multiplier.

Required range: x > 0
upscale_ratio
number | null

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

creativity
number | null

Creative variation strength for upscaling.

resemblance
number | null

Resemblance to original for upscaling.

vectorize
boolean | null

Vectorize the output image.

remove_background
boolean | null

Remove background from output.

reframe
boolean | null

Reframe/extend the image.

refill
boolean | null

Outpaint/refill transparent areas.

seed
integer
default:-1

Random seed. -1 for random.

guidance_files
ForgeGuidanceFileInput · object[]

Reference images/files to guide generation.

Maximum array length: 20
mask
ForgeMaskInput · object

Mask for inpainting/outpainting.

session_name
string | null

Session name.

Maximum string length: 255

Response

Successful Response

inference_id
string<uuid>
required

Unique identifier for this forge run.

status
enum<string>
required

Current status: IN_PROGRESS.

Available options:
in_progress,
complete,
failed,
cancelled,
deleted
poll_interval_seconds
integer
required

Suggested polling interval in seconds.

created_at
string<date-time>
required

Timestamp of when the run was created.

estimated_price_creative_units
number | null

Estimated price in Creative Units.

session_id
string<uuid> | null

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

normalized_parameters
NormalizedInferenceParameters · object

Actual parameters used after model-specific normalization and defaults.