Skip to Content
ScenebrewDevelopers
API referenceLibrary

Generate Library Entity

POST
/v1/projects/{project_id}/generations

Ask the AI for a library entity, as an Operation (202 + Location). One contract for themes, designs, recipes and assets: kind names what is made, model where inference runs and who is billed. An asset runs on a material or prop generator from GET /v1/models, billed by its vendor (BYOK). A theme is planned from its concept images (or from one generated from the brief on your Scenario key) and filled; the plan then waits in input_required for your approval of the assets it would make (approve_generation), unless no_questions approves them within the budget. Nothing of it is in the library before that: the approval creates the theme as a draft, with a readiness record. A design or recipe is filled for a theme's world and published at once, its asset slots open. result.entity names what was made; a theme's result.readiness says whether it is complete (draft while assets are not generated yet). Retries carry the same request_id. 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 a 404 file_not_found. Requires the write scope.

Authorization

apiKey
AuthorizationBearer <token>

First-party API key (sbk_live_…), presented as a Bearer token.

In: header

Path Parameters

project_id*Project Id
Formatuuid

Header Parameters

Idempotency-Key?|

Optional. Repeating a request with the same key returns what it already created (200) instead of running it again.

Prefer?|

RFC 7240. wait=N (N ≤ 60) holds the response until the operation is terminal or N seconds passed: 200 with the finished operation, or the same 202 as without it. respond-async (the default) returns the queued operation at once.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Ask the AI for a library entity. One contract for all four kinds; the model decides where inference runs and who is billed. An asset runs on a material or prop generator (GET /v1/models, BYOK); a theme, design or recipe on Scenebrew's agent, billed in credits.

Response Body

application/json

application/json

application/problem+json

curl -X POST "https://example.com/v1/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/generations" \  -H "Content-Type: application/json" \  -d '{    "kind": "theme"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "scene_step",  "status": "queued",  "target": {    "type": "scene",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"  },  "input": {},  "progress": {},  "approval": {    "kind": "theme_plan",    "plan_revision": "string",    "theme_id": "ef2b46f3-8ebb-437e-a671-272e4990fbc8",    "interactivity": "review",    "slots": [      {        "id": "string",        "name": "string",        "type": "material",        "family": "string",        "surface_role": "string",        "orientation": "string",        "detail_level": "string",        "evidence": {          "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767",          "image": "string",          "box": [            0          ],          "note": "string"        },        "object_evidence": [],        "provider_hint": "string",        "fallback_color": "string",        "consumers": [],        "required": true,        "estimate": {          "route": "string",          "label": "string",          "provider": "string",          "creative_units": 0,          "job_count": 0,          "known": true,          "description": "string",          "fallbacks": [],          "max_creative_units": 0        },        "route_options": []      }    ],    "gaps": [],    "totals": {      "creative_units": 0,      "max_creative_units": 0,      "job_count": 0,      "unknown": 0,      "complete": true    },    "budget": {      "creative_units": 0,      "source": "request"    },    "reason": {      "code": "string",      "message": "string"    },    "revised_from": {      "plan_revision": "string",      "feedback": "string"    },    "cost_cap": {      "spent_usd": 0,      "cap_usd": 0,      "step_usd": 0    }  },  "result": {},  "error": {    "code": "string",    "message": "string",    "retryable": false  },  "credits_charged": 0,  "model": {    "id": "string",    "hosting": "scenebrew",    "billing": "credits"  },  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "created_at": "2019-08-24T14:15:22Z",  "started_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z",  "cancel_requested_at": "2019-08-24T14:15:22Z"}