ScenebrewDevelopers

Pagination

Cursor pagination on every collection — limit, next_cursor, and message paging by id.

Every collection — projects, a project's scenes, sessions, library entities, an operation history — pages the same way:

Query parameterDefaultMeaning
limit20Items per page, 1 – 100
cursor—The next_cursor of the previous page; omit it for the first page.

The response wraps the page in items and tells you whether there is more:

{
  "items": [],
  "next_cursor": "MjpwYWdlOjIw"
}

next_cursor is null on the last page. Cursors are opaque: pass them back unchanged and do not build them yourself. A cursor that cannot be read answers 400 with code invalid_cursor; a cursor from another collection does the same.

cursor=""
while :; do
  body=$(curl -s "https://api.scenebrew.com/v1/projects?limit=100${cursor:+&cursor=$cursor}" \
    -H "Authorization: Bearer $SCENEBREW_API_KEY")
  echo "$body" | jq -c '.items[]'
  cursor=$(echo "$body" | jq -r '.next_cursor // empty')
  [ -z "$cursor" ] && break
done

There is no total: collections are read newest first and a loop stops when next_cursor is null.

Transcripts

A session's messages page by message id, newest first, so a client that already holds part of the conversation asks only for what it lacks:

Query parameterMeaning
beforeOnly messages older than this message id
afterOnly messages newer than this message id
limit1 – 100, default 20

GET /v1/sessions/{session_id}/messages also carries next_cursor, so the generic loop above works for transcripts too; before and after are the shortcuts.

Not paginated

A scene's artifact listing and a tenant's models are bounded sets and come back whole. The credits ledger takes a limit (default 20) and no cursor: it is the most recent entries, not a history to walk.

On this page