remagicaDocs home
API referenceGenerations

Follow your generations

GET
/generations/events

Needs a key withgenerations:read

Streams your generations as they change, as server-sent events: each one (as GET /generations lists it) when it's queued, starts, ends and is filed in the Library. Only yours, not teammates'; kinds narrows it further. Nothing is replayed: list your generations when you connect and again whenever you reconnect. The stream ends after 15 minutes; reconnect to keep following.

Requires scope generations:read.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Query Parameters

kinds?array<>|

Only these kinds (comma-separated).

Response Body

An event stream of your generations' changes.

text/event-stream
  1. response
event*unknown
data*

A generation, with the Library items it was filed as.

id?string
retry?number
Example Request
curl -X GET 'https://api.remagica.com/api/v1/generations/events'
Example Response
{  "event": "message",  "data": {    "completedAt": "2026-10-21T12:00:00.000Z",    "createdAt": "2026-09-30T12:00:00.000Z",    "createdByUserId": "f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05",    "credits": 12,    "creditsRefunded": true,    "error": null,    "id": "7a1c9e42-5b3d-4f60-8e2a-1d9c6b4f7e05",    "input": {      "prompt": "A lighthouse on a cliff at dusk, cinematic"    },    "kind": "image",    "metadata": {      "seed": 42    },    "model": "google/nano-banana-pro",    "organizationId": "9a863583-5b3d-4f60-8e2a-1d9c6b4f7e05",    "outputs": [      {        "contentType": "image/png",        "durationSeconds": 5,        "exportOf": {          "format": "string",          "index": 1        },        "height": 1280,        "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",        "kind": "image",        "previews": [          {            "height": 1280,            "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",            "width": 1024          }        ],        "previewUrl": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",        "role": "output",        "sizeBytes": 2457600,        "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",        "width": 1024,        "deleted": true,        "libraryItemId": "17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"      }    ],    "publishedAt": "2026-10-21T12:00:00.000Z",    "references": [      {        "fileIds": [          "string"        ],        "itemId": "59c47fe8-5b3d-4f60-8e2a-1d9c6b4f7e05",        "label": "string",        "version": 3,        "versionId": "772c657e-5b3d-4f60-8e2a-1d9c6b4f7e05"      }    ],    "status": "queued",    "stopRequested": true,    "updatedAt": "2026-10-21T12:00:00.000Z",    "visibility": "private",    "libraryItemId": "17c56002-5b3d-4f60-8e2a-1d9c6b4f7e05"  },  "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",  "retry": 1}