Skip to main content
POST
/
v1
/
workspaces
/
{workspace_id}
/
inferences
/
estimate
Estimate inference price
curl --request POST \
  --url https://api.app.layer.ai/api/v1/workspaces/{workspace_id}/inferences/estimate \
  --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
}
'
{
  "estimated_price_creative_units": 123,
  "workspace_balance_creative_units": 123,
  "estimated_remaining_balance_creative_units": 123,
  "has_sufficient_creative_units": true
}

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 estimating inference price. 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.

Response

Successful Response

estimated_price_creative_units
number
required

Total estimated Creative Units price for this run.

workspace_balance_creative_units
number
required

Usable Creative Units balance (total balance minus reserved by in-progress generations).

estimated_remaining_balance_creative_units
number
required

Usable balance after subtracting the estimated price. Can be negative.

has_sufficient_creative_units
boolean
required

Whether the workspace has enough available Creative Units to cover the estimated price.