Library
Themes, designs, recipes and assets — the reusable pieces a scene draws on — and files, the way binaries enter the API.
A project's library is what the procedural steps build scenes from. It has four kinds of entity, nested by membership but addressed flat:
| Kind | Lives at | Children |
|---|---|---|
| theme | /v1/projects/{project_id}/themes, /v1/themes/{id} | designs |
| design | /v1/projects/{project_id}/designs, /v1/designs/{id} | recipes |
| recipe | /v1/projects/{project_id}/recipes, /v1/recipes/{id} | assets |
| asset | /v1/projects/{project_id}/assets, /v1/assets/{id} | files |
Each kind has the same five operations — list (on the project), create (on
the project), get, update and delete (by id) — plus a link per parent:
POST /v1/themes/{theme_id}/designs, POST /v1/designs/{design_id}/recipes
and POST /v1/recipes/{recipe_id}/assets, each with a DELETE …/{child_id}
to unlink. Creates accept the memberships up front (design_ids,
recipe_ids, asset_ids, theme_ids) so one call can place a new entity.
Tags
Every entity carries two lists of strings. tags are yours: set them on
create and change them on update (placeholder is one of them, see
placeholders). system_tags are
Scenebrew's and read-only: today the only one is generated, on what AI
generation made — a generated theme and its designs, recipes and assets.
An update may send system_tags back unchanged (a whole object read and
written back is fine); changing them, or setting them on a create, answers
422 system_tags_read_only. The tags filter on a list matches either
list, so ?tags=generated finds generated entities. An
export carries system_tags and an import keeps them.
Files
Binaries enter the API once, through POST /v1/files — multipart, one or
many parts per request, 100 MB per request, typed by content (GLB, PNG, JPEG,
WebP) — and are referenced by id afterwards:
curl -s -X POST https://api.scenebrew.com/v1/files \
-H "Authorization: Bearer $SCENEBREW_API_KEY" \
-F "files=@rock.glb" -F "files=@rock_albedo.png" | jq '.items[] | {id, filename, content_type, size_bytes}'A file id goes into an asset's file_ids, an existing asset's empty file
role (add a file to an asset), a scene's
source_file_id, or a message's file_ids. GET /v1/files/{file_id} reports the file with a
short-lived download_url. A file nothing references expires after 24
hours.
Designs and recipes have types
GET /v1/design-types and GET /v1/recipe-types are the catalogues a
create_design / create_recipe needs (type is required): a surface
design draws what fills the space between walkable areas (lava, water)
with a surface recipe, a props design places objects with prop
recipes. Both take
?project_id= and, with ?with_schema=true, include each type's parameter
JSON Schema so a client can build a valid parameters object.
Draft and published themes
A theme is a draft or published (status on every theme read). A
scene only uses a published theme: create_scene with a draft, switching a
scene to one with update_scene, and generate_scene_blueprint on a scene
whose theme is a draft are a 409 theme_draft. Every new theme — created,
imported or generated — starts as a draft, so you can build it up first;
publish it once it is done:
curl -s -X POST "https://api.scenebrew.com/v1/themes/$THEME_ID/publish" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" | jq '.status'Publishing checks nothing else and cannot be undone; it does not change the theme's content hash. A published theme stays editable: a scene's next blueprint uses the theme as it is then, while the blueprints and models already made keep the asset files of the theme they were made with — they still resolve by digest after a file is replaced or its asset deleted, until those scenes or artifacts are gone.
Themes: the world and the scene parameters
A theme lays scenes out only once it carries a world block, and the
block is constraints first: each constraint unlocks the values it needs,
and a block that is not unlocked must be absent.
constraints | Values | Unlocks | Means |
|---|---|---|---|
horizontal | grid | grid: {cell_size, snap} | the layout snaps to cells |
organic | nothing | the layout is free-form | |
vertical | quantized | levels: {height, count} | walkable surfaces at whole levels |
continuous | heights: {range: [min, max], max_step} | walkable surfaces at any height inside range |
The terrain design's blockout decides how a scene is laid out: a tilemap
under terrain_blockout_tiles, shapes (polygons and splines) under
terrain_blockout_platform on either horizontal constraint, and a
heightfield (a height raster) under terrain_blockout_heightfield_terraces
on a continuous world.
padding (clear space around the layout) and min_path_width are always
required; unit_scale (metres per world unit) defaults to 1. A heightfield
world is organic and continuous: beats sit at any height inside range,
ramps are slopes, a step up to max_step metres is walkable, and the
terrain design chains the terraces blockout, ground tiles and the border
bevel. The terraces recipe's slots are material:ground, material:path,
material:wall and material:<label> for every label the layout stamps on
the ground — a forest's undergrowth. Set chamfer_corners: 1 on it.
A theme's scene_parameters are its defaults for Architect's planning
modules — the same keys a scene's design document carries, resolved lowest
to highest: Architect's defaults, the theme, the document, then a PEG
Location's hints. The fill module says what fills the space between the
walkable areas: kind (void or drop are nothing, wall is raised
terrain, anything else a label), form (auto, raised, surface or
nothing), enterability, design (the surface design that draws a
lava or water fill) and, on a heightfield, amplitude and roughness for
the hills on raised ground; level_change adds max_ramp_slope in degrees.
fill.polarity (carve or raise) is declared, but layouts carve today:
raise is accepted with a warning.
A fantasy forest, as one theme: trails through raised undergrowth, terraced.
THEME_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/themes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Glade",
"world": {
"constraints": {"horizontal": "organic", "vertical": "continuous"},
"padding": 6.0, "min_path_width": 3.0,
"heights": {"range": [0.0, 12.0], "max_step": 0.4}
},
"scene_parameters": {
"fill": {"kind": "undergrowth", "form": "raised", "enterability": "fenced"},
"level_change": {"up": "ramp", "down": "drop", "max_ramp_slope": 30}
}
}' | jq -r '.id')
# the terrain design: terraces (raw heights kept, corners chamfered), ground tiles, border bevel
DESIGN_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/designs" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Forest floor\", \"type\": \"terrain\", \"theme_ids\": [\"$THEME_ID\"]}" | jq -r '.id')
curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/recipes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Forest terraces\", \"type\": \"terrain_blockout_heightfield_terraces\",
\"parameters\": {\"flatten\": \"keep\", \"chamfer_corners\": 1, \"level_height\": 1.0},
\"assets\": {\"material:ground\": \"$GRASS_ID\", \"material:path\": \"$DIRT_ID\",
\"material:undergrowth\": \"$MOSS_ID\", \"material:wall\": \"$CLIFF_ID\"},
\"design_ids\": [\"$DESIGN_ID\"]}" | jq '.id'Trees are a scatter-props design whose scatter_props recipe lists
{"key": "tree", "family": "tree", "mesh": "mesh:tree", "on": ["undergrowth"], "density_per_1000_sq_units": 12, "min_spacing": 3, "max_slope_degrees": 35}
with a tree mesh in its mesh:tree slot; a pond is a surface design a
Location's design hint binds. The blueprint operation reports
representation: heightfield and the layout_preview artifact is the
terrain's hillshade with its trails and beats.
A labyrinth, as one theme: chambers and corridors cut into a wall mass.
THEME_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/themes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Sandstone",
"world": {
"constraints": {"horizontal": "grid", "vertical": "quantized"},
"padding": 6.0, "min_path_width": 3.0,
"grid": {"cell_size": 2.0, "snap": "cell-center"},
"levels": {"height": 3.0, "count": 2}
},
"scene_parameters": {
"fill": {"kind": "wall", "enterability": "fenced"},
"boundary": {"kind": "ring"},
"level_change": {"up": "ramp", "down": "ramp"},
"crossing": {"preferred": "none"}
}
}' | jq -r '.id')
# the terrain design: the floor and the wall mass as platforms, the wall mass dressed by the building compose
DESIGN_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/designs" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Tomb walls\", \"type\": \"terrain\", \"theme_ids\": [\"$THEME_ID\"]}" | jq -r '.id')
curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/recipes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Tomb floor\", \"type\": \"terrain_blockout_platform\",
\"parameters\": {\"resample_length\": 1.0},
\"assets\": {\"material:ground\": \"$FLOOR_ID\"}, \"design_ids\": [\"$DESIGN_ID\"]}" | jq '.id'
curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/recipes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Tomb masonry\", \"type\": \"terrain_compose_wall_building\",
\"parameters\": {\"texture_scale\": {\"wall\": 4.0}},
\"assets\": {\"material:wall\": \"$MASONRY_ID\"}, \"design_ids\": [\"$DESIGN_ID\"]}" | jq '.id'The wall fill is raised terrain one level up, so the platform blockout
extrudes the chambers and corridors at the floor and the wall mass around
them; terrain_compose_wall_building binds the materials of its faces
(material:wall on the sides, texture_scale in world units per repeat for
each label). Bind each material once across the two recipes. Narrow
separator walls are a wall design with one wall recipe
(swf::structure_wall: height, thickness); leave its material slots
empty, it takes the mass's materials. Scenes do not carry separator walls yet,
so the recipe cooks nothing for now and the model step warns
structure-empty. Doors are a props design whose prop recipe targets
[{"role": "bridge", "subtype": "door"}]. The blueprint operation reports
representation: shapes.
Placeholders: designs without assets
A blueprint operation's result.findings lists every element of the PEG
the scene's theme binds nothing to — each one left out of the layout, never
a failure:
kind | Means | Filled by |
|---|---|---|
unbound_surface | a Location filled with lava, water, … that no surface design draws | a surface design, bound |
unknown_design | a design hint (or fill.design) naming a design the theme lacks | that design, or a different hint |
wrong_design_type | the named design exists but is not a surface design | a surface design, bound |
untargeted_prop | a moving platform or a teleporter no prop recipe targets | a props design; nothing to bind |
When no asset exists yet, fill one with a placeholder: a design and one
recipe that bind no assets, tagged placeholder so the theme lists them as
gaps to replace later. They cost nothing.
# a flat-colour lava surface
DESIGN_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/designs" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Lava (placeholder)\", \"type\": \"surface\", \"tags\": [\"placeholder\"], \"theme_ids\": [\"$THEME_ID\"]}" | jq -r '.id')
curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/recipes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Lava surface (placeholder)\", \"type\": \"surface\", \"parameters\": {\"color\": [0.85, 0.25, 0.05]}, \"tags\": [\"placeholder\"], \"design_ids\": [\"$DESIGN_ID\"]}" | jq '.id'- A surface recipe (
swf::common_surface) with itsmaterial:surfaceslot empty draws in itscolor([r, g, b], 0–1). Bind it where the fill is: the Location'sdesignhint in the PEG (the design's id, slug or name; upload the revised PEG withupload_scene_artifact), or the theme'sscene_parameters.fill.designfor every Location without a hint. - A prop recipe (
swf::common_prop) with itsmeshslot empty cooks as a box stand-in at every node itsparameters.attargets —[{"role": "object", "subtype": "platform"}]for a ride,[{"role": "bridge", "subtype": "teleporter"}]for a teleporter. The GLB node carriesextras.scenebrew(node,role,subtype,docksorpair), so an engine can swap in its own prefab. A prop needs no binding.
Run generate_scene_blueprint again and the finding is gone. Replacing a
placeholder later is binding an asset into the empty slot
(POST /v1/recipes/{recipe_id}/assets) and dropping the placeholder tag.
From files to a scene
# an asset from an uploaded GLB (the meshes and textures inside it are extracted)
ASSET_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/assets" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Rock\", \"type\": \"mesh\", \"file_ids\": [\"$FILE_ID\"]}" | jq -r '.id')
# a recipe of the first recipe type, with the asset bound into one of its operator slots at create
RECIPE_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/recipes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"name\": \"Rocky ground\", \"type\": \"terrain_blockout_tiles\", \"parameters\": {}, \"assets\": {\"mesh:ground\": \"$ASSET_ID\"}}" | jq -r '.id')
# a sample GLB of the recipe, synchronous
curl -s -X POST "https://api.scenebrew.com/v1/recipes/$RECIPE_ID/preview" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" | jq '.download_url'
# a theme, then the scene picks it up
THEME_ID=$(curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/themes" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d '{"name": "Mossy ruins"}' | jq -r '.id')
curl -s -X PATCH "https://api.scenebrew.com/v1/scenes/$SCENE_ID" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"theme_id\": \"$THEME_ID\"}" | jq '{id, name}'Export a theme
GET /v1/themes/{theme_id}/export answers the theme and everything
reachable from it — its designs, their recipes, the assets those slot and
the assets those reference, embedded once each — as one Scenebrew entity
container (.sbe, application/vnd.scenebrew.entity+json): the file a
Unity project or the standalone Architect imports. The bytes are exactly
what the library wrote; X-Scenebrew-Content-Hash carries the container's
hash, which is the same whatever the attachment mode, and
Content-Disposition names the file.
curl -s "https://api.scenebrew.com/v1/themes/$THEME_ID/export?attachments=reference" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -D headers.txt -o mossy-ruins.sbe
grep -i x-scenebrew-content-hash headers.txt?attachments= decides how asset bytes travel: by-size (the default —
small files inline as gzip+base64, the rest by URI), reference (URIs
only, the smallest file), full (everything inline, for offline import),
by-role (inline only the file roles and recipe slots you name, both
repeatable: roles=mask&roles=height&slots=mesh:wall_*). Every URI is
this API's GET /v1/assets/{asset_id}/files/{role}?sha256=<digest>, which
needs the same key, answers 307 to a short-lived download of exactly
those bytes, and keeps resolving after the asset's file is replaced. A
theme in another project answers 404.
The MCP server exposes the same call as export_theme.
Add a file to an asset
An asset can be created without files and take them later, one role at
a time — mesh on a mesh asset, texture on a texture asset, a channel
(albedo, normal, roughness, height, metallic, ao, emission,
opacity, mask) on a material. POST /v1/assets/{asset_id}/files fills
an empty role from an uploaded file through the same ingest as
create_asset, whether or not a recipe already references the asset:
curl -s -X POST "https://api.scenebrew.com/v1/assets/$ASSET_ID/files" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"file_id\": \"$FILE_ID\", \"role\": \"mesh\"}" -D headers.txt | jq '.files'
grep -i etag headers.txt # "<sha256>" — the role's digestFilling and replacing are different actions, and there is no force flag:
| Case | Answer |
|---|---|
| the role is empty, referenced or not | 201, the asset with the file under files[role] |
| the same bytes again | 200, nothing changed, ETag unchanged |
| different bytes on a filled role | 409 role_filled — consumers names the recipes (with their slots) and themes using the asset; nothing is stored |
| different content for this generation only | create a new asset and rebind the slots that should use it (create_asset, then link_recipe_asset) |
| a deliberate replacement | PUT /v1/assets/{asset_id}/files/{role} with If-Match on the digest the role holds (files[role].sha256): stale 412, missing 428 |
curl -s -X PUT "https://api.scenebrew.com/v1/assets/$ASSET_ID/files/mesh" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-H "If-Match: \"$CURRENT_SHA256\"" \
-d "{\"file_id\": \"$FILE_ID\"}" | jq '.files.mesh.sha256'If-Match is what makes a replacement safe: you replace the bytes you
looked at, never what someone else put there in between (412 precondition_failed carries current_sha256). Two concurrent fills of one
empty role with different bytes leave exactly one winner; with identical
bytes both succeed. A replaced digest keeps resolving through
GET /v1/assets/{asset_id}/files/{role}?sha256=<digest> for the retention
period, so an export made before the replacement still works, and it leaves
your storage usage at once.
The MCP server exposes both as add_asset_file and
replace_asset_file.
Generation
POST /v1/projects/{project_id}/generations asks the AI to create a library
entity; it runs as an operation of kind generation and names
what it made in result.entity when it succeeds.
assetruns on the bring-your-own-key generator behind the chosenmodel(seeGET /v1/models) and is billed by that vendor.themeis planned from your concept art: 1 to n uploaded images inreference_file_ids, planned together, and an optionalbrief. Without an image, one concept image is generated from the brief first, on your team's Scenario key; without that key the operation failsno_provider_keybefore anything is created — upload concept art or add the key. The theme is planned, every recipe filled against its operator's schema, and the whole plan validated by the library: its style profile (with the images it was read from), its world and scene parameters, one terrain design, the fill surfaces and scatter collections, and a slot for every asset it would make.asset_idsare library assets the theme should use where they fit; every other slot carries the crop of the concept art its asset is to be made from. The plan is a proposal: nothing of it is in the library until you approve it, and the approval creates the theme. Billed in credits.designofdesign_typeis filled fortheme_id's world and style;count(1–4) asks for that many variants. One design is linked into the theme; several stay standalone until you link the one you choose (a theme keeps exactly one terrain design).recipeofrecipe_typeis filled and, withdesign_id, appended to that design's chain.
A design or recipe is in the library as soon as it is filled, with the asset
slots its recipes need left open: link library assets to them. A theme_id,
design_id or asset_ids entry that is not the project's is a 404
theme_not_found, design_not_found or asset_not_found naming it; a
reference_file_ids entry that is not your team's is a 404
file_not_found.
curl -s -X POST "https://api.scenebrew.com/v1/projects/$PROJECT_ID/generations" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-H "Prefer: wait=60" \
-d "{\"kind\": \"theme\", \"reference_file_ids\": [\"$CONCEPT_FILE_ID\"],
\"brief\": \"an ember-lit lava cave\", \"request_id\": \"$(uuidgen)\"}"A theme's result carries readiness (the verdict of its validation) and
plan_file (the stored plan), plus the theme in entity and approval once
its plan is approved. Generation takes minutes; poll the operation.
Retries. request_id is the generation's identity: create one per
generation you intend and send it again on every retry. The same id with the
same arguments returns the original operation; with other arguments the
request is refused 409 request_id_reused; a new id with the same arguments
is a second generation. Without one the server mints it and returns it in
input.request_id. The budget is one of the arguments: the same id with
another budget is a 409 request_id_reused.
Approval
Once its plan is made, a theme generation stops in input_required —
not terminal; ?wait and Prefer: wait answer as soon as it gets there —
with the decision it waits for in the operation's approval. Nothing of the
plan is in the library yet: each slot is a line of the plan, not an asset
record.
| Field | What it is |
|---|---|
plan_revision | the plan you decide on (r1); name it when approving |
theme_id | null: the theme is created when you approve the plan |
slots | one per asset the plan would make: id (its plan key, stable within the plan revision), name, type, the concept-art crop it is made from (evidence), the recipe slots it fills (consumers, each recipe named by its plan key in recipe), required, and its estimate |
gaps | what the plan could not cover |
totals | the known estimates added up (creative_units on each slot's first choice, their worst case max_creative_units, job_count), how many slots have no known price (unknown) and whether every price is known (complete) |
budget | the budget that applies — yours (source: request) or your team's default (tenant_default) |
reason | why it waits: review_requested, over_budget, estimate_unknown (a price is not known and the budget is not unlimited), auto_approval_failed or revision_failed (your feedback could not revise the plan; this one still waits) |
revised_from | on a revised plan: the revision it came from and your feedback (plan_revision, feedback); null on the first |
An estimate names the provider route that would make the asset on your
team's Scenario key, its price in Scenario creative units (CU) and the
number of provider jobs. Where a route's price is not known yet,
creative_units is null and known is false — never a guess. A slot's
route_options lists every route it may be made on, its default
(estimate) first: a mesh on Tripo 3.1, Tripo P2 or Meshy 7.1, each at its
own price. fallbacks lists the routes the slot is tried on, in order, when
its own route's attempts are rejected, each at its price for one attempt;
creative_units stays the first choice's price, what the asset is expected
to cost. max_creative_units is the slot's worst case: two attempts on its
route and on each fallback, then the maps of the best attempt — null when a
price is not known.
Budget. budget: {"creative_units": N} on the generation is what
interactivity: "no_questions" (the default) may approve without asking;
{"creative_units": null} is unlimited, and without one your team's default
applies (400 CU). When the estimate fits — every price known and the total
of the first choices (totals.creative_units) within the budget, or an
unlimited budget — every slot is approved for generation on its own: the
theme is created and its slots generated as below. Otherwise it stops in
input_required and approval.reason says why. interactivity: "review"
always stops. An approval reserves the slots' worst case
(totals.max_creative_units), never more than the budget, and generation
spends only within what it reserved.
Approve with POST /v1/operations/{operation_id}/approve, naming the plan
revision and one choice per slot, keyed by its id (approval.slots[].id):
action | What happens to the slot |
|---|---|
generate | approved and queued for generation on its default route, or on route, one of the slot's route_options (another is a 400 unknown_route); a slot without a choice is generated |
upload | file_id (from POST /v1/files) becomes a new asset — one file role of it, role or albedo / texture / mesh by its type — that fills every recipe slot the slot names |
bind | asset_id, an existing library asset of the slot's type, fills them |
leave_open | nothing fills them, and the theme stays a draft |
curl -s -X POST "https://api.scenebrew.com/v1/operations/$OP_ID/approve" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d "{\"plan_revision\": \"r1\", \"choices\": {
\"$WALL_SLOT\": {\"action\": \"upload\", \"file_id\": \"$FILE_ID\"},
\"$SAND_SLOT\": {\"action\": \"bind\", \"asset_id\": \"$LIBRARY_SAND_ID\"},
\"$CRYSTAL_SLOT\": {\"action\": \"leave_open\"}}}" | jq '{status, result}'The approved plan is created in the library — the theme, as a draft, with its
designs and recipes — the choices are applied to it, and the theme's
readiness is validated again (result.readiness). With nothing to generate,
the operation answers succeeded with the theme in result.entity and
result.approval: applied (uploads and binds), left_open (with the
recipe slots each would fill), and draft_accepted — true when a
required slot was left open, so the theme stays a draft by your choice
rather than by accident. To model a mesh with Baker, leave its slot open,
call model_asset and link the mesh it delivers to the recipes
result.approval.left_open names.
With slots to generate, the operation goes on running. Each material is
made on your team's Scenario key within what the approval reserved and becomes a
library asset tagged generated, bound wherever the slot is used.
The acceptance gate rejects an attempt only for a defect in the file itself
(a texture that is not square or does not tile; a mesh that is empty,
untextured, flat or over its face budget) and tries again: two attempts on
the slot's route, then two on each of its fallbacks; measures against
the concept, such as colour or detail density, are recorded, never rejected.
When every attempt has a defect, the least defective usable one is delivered.
Either way the slot's review lists what to check (kind defect or
finding, with code, message, measure and limit), the theme's
readiness repeats it as optional findings, and evidence keeps every attempt
with its outcome, creative units and measures — replace a delivered asset's
file when you disagree. A slot settles open only when nothing usable came
back, with why in its finding.code: texture_rejected or
mesh_rejected (no attempt left a usable file), over_budget,
no_provider_key, provider_credits_exhausted (your team's Scenario plan
has no creative units left), a provider failure, or route_unavailable for
a mesh. The operation's
progress names the theme (entity), each slot (slots: its status, asset,
creative units, review and finding) and the spend (spent). Once every slot is
settled it ends succeeded, result.approval.queued_for_generation keeping
the same per slot. A required slot that stays open keeps the theme a
draft.
Approving another plan revision answers 409 plan_revision_stale (read the
operation again); an operation that is not waiting answers
409 not_awaiting_approval. A bind whose asset is not the project's is a
404 asset_not_found, an upload whose file is not your team's a
404 file_not_found, and a bound asset of another type a
422 asset_type_mismatch; each names its slot in slot_id and changes
nothing — send the approval again.
Changing the plan
Instead of approving, say what to change with
POST /v1/operations/{operation_id}/revise, naming the plan revision your
feedback is about:
curl -s -X POST "https://api.scenebrew.com/v1/operations/$OP_ID/revise" \
-H "Authorization: Bearer $SCENEBREW_API_KEY" -H "Content-Type: application/json" \
-d '{"plan_revision": "r1", "feedback": "no crystals, add a stone bridge"}' | jq '{status, progress}'The operation goes on running (progress.stage revising) while the plan
is revised from the same concept images, then stops in input_required
again with the next revision (r1 → r2): its slots, estimates and budget
worked out again, and approval.revised_from naming the revision and
feedback it came from. Approve it, or revise it again. Nothing is in the
library before an approval, and approving the earlier revision now answers
409 plan_revision_stale. A revision costs credits like the first plan.
A theme planned from a brief alone was planned from a concept image made
for it; "new_concept_image": true makes that image anew from the brief and
your feedback, while a theme planned from your own images refuses it
(422 concept_image_not_generated). A revision that fails leaves the plan
it had waiting, with approval.reason.code revision_failed. Feedback on
another revision is a 409 plan_revision_stale, on an operation that is not
waiting a 409 not_awaiting_approval.
Readiness
A theme's readiness is a versioned validation record, outside its content:
GET /v1/themes/{theme_id}/readiness answers satisfied (validated and
complete), draft (validated, with required findings — a generated theme
with a required asset slot still open, each named), stale (the theme
changed since it was validated) or not_satisfied (never validated for the
target_profile, default default). The record carries the validated
content_digest — the theme's content hash — and its findings. Editing the
theme makes the record stale; recording one never changes the hash.
Operations
One async model for everything slow — scene steps, session turns and library generations — with wait, poll, history and cancel.
Scene models: references and variants
What a scene's GLB references from the library, the four variants every model route serves, and how a renderer resolves the references.