> ## Documentation Index
> Fetch the complete documentation index at: https://docs.layer.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate inference price

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



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspaces/{workspace_id}/inferences/estimate
openapi: 3.1.0
info:
  title: Layer REST API
  description: >
    REST API for AI-powered game asset creation on the Layer platform.


    ## Authentication


    All endpoints require a Bearer token in the `Authorization` header:


    ```

    Authorization: Bearer <token>

    ```


    ### Personal Access Tokens (recommended)


    The simplest way to authenticate is with a Personal Access Token (PAT):


    1. Log in to [app.layer.ai](https://app.layer.ai)

    2. Go to **Settings > Personal Access Tokens**

    3. Click **Create Token**, give it a name, and copy the token value

    4. Pass it as `Authorization: Bearer <your-pat-token>`


    PATs are long-lived and ideal for scripts, CI pipelines, and partner
    integrations.


    ### OAuth2 (browser-based)


    For browser-based applications, use the Auth0 OAuth2 flow. Redirect users to

    the Layer login page, exchange the authorization code for a JWT access
    token,

    and use it as `Authorization: Bearer <jwt>`.


    ## Creative Units


    Generations consume Creative Units (CUs). Use the estimate endpoints to
    check

    cost before executing. Check workspace balance via `GET
    /v1/workspaces/{id}`.


    ## Pagination


    List endpoints support cursor-based pagination via `limit` and `cursor`
    query

    parameters. Responses include a `pagination` object with `next_cursor`,

    `has_more_results`, and `total_count`. Cursors are opaque — do not parse or

    construct them.


    ## Errors


    All errors return [RFC 7807 Problem
    Details](https://tools.ietf.org/html/rfc7807):


    ```json

    {
      "type": "https://api.layer.ai/errors/ERROR_CODE",
      "title": "Human-readable title",
      "status": 404,
      "detail": "Detailed description of what went wrong."
    }

    ```


    Common status codes: `401` (unauthenticated), `402` (insufficient balance),

    `403` (forbidden), `404` (not found), `422` (invalid input), `429` (rate
    limited).
  version: 1.0.0
servers:
  - url: https://api.app.layer.ai/api
    description: Production
  - url: /backend/rest
    description: Local development
security: []
paths:
  /v1/workspaces/{workspace_id}/inferences/estimate:
    post:
      tags:
        - Inferences
      summary: Estimate inference price
      description: Estimate the Creative Units cost of an inference with given parameters.
      operationId: estimateInferencePrice
      parameters:
        - name: workspace_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateInferencePriceRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateForgePriceOutput'
        '401':
          description: Unauthenticated — missing or invalid Bearer token.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '402':
          description: Insufficient Creative Units balance.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '403':
          description: Forbidden — insufficient permissions.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '404':
          description: Resource not found.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '422':
          description: Invalid input parameters.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '429':
          description: Rate limited — too many concurrent requests.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
        '500':
          description: Internal server error.
          content:
            application/problem+json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://api.layer.ai/errors/ERROR_CODE
                  title:
                    type: string
                    example: Error Title
                  status:
                    type: integer
                    example: 400
                  detail:
                    type: string
                    example: Human-readable description.
                required:
                  - type
                  - title
                  - status
                  - detail
      security:
        - HTTPBearer: []
components:
  schemas:
    EstimateInferencePriceRequest:
      properties:
        model_id:
          type: string
          format: uuid
          title: Model Id
          description: Model/style ID to use for generation.
        prompt:
          anyOf:
            - type: string
              maxLength: 100000
            - type: 'null'
          title: Prompt
          description: Text prompt.
        width:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Width
          description: >-
            Output width in pixels. If not specified, a default resolution based
            on the model will be applied.
        height:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Height
          description: >-
            Output height in pixels. If not specified, a default resolution
            based on the model will be applied.
        batch_size:
          type: integer
          maximum: 16
          minimum: 1
          title: Batch Size
          description: Number of outputs (1-16).
          default: 4
        num_inference_steps:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Num Inference Steps
          description: Number of diffusion steps.
        guidance_scale:
          anyOf:
            - type: number
            - type: 'null'
          title: Guidance Scale
          description: Guidance scale (CFG).
        prompt_strength:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Prompt Strength
          description: Prompt strength for img2img (0-1).
        quality:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
            - type: 'null'
          title: Quality
          description: 'Quality level: low, medium, or high.'
        sharpness:
          anyOf:
            - type: number
            - type: 'null'
          title: Sharpness
          description: Output sharpness.
        duration_seconds:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Duration Seconds
          description: Video duration in seconds.
        generate_audio:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Generate Audio
          description: Generate audio with video.
        keep_audio:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Keep Audio
          description: Keep audio from input video.
        fps:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Fps
          description: FPS for LTX video generation (e.g. 25 or 50).
        video_effects:
          items:
            $ref: '#/components/schemas/ForgeVideoEffectInput'
          type: array
          title: Video Effects
          description: Video effects to apply.
          default: []
        use_ta_pose:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Use Ta Pose
          description: Use T/A pose for 3D.
        include_textures:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Textures
          description: Include textures in 3D output.
        quad_mesh:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Quad Mesh
          description: Generate quad mesh.
        pbr_materials:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Pbr Materials
          description: Generate PBR materials.
        low_poly:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Low Poly
          description: Generate low-poly mesh.
        generate_parts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Generate Parts
          description: Generate separate parts.
        face_limit:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Face Limit
          description: Face/polygon limit for 3D mesh.
        stability:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Stability
          description: Audio stability (0-1).
        use_speaker_boost:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Use Speaker Boost
          description: Boost speaker clarity.
        similarity_boost:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Similarity Boost
          description: Voice similarity boost (0-1).
        style_exaggeration:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Style Exaggeration
          description: Style exaggeration (0-1).
        speed:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Speed
          description: Speech speed multiplier.
        upscale_ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Upscale Ratio
          description: Upscale factor (e.g. 2.0, 4.0).
        creativity:
          anyOf:
            - type: number
            - type: 'null'
          title: Creativity
          description: Creative variation strength for upscaling.
        resemblance:
          anyOf:
            - type: number
            - type: 'null'
          title: Resemblance
          description: Resemblance to original for upscaling.
        vectorize:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Vectorize
          description: Vectorize the output image.
        remove_background:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Remove Background
          description: Remove background from output.
        reframe:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Reframe
          description: Reframe/extend the image.
        refill:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Refill
          description: Outpaint/refill transparent areas.
      type: object
      required:
        - model_id
      title: EstimateInferencePriceRequest
      description: >-
        REST request body for estimating inference price. workspace_id comes
        from path.
    EstimateForgePriceOutput:
      properties:
        estimated_price_creative_units:
          type: number
          title: Estimated Price Creative Units
          description: Total estimated Creative Units price for this run.
        workspace_balance_creative_units:
          type: number
          title: Workspace Balance Creative Units
          description: >-
            Usable Creative Units balance (total balance minus reserved by
            in-progress generations).
        estimated_remaining_balance_creative_units:
          type: number
          title: Estimated Remaining Balance Creative Units
          description: >-
            Usable balance after subtracting the estimated price. Can be
            negative.
        has_sufficient_creative_units:
          type: boolean
          title: Has Sufficient Creative Units
          description: >-
            Whether the workspace has enough available Creative Units to cover
            the estimated price.
      type: object
      required:
        - estimated_price_creative_units
        - workspace_balance_creative_units
        - estimated_remaining_balance_creative_units
        - has_sufficient_creative_units
      title: EstimateForgePriceOutput
    ForgeVideoEffectInput:
      properties:
        type:
          $ref: '#/components/schemas/VideoEffectType'
          description: >-
            Video effect type. See model capabilities for supported effects per
            model.
        weight:
          anyOf:
            - type: number
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Weight
          description: Effect strength (0-100).
      type: object
      required:
        - type
      title: ForgeVideoEffectInput
    VideoEffectType:
      type: string
      enum:
        - 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
      title: VideoEffectType
  securitySchemes:
    HTTPBearer:
      type: http
      description: >-
        Personal Access Token or OAuth2 JWT. Create a PAT at app.layer.ai →
        Settings → Personal Access Tokens.
      scheme: bearer

````