Skip to main content
POST
Generate App
Generate a brand-new app from a plain-language instruction when no existing app fits your goal. Check POST /v1/apps/discover first — if a suitable app already exists, run that instead. A headless LLM planner reads your instruction, assembles a validated workflow graph from Lamina’s node catalog, and auto-publishes it as a private app. The result is a normal app: run it immediately with POST /v1/apps/{appId}/runs using the returned parameter keys, and share it with POST /v1/apps/{appId}/visibility.

One-shot generate + run

To build and execute in a single call — e.g. text → workflow → video — pass run: true with an inputs map keyed by the app’s parameter keys (media as URLs, options as labels). The response then includes a run object with the runId; poll GET /v1/runs/{runId} for the result. The app is always created; if inputs are invalid or a required input is missing, run.started is false and run.errors lists the problems so you can fix them and run the app directly.

Writing a good instruction

Describe what the app produces, the inputs the user will supply, and the desired output. The more concrete, the better the plan.
  • Good: “Product photo app: the user uploads a product image and types a background scene; output one 1:1 image.”
  • Good: “Voiceover app: the user pastes a script; output an audio voiceover.”

Response

Returns the app schema — appId, name, parameters[] (the inputs to pass to a run), outputs[], and a runUrl. Feed the parameter keys straight into POST /v1/apps/{appId}/runs. If the planner cannot produce a valid app, the response is a 422 with error and details[] describing the unresolved problems.

Provider

The provider field (claude or openai) overrides the server default for a single request — useful for A/B comparison. Omit it to use the configured default.

Authorizations

x-api-key
string
header
required

Workspace API key. Prefix: lma_. Example: lma_abc123...

Body

application/json
instruction
string
required

What the app should create, including the user inputs it needs and the desired outputs.

name
string

Optional preferred app name.

visibility
enum<string>
default:private

App reach after creation.

Available options:
private,
shared,
public
provider
enum<string>

Planner LLM provider. Defaults to the server setting (claude).

Available options:
claude,
openai
run
boolean
default:false

One-shot: after generating the app, immediately start a run using inputs. The response then includes a run object with the runId — poll GET /v1/runs/{runId}.

inputs
object

Input values keyed by the generated app's parameter key (media as URLs, options as labels). Used only when run is true.

Response

App generated and published

data
object
required