---
title: "Run an inference with a base model"
method: POST
path: "/v2/workspaces/{workspace_id}/base-models/{slug}/inferences"
tags: ["Base Models", "Inferences"]
---

# Run an inference with a base model

`POST /v2/workspaces/{workspace_id}/base-models/{slug}/inferences`

Start a generation with the given base model. The request body is the model's inference form (see GET /base-models/{slug}/inference-schema for its shape). Returns immediately with an inference id; poll GET /workspaces/{workspace_id}/inferences/{inference_id} for results.

## Path parameters

- `workspace_id` string, uuid, required — Id of the workspace that owns the resource.
- `slug` string, required — The base model, named by the id the list endpoint returns, or by its slug, display name, or alias.

## Query parameters

- `session_name` string, nullable — Organize this run under a named session. A new session is created if none matches.

## Headers

- `Idempotency-Key` string

## Request body

- object

## 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)
