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. Today asset runs — a material or prop generator from GET /v1/models, billed by its vendor (BYOK) — and result.entity names the new asset; the other kinds answer 501 until available. Requires the write scope.

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. Today asset runs (a material or prop generator, GET /v1/models); theme, design and recipe answer 501 until available.

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",    "brief": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "scene_step",  "status": "queued",  "target": {    "type": "scene",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"  },  "input": {},  "progress": {},  "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"}