Skip to content

Estimate inference price

POST
/v1/workspaces/{workspace_id}/inferences/estimate
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": "<uuid>",
"weight": 1,
"prompt": "<string>",
"width": 0,
"height": 0,
"batch_size": 4,
"num_inference_steps": 0,
"guidance_scale": 0,
"prompt_strength": 0,
"quality": "low",
"sharpness": 0,
"duration_seconds": 0,
"generate_audio": true,
"keep_audio": true,
"fps": 0,
"video_effects": [],
"use_ta_pose": true,
"pose_mode": "A_POSE",
"include_textures": true,
"quad_mesh": true,
"pbr_materials": true,
"low_poly": true,
"generate_parts": true,
"face_limit": 0,
"stability": 0,
"use_speaker_boost": true,
"similarity_boost": 0,
"style_exaggeration": 0,
"speed": 0,
"upscale_ratio": 0,
"creativity": 0,
"resemblance": 0,
"vectorize": true,
"remove_background": true,
"reframe": true,
"refill": true
}'

Estimate the Creative Units cost of an inference with given parameters.

workspace_id
required
Workspace Id
string format: uuid
Media typeapplication/json
EstimateInferencePriceRequest

REST request body for estimating inference price. workspace_id comes from path.

object
model_id
required
Model Id

Model/style ID to use for generation.

string format: uuid
weight
Weight

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.

number
default: 1 <= 2
prompt
Any of:
string
<= 100000 characters
width
Any of:
integer
> 0
height
Any of:
integer
> 0
batch_size
Batch Size

Number of outputs (1-16).

integer
default: 4 >= 1 <= 16
num_inference_steps
Any of:
integer
> 0
guidance_scale
Any of:
number
prompt_strength
Any of:
number
<= 1
quality
Any of:
string
Allowed values: low medium high
sharpness
Any of:
number
duration_seconds
Any of:
number
> 0
generate_audio
Any of:
boolean
keep_audio
Any of:
boolean
fps
Any of:
integer
> 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
Any of:
number
<= 100
use_ta_pose
Any of:
boolean
pose_mode
Any of:
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
include_textures
Any of:
boolean
quad_mesh
Any of:
boolean
pbr_materials
Any of:
boolean
low_poly
Any of:
boolean
generate_parts
Any of:
boolean
face_limit
Any of:
integer
> 0
stability
Any of:
number
<= 1
use_speaker_boost
Any of:
boolean
similarity_boost
Any of:
number
<= 1
style_exaggeration
Any of:
number
<= 1
speed
Any of:
number
> 0
upscale_ratio
Any of:
number
creativity
Any of:
number
resemblance
Any of:
number
vectorize
Any of:
boolean
remove_background
Any of:
boolean
reframe
Any of:
boolean
refill
Any of:
boolean

Successful Response

Media typeapplication/json
EstimateForgePriceOutput
object
estimated_price_creative_units
required
Estimated Price Creative Units

Total estimated Creative Units price for this run.

number
workspace_balance_creative_units
required
Workspace Balance Creative Units

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

number
estimated_remaining_balance_creative_units
required
Estimated Remaining Balance Creative Units

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

number
has_sufficient_creative_units
required
Has Sufficient Creative Units

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

boolean
Examplegenerated
{
"estimated_price_creative_units": 1,
"workspace_balance_creative_units": 1,
"estimated_remaining_balance_creative_units": 1,
"has_sufficient_creative_units": true
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Forbidden — insufficient permissions.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Invalid input parameters.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Rate limited — too many concurrent requests.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}